/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.tuscany.sca.binding.jms;
import java.io.StringReader;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamReader;
import junit.framework.TestCase;
import org.apache.tuscany.sca.assembly.Composite;
import org.apache.tuscany.sca.assembly.OperationsConfigurator;
import org.apache.tuscany.sca.assembly.WireFormat;
import org.apache.tuscany.sca.binding.jms.wireformat.WireFormatJMSBytes;
import org.apache.tuscany.sca.binding.jms.wireformat.WireFormatJMSObject;
import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
/**
* Tests for JMS binding xml
*/
public class JMSBindingProcessorTestCase extends TestCase {
// Note: If you are adding new JMS binding read test cases,
// consider adding a similar test case to JMSBindingProcessorWriteTestCase.
public static final String COMPOSITE =
""
+ ""
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ "";
public static final String HEADERS1 =
""
+ ""
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ "";
public static final String HEADERS_INVALID_PRIORITY =
""
+ ""
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ "";
public static final String PROPERTIES1 =
""
+ ""
+ " "
+ " "
+ " "
+ " "
+ " "
+ " bla"
+ " 42"
+ " "
+ " "
+ " "
+ " "
+ "";
public static final String OP_PROPERTIES1 =
""
+ ""
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " bla"
+ " 42"
+ " "
+ " "
+ " "
+ " "
+ " op2bla"
+ " 77"
+ " "
+ " "
+ " "
+ " "
+ " "
+ "";
public static final String OP_NAMES_NO_PROPERTIES1 =
""
+ ""
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ "";
public static final String SELECTOR =
""
+ ""
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ "";
public static final String COMPOSITE_INVALID_URI =
""
+ ""
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ "";
// Invalid: contains both a response attribute and a response element.
public static final String COMPOSITE_INVALID_RESPONSE_ATTR_ELEMENT =
""
+ ""
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ "";
public static final String DEST_PROPS =
""
+ ""
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " some value text"
+ " "
+ " "
+ " bla"
+ " "
+ " "
+ " "
+ " "
+ " "
+ "";
public static final String CF_PROPS =
""
+ ""
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " some value text"
+ " "
+ " "
+ " bla"
+ " "
+ " "
+ " "
+ " "
+ " "
+ "";
public static final String AS_PROPS =
""
+ ""
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " some value text"
+ " "
+ " "
+ " bla"
+ " "
+ " "
+ " "
+ " "
+ " "
+ "";
public static final String RESP_DEST_PROPS =
""
+ ""
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " some value text"
+ " "
+ " "
+ " bla"
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ "";
public static final String RESP_CF_PROPS =
""
+ ""
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " some value text"
+ " "
+ " "
+ " bla"
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ "";
public static final String RESP_AS_PROPS =
""
+ ""
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " some value text"
+ " "
+ " "
+ " bla"
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ "";
public static final String OP_PROPS_PROPS =
""
+ ""
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " some value text"
+ " "
+ " "
+ " bla"
+ " "
+ " "
+ " "
+ " "
+ " "
+ "";
public static final String RES_ADPT_PROPS =
""
+ ""
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " some value text"
+ " "
+ " "
+ " bla"
+ " "
+ " "
+ " "
+ " "
+ " "
+ "";
public static final String CONFIGURED_OPERATIONS =
""
+ ""
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ "";
public static final String WIRE_FORMAT =
""
+ ""
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ "";
public static final String OP_PROP_NAME =
""
+ ""
+ " "
+ " "
+ " "
+ " "
+ " "
+ " "
+ "";
private XMLInputFactory inputFactory;
private StAXArtifactProcessor