You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2007/02/25 20:57:05 UTC
svn commit: r511585 [8/10] - in /webservices/axis2/trunk/java/modules/kernel:
src/org/apache/axis2/addressing/ src/org/apache/axis2/addressing/wsdl/
src/org/apache/axis2/builder/ src/org/apache/axis2/cluster/
src/org/apache/axis2/context/ src/org/apach...
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/wsdl/util/WSDL4JImportedWSDLHelper.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/wsdl/util/WSDL4JImportedWSDLHelper.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/wsdl/util/WSDL4JImportedWSDLHelper.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/wsdl/util/WSDL4JImportedWSDLHelper.java Sun Feb 25 11:56:59 2007
@@ -1,137 +1,136 @@
-/*
-* Licensed 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.axis2.wsdl.util;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Vector;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Import;
-import javax.wsdl.Types;
-import javax.wsdl.extensions.ExtensibilityElement;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * This class provides support for processing a WSDL4J defintion which includes imports.
- * It allows the imports to be processed into a single WSDL4J Definition object
- */
-public class WSDL4JImportedWSDLHelper {
-
- protected static final Log log = LogFactory.getLog(WSDL4JImportedWSDLHelper.class);
- private static final boolean isTraceEnabled = log.isTraceEnabled();
-
- /**
- * The intention of this procedure is to process the imports. When
- * processing the imports the imported documents will be populating the
- * items in the main document recursivley
- *
- * @param wsdl4JDefinition
- */
- public static void processImports(Definition wsdl4JDefinition) {
- if(isTraceEnabled){
- log.trace("processImports: wsdl4JDefinition="+wsdl4JDefinition);
- }
- Map imported_defs = new HashMap();
- getImportedDefinitions(wsdl4JDefinition, imported_defs);
-
- for (Iterator iterator = imported_defs.values().iterator(); iterator.hasNext();) {
- Definition imported_def = (Definition) iterator.next();
-
- Map def_namespaces = wsdl4JDefinition.getNamespaces();
- Map imported_def_namespaces = imported_def.getNamespaces();
-
- Object prefix;
-
-
- for (Iterator prefix_iterator = imported_def_namespaces.keySet().iterator(); prefix_iterator.hasNext();) {
- prefix = prefix_iterator.next();
-
- if (!def_namespaces.containsKey(prefix)) {
- def_namespaces.put(prefix, imported_def_namespaces.get(prefix));
- }
- }
-
- // copy types
- Types imported_def_types = imported_def.getTypes();
-
- if (imported_def_types != null) {
- Types def_types = wsdl4JDefinition.getTypes();
-
- if (def_types == null) {
- def_types = wsdl4JDefinition.createTypes();
- wsdl4JDefinition.setTypes(def_types);
- }
-
- for (Iterator types_iterator =
- imported_def_types.getExtensibilityElements().iterator();
- types_iterator.hasNext();) {
- // CHECKME
- def_types.addExtensibilityElement((ExtensibilityElement) types_iterator.next());
- }
- }
-
- // add messages
- wsdl4JDefinition.getMessages().putAll(imported_def.getMessages());
-
- // add portTypes
- wsdl4JDefinition.getPortTypes().putAll(imported_def.getPortTypes());
-
- // add bindings
- wsdl4JDefinition.getBindings().putAll(imported_def.getBindings());
-
- // add services
- wsdl4JDefinition.getServices().putAll(imported_def.getServices());
-
- // add ExtensibilityElements
- wsdl4JDefinition.getExtensibilityElements()
- .addAll(imported_def.getExtensibilityElements());
- }
- }
-
- private static void getImportedDefinitions(Definition definition, Map importedDefs) {
- Map wsdlImports = definition.getImports();
-
- Import wsdl_import;
- Definition imported_def;
- String import_def_key;
-
- for (Iterator iterator = wsdlImports.values().iterator(); iterator.hasNext();) {
- Vector imports = (Vector) iterator.next();
- Iterator iter2 = imports.iterator();
- while (iter2.hasNext()) {
- wsdl_import = (Import) iter2.next();
- if(isTraceEnabled){
- log.trace("getImportedDefinitions: import uri="+wsdl_import.getLocationURI());
- }
- imported_def = wsdl_import.getDefinition();
-
- import_def_key = imported_def.getDocumentBaseURI();
-
- if (import_def_key == null) {
- import_def_key = imported_def.getTargetNamespace();
- }
-
- if (!importedDefs.containsKey(import_def_key)) {
- importedDefs.put(import_def_key, imported_def);
- getImportedDefinitions(imported_def, importedDefs);
- }
- }
- }
- }
-}
+/*
+* Licensed 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.axis2.wsdl.util;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Import;
+import javax.wsdl.Types;
+import javax.wsdl.extensions.ExtensibilityElement;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Vector;
+
+/**
+ * This class provides support for processing a WSDL4J defintion which includes imports.
+ * It allows the imports to be processed into a single WSDL4J Definition object
+ */
+public class WSDL4JImportedWSDLHelper {
+
+ protected static final Log log = LogFactory.getLog(WSDL4JImportedWSDLHelper.class);
+ private static final boolean isTraceEnabled = log.isTraceEnabled();
+
+ /**
+ * The intention of this procedure is to process the imports. When
+ * processing the imports the imported documents will be populating the
+ * items in the main document recursivley
+ *
+ * @param wsdl4JDefinition
+ */
+ public static void processImports(Definition wsdl4JDefinition) {
+ if (isTraceEnabled) {
+ log.trace("processImports: wsdl4JDefinition=" + wsdl4JDefinition);
+ }
+ Map imported_defs = new HashMap();
+ getImportedDefinitions(wsdl4JDefinition, imported_defs);
+
+ for (Iterator iterator = imported_defs.values().iterator(); iterator.hasNext();) {
+ Definition imported_def = (Definition) iterator.next();
+
+ Map def_namespaces = wsdl4JDefinition.getNamespaces();
+ Map imported_def_namespaces = imported_def.getNamespaces();
+
+ Object prefix;
+
+
+ for (Iterator prefix_iterator = imported_def_namespaces.keySet().iterator(); prefix_iterator.hasNext();) {
+ prefix = prefix_iterator.next();
+
+ if (!def_namespaces.containsKey(prefix)) {
+ def_namespaces.put(prefix, imported_def_namespaces.get(prefix));
+ }
+ }
+
+ // copy types
+ Types imported_def_types = imported_def.getTypes();
+
+ if (imported_def_types != null) {
+ Types def_types = wsdl4JDefinition.getTypes();
+
+ if (def_types == null) {
+ def_types = wsdl4JDefinition.createTypes();
+ wsdl4JDefinition.setTypes(def_types);
+ }
+
+ for (Iterator types_iterator =
+ imported_def_types.getExtensibilityElements().iterator();
+ types_iterator.hasNext();) {
+ // CHECKME
+ def_types.addExtensibilityElement((ExtensibilityElement) types_iterator.next());
+ }
+ }
+
+ // add messages
+ wsdl4JDefinition.getMessages().putAll(imported_def.getMessages());
+
+ // add portTypes
+ wsdl4JDefinition.getPortTypes().putAll(imported_def.getPortTypes());
+
+ // add bindings
+ wsdl4JDefinition.getBindings().putAll(imported_def.getBindings());
+
+ // add services
+ wsdl4JDefinition.getServices().putAll(imported_def.getServices());
+
+ // add ExtensibilityElements
+ wsdl4JDefinition.getExtensibilityElements()
+ .addAll(imported_def.getExtensibilityElements());
+ }
+ }
+
+ private static void getImportedDefinitions(Definition definition, Map importedDefs) {
+ Map wsdlImports = definition.getImports();
+
+ Import wsdl_import;
+ Definition imported_def;
+ String import_def_key;
+
+ for (Iterator iterator = wsdlImports.values().iterator(); iterator.hasNext();) {
+ Vector imports = (Vector) iterator.next();
+ Iterator iter2 = imports.iterator();
+ while (iter2.hasNext()) {
+ wsdl_import = (Import) iter2.next();
+ if (isTraceEnabled) {
+ log.trace("getImportedDefinitions: import uri=" + wsdl_import.getLocationURI());
+ }
+ imported_def = wsdl_import.getDefinition();
+
+ import_def_key = imported_def.getDocumentBaseURI();
+
+ if (import_def_key == null) {
+ import_def_key = imported_def.getTargetNamespace();
+ }
+
+ if (!importedDefs.containsKey(import_def_key)) {
+ importedDefs.put(import_def_key, imported_def);
+ getImportedDefinitions(imported_def, importedDefs);
+ }
+ }
+ }
+ }
+}
Propchange: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/wsdl/util/WSDL4JImportedWSDLHelper.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: webservices/axis2/trunk/java/modules/kernel/test-resources/PingService.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/kernel/test-resources/wsdl/actionTests.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test-resources/wsdl/actionTests.wsdl?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test-resources/wsdl/actionTests.wsdl (original)
+++ webservices/axis2/trunk/java/modules/kernel/test-resources/wsdl/actionTests.wsdl Sun Feb 25 11:56:59 2007
@@ -1,13 +1,13 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:tns="http://ws.apache.org/axis2/actiontest/"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="actionTests"
- xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
- targetNamespace="http://ws.apache.org/axis2/actiontest/">
- <wsdl:types>
- </wsdl:types>
- <wsdl:message name="echoResponse">
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://ws.apache.org/axis2/actiontest/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="actionTests"
+ xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
+ targetNamespace="http://ws.apache.org/axis2/actiontest/">
+ <wsdl:types>
+ </wsdl:types>
+ <wsdl:message name="echoResponse">
<wsdl:part name="echoResponse" type="xsd:string"></wsdl:part>
</wsdl:message>
<wsdl:message name="echoRequest">
@@ -45,108 +45,108 @@
</wsdl:message>
<wsdl:portType name="withoutWSAWAction">
<wsdl:operation name="echo">
- <wsdl:input message="tns:echoRequest" name="NamedInput"></wsdl:input>
- <wsdl:output message="tns:echoResponse" name="NamedOutput"></wsdl:output>
+ <wsdl:input message="tns:echoRequest" name="NamedInput"></wsdl:input>
+ <wsdl:output message="tns:echoResponse" name="NamedOutput"></wsdl:output>
<wsdl:fault name="echoFault" message="tns:echoechoFault"></wsdl:fault>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:portType name="withWSAWAction">
- <wsdl:operation name="echo">
- <wsdl:input message="tns:echoRequest1" wsaw:Action="http://example.org/action/echoIn"></wsdl:input>
- <wsdl:output message="tns:echoResponse1" wsaw:Action="http://example.org/action/echoOut"></wsdl:output>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:portType name="withWSAWAction">
+ <wsdl:operation name="echo">
+ <wsdl:input message="tns:echoRequest1" wsaw:Action="http://example.org/action/echoIn"></wsdl:input>
+ <wsdl:output message="tns:echoResponse1" wsaw:Action="http://example.org/action/echoOut"></wsdl:output>
<wsdl:fault name="echoFault" message="tns:echoechoFault1" wsaw:Action="http://example.org/action/echoFault"></wsdl:fault>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:portType name="withoutWSAWActionNoName">
- <wsdl:operation name="echo">
- <wsdl:input message="tns:echoRequest2"></wsdl:input>
- <wsdl:output message="tns:echoResponse2"></wsdl:output>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:portType name="withoutWSAWActionNoName">
+ <wsdl:operation name="echo">
+ <wsdl:input message="tns:echoRequest2"></wsdl:input>
+ <wsdl:output message="tns:echoResponse2"></wsdl:output>
<wsdl:fault name="echoFault" message="tns:echoechoFault2"></wsdl:fault>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:portType name="withSOAPAction">
- <wsdl:operation name="echo">
- <wsdl:input message="tns:echoRequest3"></wsdl:input>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:portType name="withSOAPAction">
+ <wsdl:operation name="echo">
+ <wsdl:input message="tns:echoRequest3"></wsdl:input>
<wsdl:output message="tns:echoResponse3"></wsdl:output>
<wsdl:fault name="echoFault" message="tns:echoechoFault3"></wsdl:fault>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name="withoutWSAWActionBinding"
- type="tns:withoutWSAWAction">
- <soap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="echo">
- <soap:operation
- soapAction="" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- <wsdl:fault name="echoFault">
- <soap:fault name="echoFault" use="literal" />
- </wsdl:fault>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:binding name="withWSAWActionBinding"
- type="tns:withWSAWAction">
- <soap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="echo">
- <soap:operation
- soapAction="" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- <wsdl:fault name="echoFault">
- <soap:fault name="echoFault" use="literal" />
- </wsdl:fault>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:binding name="withoutWSAWActionNoNameBinding"
- type="tns:withoutWSAWActionNoName">
- <soap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="echo">
- <soap:operation
- soapAction="" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- <wsdl:fault name="echoFault">
- <soap:fault name="echoFault" use="literal" />
- </wsdl:fault>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:binding name="withSOAPActionBinding"
- type="tns:withSOAPAction">
- <soap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="echo">
- <soap:operation
- soapAction="http://ws.apache.org/axis2/actiontest/echo" />
- <wsdl:input>
- <soap:body use="literal" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- </wsdl:output>
- <wsdl:fault name="echoFault">
- <soap:fault name="echoFault" use="literal" />
- </wsdl:fault>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name="actionTests">
- <wsdl:port binding="tns:withSOAPActionBinding"
- name="actionTestsSOAP">
- <soap:address location="http://tempuri.org" />
- </wsdl:port>
- </wsdl:service>
-</wsdl:definitions>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="withoutWSAWActionBinding"
+ type="tns:withoutWSAWAction">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="echo">
+ <soap:operation
+ soapAction="" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ <wsdl:fault name="echoFault">
+ <soap:fault name="echoFault" use="literal" />
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="withWSAWActionBinding"
+ type="tns:withWSAWAction">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="echo">
+ <soap:operation
+ soapAction="" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ <wsdl:fault name="echoFault">
+ <soap:fault name="echoFault" use="literal" />
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="withoutWSAWActionNoNameBinding"
+ type="tns:withoutWSAWActionNoName">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="echo">
+ <soap:operation
+ soapAction="" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ <wsdl:fault name="echoFault">
+ <soap:fault name="echoFault" use="literal" />
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="withSOAPActionBinding"
+ type="tns:withSOAPAction">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="echo">
+ <soap:operation
+ soapAction="http://ws.apache.org/axis2/actiontest/echo" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ <wsdl:fault name="echoFault">
+ <soap:fault name="echoFault" use="literal" />
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="actionTests">
+ <wsdl:port binding="tns:withSOAPActionBinding"
+ name="actionTestsSOAP">
+ <soap:address location="http://tempuri.org" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
Propchange: webservices/axis2/trunk/java/modules/kernel/test-resources/wsdl/actionTests.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: webservices/axis2/trunk/java/modules/kernel/test-resources/wsdl/test1.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: webservices/axis2/trunk/java/modules/kernel/test-resources/wsdl/test2.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/addressing/EndpointReferenceHelperTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/addressing/EndpointReferenceHelperTest.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/addressing/EndpointReferenceHelperTest.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/addressing/EndpointReferenceHelperTest.java Sun Feb 25 11:56:59 2007
@@ -1,243 +1,243 @@
-/*
-* Copyright 2006 The Apache Software Foundation.
-*
-* Licensed 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.axis2.addressing;
-
-import java.util.ArrayList;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMAttribute;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-
-import junit.framework.TestCase;
-
-public class EndpointReferenceHelperTest extends TestCase {
-
- public void testToAndFromOMForFinalSpecEPR() throws Exception{
- String address = "http://ws.apache.org/axis2";
- EndpointReference epr = new EndpointReference(address);
-
- OMFactory omf = OMAbstractFactory.getOMFactory();
- OMNamespace ns1 = omf.createOMNamespace("http://uri1","prefix1");
- OMAttribute attr1 = omf.createOMAttribute("attr1",ns1,"attr1value");
- OMNamespace ns2 = omf.createOMNamespace("http://uri2","prefix2");
- OMAttribute attr2 = omf.createOMAttribute("attr2",ns2,"attr2value");
- epr.addAttribute(attr1);
- epr.addAttribute(attr2);
- OMElement md1 = omf.createOMElement("md1", "http://mduri1", "md1prefix");
- OMElement md2 = omf.createOMElement("md2", "http://mduri2", "md2prefix");
- epr.addMetaData(md1);
- epr.addMetaData(md2);
- OMElement ext1 = omf.createOMElement("ext1", "http://exturi1", "ext1prefix");
- OMElement ext2 = omf.createOMElement("ext2", "http://exturi2", "ext2prefix");
- epr.addExtensibleElement(ext1);
- epr.addExtensibleElement(ext2);
- QName rp1Qname = new QName("http://rp1uri","refParm1","rp1prefix");
- QName rp2Qname = new QName("http://rp2uri","refParm2","rp2prefix");
- epr.addReferenceParameter(rp1Qname,"rp1");
- epr.addReferenceParameter(rp2Qname,"rp2");
-
- ArrayList addressAttributes = new ArrayList();
- addressAttributes.add(attr1);
- addressAttributes.add(attr2);
- epr.setAddressAttributes(addressAttributes);
-
- ArrayList metadataAttributes = new ArrayList();
- metadataAttributes.add(attr1);
- metadataAttributes.add(attr2);
- epr.setMetadataAttributes(metadataAttributes);
-
- OMElement om = EndpointReferenceHelper.toOM(omf, epr, new QName("http://nsurl","localName","prefix"), AddressingConstants.Final.WSA_NAMESPACE);
-
- //Test deserialize using fromOM(OMElement)
- EndpointReference deser = EndpointReferenceHelper.fromOM(om);
-
- assertEquals(epr.getAddress(),deser.getAddress());
- ArrayList addrAttrs = deser.getAddressAttributes();
- assertEquals(attr1,addrAttrs.get(0));
- assertEquals(attr2,addrAttrs.get(1));
-
- ArrayList attrs = deser.getAttributes();
- assertEquals(attr1,attrs.get(0));
- assertEquals(attr2,attrs.get(1));
-
- ArrayList metadata = deser.getMetaData();
- assertEquals(md1, metadata.get(0));
- assertEquals(md2, metadata.get(1));
- ArrayList mdAttrs = deser.getMetadataAttributes();
- assertEquals(attr1,mdAttrs.get(0));
- assertEquals(attr2,mdAttrs.get(1));
-
- ArrayList extelts = deser.getExtensibleElements();
- assertEquals(ext1,extelts.get(0));
- assertEquals(ext2,extelts.get(1));
-
- Map m = deser.getAllReferenceParameters();
- assertEquals("rp1", ((OMElement)m.get(rp1Qname)).getText());
- assertEquals("rp2", ((OMElement)m.get(rp2Qname)).getText());
-
- //Test deserialize using fromOM(EndpointReference, OMElement, String)
- deser = new EndpointReference("");
- EndpointReferenceHelper.fromOM(deser, om, AddressingConstants.Final.WSA_NAMESPACE);
-
- assertEquals(epr.getAddress(),deser.getAddress());
- addrAttrs = deser.getAddressAttributes();
- assertEquals(attr1,addrAttrs.get(0));
- assertEquals(attr2,addrAttrs.get(1));
-
- attrs = deser.getAttributes();
- assertEquals(attr1,attrs.get(0));
- assertEquals(attr2,attrs.get(1));
-
- metadata = deser.getMetaData();
- assertEquals(md1, metadata.get(0));
- assertEquals(md2, metadata.get(1));
- mdAttrs = deser.getMetadataAttributes();
- assertEquals(attr1,mdAttrs.get(0));
- assertEquals(attr2,mdAttrs.get(1));
-
- extelts = deser.getExtensibleElements();
- assertEquals(ext1,extelts.get(0));
- assertEquals(ext2,extelts.get(1));
-
- m = deser.getAllReferenceParameters();
- assertEquals("rp1", ((OMElement)m.get(rp1Qname)).getText());
- assertEquals("rp2", ((OMElement)m.get(rp2Qname)).getText());
-
- //Failure test
- try {
- deser = new EndpointReference("");
- EndpointReferenceHelper.fromOM(deser, om, AddressingConstants.Submission.WSA_NAMESPACE);
- fail("An exception should have been thrown due to failure to locate a wsa:Address field.");
- }
- catch (Exception e) {
- //pass
- }
- }
-
- public void testToAndFromOMForSubmissionSpecEPR() throws Exception{
- String address = "http://ws.apache.org/axis2";
- EndpointReference epr = new EndpointReference(address);
-
- OMFactory omf = OMAbstractFactory.getOMFactory();
- OMNamespace ns1 = omf.createOMNamespace("http://uri1","prefix1");
- OMAttribute attr1 = omf.createOMAttribute("attr1",ns1,"attr1value");
- OMNamespace ns2 = omf.createOMNamespace("http://uri2","prefix2");
- OMAttribute attr2 = omf.createOMAttribute("attr2",ns2,"attr2value");
- epr.addAttribute(attr1);
- epr.addAttribute(attr2);
- OMElement md1 = omf.createOMElement("md1", "http://mduri1", "md1prefix");
- OMElement md2 = omf.createOMElement("md2", "http://mduri2", "md2prefix");
- epr.addMetaData(md1);
- epr.addMetaData(md2);
- OMElement ext1 = omf.createOMElement("ext1", "http://exturi1", "ext1prefix");
- OMElement ext2 = omf.createOMElement("ext2", "http://exturi2", "ext2prefix");
- epr.addExtensibleElement(ext1);
- epr.addExtensibleElement(ext2);
- QName rp1Qname = new QName("http://rp1uri","refParm1","rp1prefix");
- QName rp2Qname = new QName("http://rp2uri","refParm2","rp2prefix");
- epr.addReferenceParameter(rp1Qname,"rp1");
- epr.addReferenceParameter(rp2Qname,"rp2");
-
- ArrayList addressAttributes = new ArrayList();
- addressAttributes.add(attr1);
- addressAttributes.add(attr2);
- epr.setAddressAttributes(addressAttributes);
-
- OMElement om = EndpointReferenceHelper.toOM(omf, epr, new QName("http://nsurl","localName","prefix"), AddressingConstants.Submission.WSA_NAMESPACE);
-
- //Add some reference properties.
- QName p1Qname = new QName("http://p1uri","refProp1","p1prefix");
- QName p2Qname = new QName("http://p2uri","refProp2","p2prefix");
- QName qname = new QName(AddressingConstants.Submission.WSA_NAMESPACE, "ReferenceProperties", AddressingConstants.WSA_DEFAULT_PREFIX);
- OMElement referenceProperties = omf.createOMElement(qname, om);
- OMElement prop1 = omf.createOMElement(p1Qname, referenceProperties);
- OMElement prop2 = omf.createOMElement(p2Qname, referenceProperties);
- prop1.setText("p1");
- prop2.setText("p2");
-
- //Test deserialize using fromOM(OMElement)
- EndpointReference deser = EndpointReferenceHelper.fromOM(om);
-
- assertEquals(epr.getAddress(),deser.getAddress());
- ArrayList addrAttrs = deser.getAddressAttributes();
- assertEquals(attr1,addrAttrs.get(0));
- assertEquals(attr2,addrAttrs.get(1));
-
- ArrayList attrs = deser.getAttributes();
- assertEquals(attr1,attrs.get(0));
- assertEquals(attr2,attrs.get(1));
-
- //Metadata will be lost unless it is saved as an extensibility element.
- ArrayList metadata = deser.getMetaData();
- assertNull(metadata);
-
- ArrayList extelts = deser.getExtensibleElements();
- assertEquals(ext1,extelts.get(0));
- assertEquals(ext2,extelts.get(1));
-
- //All reference properties are returned as reference parameters.
- Map m = deser.getAllReferenceParameters();
- assertEquals(4, m.size());
- assertEquals("rp1", ((OMElement)m.get(rp1Qname)).getText());
- assertEquals("rp2", ((OMElement)m.get(rp2Qname)).getText());
- assertEquals("p1", ((OMElement)m.get(p1Qname)).getText());
- assertEquals("p2", ((OMElement)m.get(p2Qname)).getText());
-
- //Test deserialize using fromOM(EndpointReference, OMElement, String)
- deser = new EndpointReference("");
- EndpointReferenceHelper.fromOM(deser, om, AddressingConstants.Submission.WSA_NAMESPACE);
-
- assertEquals(epr.getAddress(),deser.getAddress());
- addrAttrs = deser.getAddressAttributes();
- assertEquals(attr1,addrAttrs.get(0));
- assertEquals(attr2,addrAttrs.get(1));
-
- attrs = deser.getAttributes();
- assertEquals(attr1,attrs.get(0));
- assertEquals(attr2,attrs.get(1));
-
- //Metadata will be lost unless it is saved as an extensibility element.
- metadata = deser.getMetaData();
- assertNull(metadata);
-
- extelts = deser.getExtensibleElements();
- assertEquals(ext1,extelts.get(0));
- assertEquals(ext2,extelts.get(1));
-
- //All reference properties are returned as reference parameters.
- m = deser.getAllReferenceParameters();
- assertEquals(4, m.size());
- assertEquals("rp1", ((OMElement)m.get(rp1Qname)).getText());
- assertEquals("rp2", ((OMElement)m.get(rp2Qname)).getText());
- assertEquals("p1", ((OMElement)m.get(p1Qname)).getText());
- assertEquals("p2", ((OMElement)m.get(p2Qname)).getText());
-
- //Failure test
- try {
- deser = new EndpointReference("");
- EndpointReferenceHelper.fromOM(deser, om, AddressingConstants.Final.WSA_NAMESPACE);
- fail("An exception should have been thrown due to failure to locate a wsa:Address field.");
- }
- catch (Exception e) {
- //pass
- }
- }
-}
+/*
+* Copyright 2006 The Apache Software Foundation.
+*
+* Licensed 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.axis2.addressing;
+
+import java.util.ArrayList;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+
+import junit.framework.TestCase;
+
+public class EndpointReferenceHelperTest extends TestCase {
+
+ public void testToAndFromOMForFinalSpecEPR() throws Exception{
+ String address = "http://ws.apache.org/axis2";
+ EndpointReference epr = new EndpointReference(address);
+
+ OMFactory omf = OMAbstractFactory.getOMFactory();
+ OMNamespace ns1 = omf.createOMNamespace("http://uri1","prefix1");
+ OMAttribute attr1 = omf.createOMAttribute("attr1",ns1,"attr1value");
+ OMNamespace ns2 = omf.createOMNamespace("http://uri2","prefix2");
+ OMAttribute attr2 = omf.createOMAttribute("attr2",ns2,"attr2value");
+ epr.addAttribute(attr1);
+ epr.addAttribute(attr2);
+ OMElement md1 = omf.createOMElement("md1", "http://mduri1", "md1prefix");
+ OMElement md2 = omf.createOMElement("md2", "http://mduri2", "md2prefix");
+ epr.addMetaData(md1);
+ epr.addMetaData(md2);
+ OMElement ext1 = omf.createOMElement("ext1", "http://exturi1", "ext1prefix");
+ OMElement ext2 = omf.createOMElement("ext2", "http://exturi2", "ext2prefix");
+ epr.addExtensibleElement(ext1);
+ epr.addExtensibleElement(ext2);
+ QName rp1Qname = new QName("http://rp1uri","refParm1","rp1prefix");
+ QName rp2Qname = new QName("http://rp2uri","refParm2","rp2prefix");
+ epr.addReferenceParameter(rp1Qname,"rp1");
+ epr.addReferenceParameter(rp2Qname,"rp2");
+
+ ArrayList addressAttributes = new ArrayList();
+ addressAttributes.add(attr1);
+ addressAttributes.add(attr2);
+ epr.setAddressAttributes(addressAttributes);
+
+ ArrayList metadataAttributes = new ArrayList();
+ metadataAttributes.add(attr1);
+ metadataAttributes.add(attr2);
+ epr.setMetadataAttributes(metadataAttributes);
+
+ OMElement om = EndpointReferenceHelper.toOM(omf, epr, new QName("http://nsurl","localName","prefix"), AddressingConstants.Final.WSA_NAMESPACE);
+
+ //Test deserialize using fromOM(OMElement)
+ EndpointReference deser = EndpointReferenceHelper.fromOM(om);
+
+ assertEquals(epr.getAddress(),deser.getAddress());
+ ArrayList addrAttrs = deser.getAddressAttributes();
+ assertEquals(attr1,addrAttrs.get(0));
+ assertEquals(attr2,addrAttrs.get(1));
+
+ ArrayList attrs = deser.getAttributes();
+ assertEquals(attr1,attrs.get(0));
+ assertEquals(attr2,attrs.get(1));
+
+ ArrayList metadata = deser.getMetaData();
+ assertEquals(md1, metadata.get(0));
+ assertEquals(md2, metadata.get(1));
+ ArrayList mdAttrs = deser.getMetadataAttributes();
+ assertEquals(attr1,mdAttrs.get(0));
+ assertEquals(attr2,mdAttrs.get(1));
+
+ ArrayList extelts = deser.getExtensibleElements();
+ assertEquals(ext1,extelts.get(0));
+ assertEquals(ext2,extelts.get(1));
+
+ Map m = deser.getAllReferenceParameters();
+ assertEquals("rp1", ((OMElement)m.get(rp1Qname)).getText());
+ assertEquals("rp2", ((OMElement)m.get(rp2Qname)).getText());
+
+ //Test deserialize using fromOM(EndpointReference, OMElement, String)
+ deser = new EndpointReference("");
+ EndpointReferenceHelper.fromOM(deser, om, AddressingConstants.Final.WSA_NAMESPACE);
+
+ assertEquals(epr.getAddress(),deser.getAddress());
+ addrAttrs = deser.getAddressAttributes();
+ assertEquals(attr1,addrAttrs.get(0));
+ assertEquals(attr2,addrAttrs.get(1));
+
+ attrs = deser.getAttributes();
+ assertEquals(attr1,attrs.get(0));
+ assertEquals(attr2,attrs.get(1));
+
+ metadata = deser.getMetaData();
+ assertEquals(md1, metadata.get(0));
+ assertEquals(md2, metadata.get(1));
+ mdAttrs = deser.getMetadataAttributes();
+ assertEquals(attr1,mdAttrs.get(0));
+ assertEquals(attr2,mdAttrs.get(1));
+
+ extelts = deser.getExtensibleElements();
+ assertEquals(ext1,extelts.get(0));
+ assertEquals(ext2,extelts.get(1));
+
+ m = deser.getAllReferenceParameters();
+ assertEquals("rp1", ((OMElement)m.get(rp1Qname)).getText());
+ assertEquals("rp2", ((OMElement)m.get(rp2Qname)).getText());
+
+ //Failure test
+ try {
+ deser = new EndpointReference("");
+ EndpointReferenceHelper.fromOM(deser, om, AddressingConstants.Submission.WSA_NAMESPACE);
+ fail("An exception should have been thrown due to failure to locate a wsa:Address field.");
+ }
+ catch (Exception e) {
+ //pass
+ }
+ }
+
+ public void testToAndFromOMForSubmissionSpecEPR() throws Exception{
+ String address = "http://ws.apache.org/axis2";
+ EndpointReference epr = new EndpointReference(address);
+
+ OMFactory omf = OMAbstractFactory.getOMFactory();
+ OMNamespace ns1 = omf.createOMNamespace("http://uri1","prefix1");
+ OMAttribute attr1 = omf.createOMAttribute("attr1",ns1,"attr1value");
+ OMNamespace ns2 = omf.createOMNamespace("http://uri2","prefix2");
+ OMAttribute attr2 = omf.createOMAttribute("attr2",ns2,"attr2value");
+ epr.addAttribute(attr1);
+ epr.addAttribute(attr2);
+ OMElement md1 = omf.createOMElement("md1", "http://mduri1", "md1prefix");
+ OMElement md2 = omf.createOMElement("md2", "http://mduri2", "md2prefix");
+ epr.addMetaData(md1);
+ epr.addMetaData(md2);
+ OMElement ext1 = omf.createOMElement("ext1", "http://exturi1", "ext1prefix");
+ OMElement ext2 = omf.createOMElement("ext2", "http://exturi2", "ext2prefix");
+ epr.addExtensibleElement(ext1);
+ epr.addExtensibleElement(ext2);
+ QName rp1Qname = new QName("http://rp1uri","refParm1","rp1prefix");
+ QName rp2Qname = new QName("http://rp2uri","refParm2","rp2prefix");
+ epr.addReferenceParameter(rp1Qname,"rp1");
+ epr.addReferenceParameter(rp2Qname,"rp2");
+
+ ArrayList addressAttributes = new ArrayList();
+ addressAttributes.add(attr1);
+ addressAttributes.add(attr2);
+ epr.setAddressAttributes(addressAttributes);
+
+ OMElement om = EndpointReferenceHelper.toOM(omf, epr, new QName("http://nsurl","localName","prefix"), AddressingConstants.Submission.WSA_NAMESPACE);
+
+ //Add some reference properties.
+ QName p1Qname = new QName("http://p1uri","refProp1","p1prefix");
+ QName p2Qname = new QName("http://p2uri","refProp2","p2prefix");
+ QName qname = new QName(AddressingConstants.Submission.WSA_NAMESPACE, "ReferenceProperties", AddressingConstants.WSA_DEFAULT_PREFIX);
+ OMElement referenceProperties = omf.createOMElement(qname, om);
+ OMElement prop1 = omf.createOMElement(p1Qname, referenceProperties);
+ OMElement prop2 = omf.createOMElement(p2Qname, referenceProperties);
+ prop1.setText("p1");
+ prop2.setText("p2");
+
+ //Test deserialize using fromOM(OMElement)
+ EndpointReference deser = EndpointReferenceHelper.fromOM(om);
+
+ assertEquals(epr.getAddress(),deser.getAddress());
+ ArrayList addrAttrs = deser.getAddressAttributes();
+ assertEquals(attr1,addrAttrs.get(0));
+ assertEquals(attr2,addrAttrs.get(1));
+
+ ArrayList attrs = deser.getAttributes();
+ assertEquals(attr1,attrs.get(0));
+ assertEquals(attr2,attrs.get(1));
+
+ //Metadata will be lost unless it is saved as an extensibility element.
+ ArrayList metadata = deser.getMetaData();
+ assertNull(metadata);
+
+ ArrayList extelts = deser.getExtensibleElements();
+ assertEquals(ext1,extelts.get(0));
+ assertEquals(ext2,extelts.get(1));
+
+ //All reference properties are returned as reference parameters.
+ Map m = deser.getAllReferenceParameters();
+ assertEquals(4, m.size());
+ assertEquals("rp1", ((OMElement)m.get(rp1Qname)).getText());
+ assertEquals("rp2", ((OMElement)m.get(rp2Qname)).getText());
+ assertEquals("p1", ((OMElement)m.get(p1Qname)).getText());
+ assertEquals("p2", ((OMElement)m.get(p2Qname)).getText());
+
+ //Test deserialize using fromOM(EndpointReference, OMElement, String)
+ deser = new EndpointReference("");
+ EndpointReferenceHelper.fromOM(deser, om, AddressingConstants.Submission.WSA_NAMESPACE);
+
+ assertEquals(epr.getAddress(),deser.getAddress());
+ addrAttrs = deser.getAddressAttributes();
+ assertEquals(attr1,addrAttrs.get(0));
+ assertEquals(attr2,addrAttrs.get(1));
+
+ attrs = deser.getAttributes();
+ assertEquals(attr1,attrs.get(0));
+ assertEquals(attr2,attrs.get(1));
+
+ //Metadata will be lost unless it is saved as an extensibility element.
+ metadata = deser.getMetaData();
+ assertNull(metadata);
+
+ extelts = deser.getExtensibleElements();
+ assertEquals(ext1,extelts.get(0));
+ assertEquals(ext2,extelts.get(1));
+
+ //All reference properties are returned as reference parameters.
+ m = deser.getAllReferenceParameters();
+ assertEquals(4, m.size());
+ assertEquals("rp1", ((OMElement)m.get(rp1Qname)).getText());
+ assertEquals("rp2", ((OMElement)m.get(rp2Qname)).getText());
+ assertEquals("p1", ((OMElement)m.get(p1Qname)).getText());
+ assertEquals("p2", ((OMElement)m.get(p2Qname)).getText());
+
+ //Failure test
+ try {
+ deser = new EndpointReference("");
+ EndpointReferenceHelper.fromOM(deser, om, AddressingConstants.Final.WSA_NAMESPACE);
+ fail("An exception should have been thrown due to failure to locate a wsa:Address field.");
+ }
+ catch (Exception e) {
+ //pass
+ }
+ }
+}
Propchange: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/addressing/EndpointReferenceHelperTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/addressing/wsdl/WSDL11ActionHelperTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/addressing/wsdl/WSDL11ActionHelperTest.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/addressing/wsdl/WSDL11ActionHelperTest.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/addressing/wsdl/WSDL11ActionHelperTest.java Sun Feb 25 11:56:59 2007
@@ -34,103 +34,103 @@
public class WSDL11ActionHelperTest extends TestCase {
- String testWSDLFile = "/target/test-resources/wsdl/actionTests.wsdl";
-
- Definition definition;
-
- protected void setUp() throws Exception {
- super.setUp();
- WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
+ String testWSDLFile = "/target/test-resources/wsdl/actionTests.wsdl";
+
+ Definition definition;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
reader.setFeature("javax.wsdl.importDocuments", false);
reader.setFeature("javax.wsdl.verbose", false);
URL wsdlFile = new File(System.getProperty("basedir")+testWSDLFile).toURL();//getClass().getClassLoader().getResource(testWSDLFile);
definition = reader.readWSDL(wsdlFile.toString());
- }
+ }
- // Test DefaultActionPattern (no names in WSDL)
- // Test not required for Fault as Fault elements MUST have naes per the WSDL 1.1 spec
- // portType=withoutWSAWActionNoName
- // operation=echo
- public void testGenerateInputActionNoNames(){
- String expectedAction = "http://ws.apache.org/axis2/actiontest/withoutWSAWActionNoName/echoRequest";
- PortType pt = definition.getPortType(new QName("http://ws.apache.org/axis2/actiontest/","withoutWSAWActionNoName"));
- List operations = pt.getOperations();
- Operation op = (Operation)operations.get(0);
- Input in = op.getInput();
- String actualAction = WSDL11ActionHelper.getActionFromInputElement(definition,pt,op,in);
- assertEquals(expectedAction, actualAction);
- }
- public void testGenerateOutputActionNoNames(){
- String expectedAction = "http://ws.apache.org/axis2/actiontest/withoutWSAWActionNoName/echoResponse";
- PortType pt = definition.getPortType(new QName("http://ws.apache.org/axis2/actiontest/","withoutWSAWActionNoName"));
- List operations = pt.getOperations();
- Operation op = (Operation)operations.get(0);
- Output out = op.getOutput();
- String actualAction = WSDL11ActionHelper.getActionFromOutputElement(definition,pt,op,out);
- assertEquals(expectedAction, actualAction);
- }
-
- // Test DefaultActionPattern (names explicitly set in WSDL)
- // portType=withoutWSAWAction
- // operation=echo
- public void testGenerateInputAction(){
- String expectedAction = "http://ws.apache.org/axis2/actiontest/withoutWSAWAction/NamedInput";
- PortType pt = definition.getPortType(new QName("http://ws.apache.org/axis2/actiontest/","withoutWSAWAction"));
- List operations = pt.getOperations();
- Operation op = (Operation)operations.get(0);
- Input in = op.getInput();
- String actualAction = WSDL11ActionHelper.getActionFromInputElement(definition,pt,op,in);
- assertEquals(expectedAction, actualAction);
- }
- public void testGenerateOutputAction(){
- String expectedAction = "http://ws.apache.org/axis2/actiontest/withoutWSAWAction/NamedOutput";
- PortType pt = definition.getPortType(new QName("http://ws.apache.org/axis2/actiontest/","withoutWSAWAction"));
- List operations = pt.getOperations();
- Operation op = (Operation)operations.get(0);
- Output out = op.getOutput();
- String actualAction = WSDL11ActionHelper.getActionFromOutputElement(definition,pt,op,out);
- assertEquals(expectedAction, actualAction);
- }
- public void testGenerateFaultAction(){
- String expectedAction = "http://ws.apache.org/axis2/actiontest/withoutWSAWAction/echo/Fault/echoFault";
- PortType pt = definition.getPortType(new QName("http://ws.apache.org/axis2/actiontest/","withoutWSAWAction"));
- List operations = pt.getOperations();
- Operation op = (Operation)operations.get(0);
- Fault fault = op.getFault("echoFault");
- String actualAction = WSDL11ActionHelper.getActionFromFaultElement(definition,pt,op,fault);
- assertEquals(expectedAction, actualAction);
- }
-
- // Test reading wsaw:Action values
- // portType=withWSAWAction
- // operation=echo
- public void testGetWSAWInputAction(){
- String expectedAction = "http://example.org/action/echoIn";
- PortType pt = definition.getPortType(new QName("http://ws.apache.org/axis2/actiontest/","withWSAWAction"));
- List operations = pt.getOperations();
- Operation op = (Operation)operations.get(0);
- Input in = op.getInput();
- String actualAction = WSDL11ActionHelper.getActionFromInputElement(definition,pt,op,in);
- assertEquals(expectedAction, actualAction);
- }
- public void testGetWSAWOutputAction(){
- String expectedAction = "http://example.org/action/echoOut";
- PortType pt = definition.getPortType(new QName("http://ws.apache.org/axis2/actiontest/","withWSAWAction"));
- List operations = pt.getOperations();
- Operation op = (Operation)operations.get(0);
- Output out = op.getOutput();
- String actualAction = WSDL11ActionHelper.getActionFromOutputElement(definition,pt,op,out);
- assertEquals(expectedAction, actualAction);
- }
- public void testGetWSAWFaultAction(){
- String expectedAction = "http://example.org/action/echoFault";
- PortType pt = definition.getPortType(new QName("http://ws.apache.org/axis2/actiontest/","withWSAWAction"));
- List operations = pt.getOperations();
- Operation op = (Operation)operations.get(0);
- Fault fault = op.getFault("echoFault");
- String actualAction = WSDL11ActionHelper.getActionFromFaultElement(definition,pt,op,fault);
- assertEquals(expectedAction, actualAction);
- }
+ // Test DefaultActionPattern (no names in WSDL)
+ // Test not required for Fault as Fault elements MUST have naes per the WSDL 1.1 spec
+ // portType=withoutWSAWActionNoName
+ // operation=echo
+ public void testGenerateInputActionNoNames(){
+ String expectedAction = "http://ws.apache.org/axis2/actiontest/withoutWSAWActionNoName/echoRequest";
+ PortType pt = definition.getPortType(new QName("http://ws.apache.org/axis2/actiontest/","withoutWSAWActionNoName"));
+ List operations = pt.getOperations();
+ Operation op = (Operation)operations.get(0);
+ Input in = op.getInput();
+ String actualAction = WSDL11ActionHelper.getActionFromInputElement(definition,pt,op,in);
+ assertEquals(expectedAction, actualAction);
+ }
+ public void testGenerateOutputActionNoNames(){
+ String expectedAction = "http://ws.apache.org/axis2/actiontest/withoutWSAWActionNoName/echoResponse";
+ PortType pt = definition.getPortType(new QName("http://ws.apache.org/axis2/actiontest/","withoutWSAWActionNoName"));
+ List operations = pt.getOperations();
+ Operation op = (Operation)operations.get(0);
+ Output out = op.getOutput();
+ String actualAction = WSDL11ActionHelper.getActionFromOutputElement(definition,pt,op,out);
+ assertEquals(expectedAction, actualAction);
+ }
+
+ // Test DefaultActionPattern (names explicitly set in WSDL)
+ // portType=withoutWSAWAction
+ // operation=echo
+ public void testGenerateInputAction(){
+ String expectedAction = "http://ws.apache.org/axis2/actiontest/withoutWSAWAction/NamedInput";
+ PortType pt = definition.getPortType(new QName("http://ws.apache.org/axis2/actiontest/","withoutWSAWAction"));
+ List operations = pt.getOperations();
+ Operation op = (Operation)operations.get(0);
+ Input in = op.getInput();
+ String actualAction = WSDL11ActionHelper.getActionFromInputElement(definition,pt,op,in);
+ assertEquals(expectedAction, actualAction);
+ }
+ public void testGenerateOutputAction(){
+ String expectedAction = "http://ws.apache.org/axis2/actiontest/withoutWSAWAction/NamedOutput";
+ PortType pt = definition.getPortType(new QName("http://ws.apache.org/axis2/actiontest/","withoutWSAWAction"));
+ List operations = pt.getOperations();
+ Operation op = (Operation)operations.get(0);
+ Output out = op.getOutput();
+ String actualAction = WSDL11ActionHelper.getActionFromOutputElement(definition,pt,op,out);
+ assertEquals(expectedAction, actualAction);
+ }
+ public void testGenerateFaultAction(){
+ String expectedAction = "http://ws.apache.org/axis2/actiontest/withoutWSAWAction/echo/Fault/echoFault";
+ PortType pt = definition.getPortType(new QName("http://ws.apache.org/axis2/actiontest/","withoutWSAWAction"));
+ List operations = pt.getOperations();
+ Operation op = (Operation)operations.get(0);
+ Fault fault = op.getFault("echoFault");
+ String actualAction = WSDL11ActionHelper.getActionFromFaultElement(definition,pt,op,fault);
+ assertEquals(expectedAction, actualAction);
+ }
+
+ // Test reading wsaw:Action values
+ // portType=withWSAWAction
+ // operation=echo
+ public void testGetWSAWInputAction(){
+ String expectedAction = "http://example.org/action/echoIn";
+ PortType pt = definition.getPortType(new QName("http://ws.apache.org/axis2/actiontest/","withWSAWAction"));
+ List operations = pt.getOperations();
+ Operation op = (Operation)operations.get(0);
+ Input in = op.getInput();
+ String actualAction = WSDL11ActionHelper.getActionFromInputElement(definition,pt,op,in);
+ assertEquals(expectedAction, actualAction);
+ }
+ public void testGetWSAWOutputAction(){
+ String expectedAction = "http://example.org/action/echoOut";
+ PortType pt = definition.getPortType(new QName("http://ws.apache.org/axis2/actiontest/","withWSAWAction"));
+ List operations = pt.getOperations();
+ Operation op = (Operation)operations.get(0);
+ Output out = op.getOutput();
+ String actualAction = WSDL11ActionHelper.getActionFromOutputElement(definition,pt,op,out);
+ assertEquals(expectedAction, actualAction);
+ }
+ public void testGetWSAWFaultAction(){
+ String expectedAction = "http://example.org/action/echoFault";
+ PortType pt = definition.getPortType(new QName("http://ws.apache.org/axis2/actiontest/","withWSAWAction"));
+ List operations = pt.getOperations();
+ Operation op = (Operation)operations.get(0);
+ Fault fault = op.getFault("echoFault");
+ String actualAction = WSDL11ActionHelper.getActionFromFaultElement(definition,pt,op,fault);
+ assertEquals(expectedAction, actualAction);
+ }
}
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/BuilderSelectorDeploymentTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/BuilderSelectorDeploymentTest.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/BuilderSelectorDeploymentTest.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/BuilderSelectorDeploymentTest.java Sun Feb 25 11:56:59 2007
@@ -56,10 +56,10 @@
FileSystemConfigurator fsc = new FileSystemConfigurator(repo.getAbsolutePath(), xml.getAbsolutePath());
AxisFault testFault=null;
try {
- fsc.getAxisConfiguration();
- } catch (AxisFault e) {
- testFault = e;
- }
- assertNotNull(testFault);
+ fsc.getAxisConfiguration();
+ } catch (AxisFault e) {
+ testFault = e;
+ }
+ assertNotNull(testFault);
}
}
Propchange: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/BuilderSelectorDeploymentTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/MessageFormatterDeploymentTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/MessageFormatterDeploymentTest.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/MessageFormatterDeploymentTest.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/MessageFormatterDeploymentTest.java Sun Feb 25 11:56:59 2007
@@ -54,10 +54,10 @@
FileSystemConfigurator fsc = new FileSystemConfigurator(repo.getAbsolutePath(), xml.getAbsolutePath());
AxisFault testFault=null;
try {
- fsc.getAxisConfiguration();
- } catch (AxisFault e) {
- testFault = e;
- }
- assertNotNull(testFault);
+ fsc.getAxisConfiguration();
+ } catch (AxisFault e) {
+ testFault = e;
+ }
+ assertNotNull(testFault);
}
}
Propchange: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/MessageFormatterDeploymentTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/OperationExcludeTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/OperationExcludeTest.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/OperationExcludeTest.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/OperationExcludeTest.java Sun Feb 25 11:56:59 2007
@@ -34,7 +34,7 @@
DeploymentException,
AxisFault,
XMLStreamException {
- String filename = System.getProperty("basedir")+"/test-resources/deployment/exculeRepo";
+ String filename = System.getProperty("basedir") + "/test-resources/deployment/exculeRepo";
er = ConfigurationContextFactory.createConfigurationContextFromFileSystem(filename, null)
.getAxisConfiguration();
AxisService service = er.getService("excludeService");
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/SystemPhasesremovedTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/SystemPhasesremovedTest.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/SystemPhasesremovedTest.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/SystemPhasesremovedTest.java Sun Feb 25 11:56:59 2007
@@ -26,7 +26,7 @@
public class SystemPhasesremovedTest extends TestCase {
AxisConfiguration er;
- private static final Log log = LogFactory.getLog(SystemPhasesremovedTest.class);
+ private static final Log log = LogFactory.getLog(SystemPhasesremovedTest.class);
public void testPhaseOrderchage() {
try {
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/description/RegistryTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/description/RegistryTest.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/description/RegistryTest.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/description/RegistryTest.java Sun Feb 25 11:56:59 2007
@@ -82,7 +82,7 @@
public void testHandlers() throws AxisFault {
Handler handler = new AbstractHandler() {
- public InvocationResponse invoke(MessageContext msgContext) {
+ public InvocationResponse invoke(MessageContext msgContext) {
return InvocationResponse.CONTINUE;
}
};
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/description/SpeakingProvider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/description/SpeakingProvider.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/description/SpeakingProvider.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/description/SpeakingProvider.java Sun Feb 25 11:56:59 2007
@@ -23,7 +23,7 @@
import org.apache.commons.logging.LogFactory;
public class SpeakingProvider implements MessageReceiver {
- private static final Log log = LogFactory.getLog(SpeakingProvider.class);
+ private static final Log log = LogFactory.getLog(SpeakingProvider.class);
public SpeakingProvider() {
}
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/dispatchers/ActionBasedOperationDispatchTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/dispatchers/ActionBasedOperationDispatchTest.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/dispatchers/ActionBasedOperationDispatchTest.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/dispatchers/ActionBasedOperationDispatchTest.java Sun Feb 25 11:56:59 2007
@@ -1,57 +1,57 @@
-/*
-* Licensed 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.axis2.dispatchers;
-
-import java.util.ArrayList;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.InOnlyAxisOperation;
-
-import junit.framework.TestCase;
-
-public class ActionBasedOperationDispatchTest extends TestCase {
-
- public void testFindOperation() throws Exception{
- MessageContext messageContext = new MessageContext();
- AxisService as = new AxisService("Service1");
- messageContext.setAxisService(as);
-
- AxisOperation operation1 = new InOnlyAxisOperation(new QName("operation1"));
- ArrayList op1actions = new ArrayList();
- op1actions.add("urn:org.apache.axis2.dispatchers.test:operation1");
- operation1.setWsamappingList(op1actions);
-
- AxisOperation operation2 = new InOnlyAxisOperation(new QName("operation2"));
- ArrayList op2actions = new ArrayList();
- op2actions.add("urn:org.apache.axis2.dispatchers.test:operation2");
- operation2.setWsamappingList(op2actions);
-
- as.addOperation(operation1);
- as.addOperation(operation2);
-
- as.mapActionToOperation("urn:org.apache.axis2.dispatchers.test:operation1", operation1);
- as.mapActionToOperation("urn:org.apache.axis2.dispatchers.test:operation2", operation2);
-
- messageContext.setWSAAction("urn:org.apache.axis2.dispatchers.test:operation2");
-
- ActionBasedOperationDispatcher abod = new ActionBasedOperationDispatcher();
- abod.invoke(messageContext);
- assertEquals(operation2, messageContext.getAxisOperation());
- }
-
-}
+/*
+* Licensed 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.axis2.dispatchers;
+
+import java.util.ArrayList;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.InOnlyAxisOperation;
+
+import junit.framework.TestCase;
+
+public class ActionBasedOperationDispatchTest extends TestCase {
+
+ public void testFindOperation() throws Exception{
+ MessageContext messageContext = new MessageContext();
+ AxisService as = new AxisService("Service1");
+ messageContext.setAxisService(as);
+
+ AxisOperation operation1 = new InOnlyAxisOperation(new QName("operation1"));
+ ArrayList op1actions = new ArrayList();
+ op1actions.add("urn:org.apache.axis2.dispatchers.test:operation1");
+ operation1.setWsamappingList(op1actions);
+
+ AxisOperation operation2 = new InOnlyAxisOperation(new QName("operation2"));
+ ArrayList op2actions = new ArrayList();
+ op2actions.add("urn:org.apache.axis2.dispatchers.test:operation2");
+ operation2.setWsamappingList(op2actions);
+
+ as.addOperation(operation1);
+ as.addOperation(operation2);
+
+ as.mapActionToOperation("urn:org.apache.axis2.dispatchers.test:operation1", operation1);
+ as.mapActionToOperation("urn:org.apache.axis2.dispatchers.test:operation2", operation2);
+
+ messageContext.setWSAAction("urn:org.apache.axis2.dispatchers.test:operation2");
+
+ ActionBasedOperationDispatcher abod = new ActionBasedOperationDispatcher();
+ abod.invoke(messageContext);
+ assertEquals(operation2, messageContext.getAxisOperation());
+ }
+
+}
Propchange: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/dispatchers/ActionBasedOperationDispatchTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/dispatchers/RelatesToBasedOperationDispatcherTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/dispatchers/RelatesToBasedOperationDispatcherTest.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/dispatchers/RelatesToBasedOperationDispatcherTest.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/dispatchers/RelatesToBasedOperationDispatcherTest.java Sun Feb 25 11:56:59 2007
@@ -1,60 +1,60 @@
-/*
-* Licensed 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.axis2.dispatchers;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.RelatesTo;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.context.OperationContext;
-import org.apache.axis2.context.ContextFactory;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.InOnlyAxisOperation;
-import org.apache.axis2.engine.AxisConfiguration;
-
-public class RelatesToBasedOperationDispatcherTest extends TestCase {
-
- public void testFindOperation() throws AxisFault{
-
- MessageContext messageContext;
- AxisService as1 = new AxisService("Service1");
- AxisConfiguration ac = new AxisConfiguration();
- ac.addService(as1);
-
- AxisOperation operation1 = new InOnlyAxisOperation(new QName("operation1"));
- AxisOperation operation2 = new InOnlyAxisOperation(new QName("operation2"));
- as1.addOperation(operation1);
- as1.addOperation(operation2);
-
- ConfigurationContext cc = new ConfigurationContext(ac);
- OperationContext oc1 =ContextFactory.createOperationContext(operation1,null);
- OperationContext oc2 = ContextFactory.createOperationContext(operation2,null);
- cc.registerOperationContext("urn:org.apache.axis2.dispatchers.messageid:123", oc1);
- cc.registerOperationContext("urn:org.apache.axis2.dispatchers.messageid:456", oc2);
- messageContext = ContextFactory.createMessageContext(cc);
- messageContext.addRelatesTo(new RelatesTo("urn:org.apache.axis2.dispatchers.messageid:456"));
- messageContext.setAxisService(as1);
-
- RelatesToBasedOperationDispatcher ruisd = new RelatesToBasedOperationDispatcher();
- ruisd.invoke(messageContext);
-
- assertEquals(operation2, messageContext.getAxisOperation());
- }
-
-}
+/*
+* Licensed 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.axis2.dispatchers;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.RelatesTo;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.context.ContextFactory;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.InOnlyAxisOperation;
+import org.apache.axis2.engine.AxisConfiguration;
+
+public class RelatesToBasedOperationDispatcherTest extends TestCase {
+
+ public void testFindOperation() throws AxisFault{
+
+ MessageContext messageContext;
+ AxisService as1 = new AxisService("Service1");
+ AxisConfiguration ac = new AxisConfiguration();
+ ac.addService(as1);
+
+ AxisOperation operation1 = new InOnlyAxisOperation(new QName("operation1"));
+ AxisOperation operation2 = new InOnlyAxisOperation(new QName("operation2"));
+ as1.addOperation(operation1);
+ as1.addOperation(operation2);
+
+ ConfigurationContext cc = new ConfigurationContext(ac);
+ OperationContext oc1 =ContextFactory.createOperationContext(operation1,null);
+ OperationContext oc2 = ContextFactory.createOperationContext(operation2,null);
+ cc.registerOperationContext("urn:org.apache.axis2.dispatchers.messageid:123", oc1);
+ cc.registerOperationContext("urn:org.apache.axis2.dispatchers.messageid:456", oc2);
+ messageContext = ContextFactory.createMessageContext(cc);
+ messageContext.addRelatesTo(new RelatesTo("urn:org.apache.axis2.dispatchers.messageid:456"));
+ messageContext.setAxisService(as1);
+
+ RelatesToBasedOperationDispatcher ruisd = new RelatesToBasedOperationDispatcher();
+ ruisd.invoke(messageContext);
+
+ assertEquals(operation2, messageContext.getAxisOperation());
+ }
+
+}
Propchange: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/dispatchers/RelatesToBasedOperationDispatcherTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/dispatchers/RelatesToBasedServiceDispatcherTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/dispatchers/RelatesToBasedServiceDispatcherTest.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/dispatchers/RelatesToBasedServiceDispatcherTest.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/dispatchers/RelatesToBasedServiceDispatcherTest.java Sun Feb 25 11:56:59 2007
@@ -1,68 +1,68 @@
-/*
-* Licensed 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.axis2.dispatchers;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.RelatesTo;
-import org.apache.axis2.context.*;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.InOnlyAxisOperation;
-import org.apache.axis2.engine.AxisConfiguration;
-
-public class RelatesToBasedServiceDispatcherTest extends TestCase {
-
- public void testFindService() throws AxisFault{
-
- MessageContext messageContext;
-
- AxisConfiguration ac = new AxisConfiguration();
- ConfigurationContext cc = new ConfigurationContext(ac);
-
- AxisService as1 = new AxisService("Service1");
- ServiceContext sc1 = new ServiceContext(as1, ContextFactory.createServiceGroupContext(cc,null));
-
- AxisService as2 = new AxisService("Service2");
-
- ServiceContext sc2 = new ServiceContext(as2, ContextFactory.createServiceGroupContext(cc,null));
-
-
- ac.addService(as1);
- ac.addService(as2);
-
- AxisOperation operation1 = new InOnlyAxisOperation(new QName("operation1"));
- AxisOperation operation2 = new InOnlyAxisOperation(new QName("operation2"));
- as1.addOperation(operation1);
- as2.addOperation(operation2);
-
-
- OperationContext oc1 = ContextFactory.createOperationContext(operation1,sc1);
- OperationContext oc2 = ContextFactory.createOperationContext(operation2,sc2);
-
- cc.registerOperationContext("urn:org.apache.axis2.dispatchers.messageid:123", oc1);
- cc.registerOperationContext("urn:org.apache.axis2.dispatchers.messageid:456", oc2);
- messageContext = ContextFactory.createMessageContext(cc);
- messageContext.addRelatesTo(new RelatesTo("urn:org.apache.axis2.dispatchers.messageid:456"));
-
- RelatesToBasedServiceDispatcher ruisd = new RelatesToBasedServiceDispatcher();
- ruisd.invoke(messageContext);
-
- assertEquals(as2, messageContext.getAxisService());
- }
-
-}
+/*
+* Licensed 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.axis2.dispatchers;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.RelatesTo;
+import org.apache.axis2.context.*;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.InOnlyAxisOperation;
+import org.apache.axis2.engine.AxisConfiguration;
+
+public class RelatesToBasedServiceDispatcherTest extends TestCase {
+
+ public void testFindService() throws AxisFault{
+
+ MessageContext messageContext;
+
+ AxisConfiguration ac = new AxisConfiguration();
+ ConfigurationContext cc = new ConfigurationContext(ac);
+
+ AxisService as1 = new AxisService("Service1");
+ ServiceContext sc1 = new ServiceContext(as1, ContextFactory.createServiceGroupContext(cc,null));
+
+ AxisService as2 = new AxisService("Service2");
+
+ ServiceContext sc2 = new ServiceContext(as2, ContextFactory.createServiceGroupContext(cc,null));
+
+
+ ac.addService(as1);
+ ac.addService(as2);
+
+ AxisOperation operation1 = new InOnlyAxisOperation(new QName("operation1"));
+ AxisOperation operation2 = new InOnlyAxisOperation(new QName("operation2"));
+ as1.addOperation(operation1);
+ as2.addOperation(operation2);
+
+
+ OperationContext oc1 = ContextFactory.createOperationContext(operation1,sc1);
+ OperationContext oc2 = ContextFactory.createOperationContext(operation2,sc2);
+
+ cc.registerOperationContext("urn:org.apache.axis2.dispatchers.messageid:123", oc1);
+ cc.registerOperationContext("urn:org.apache.axis2.dispatchers.messageid:456", oc2);
+ messageContext = ContextFactory.createMessageContext(cc);
+ messageContext.addRelatesTo(new RelatesTo("urn:org.apache.axis2.dispatchers.messageid:456"));
+
+ RelatesToBasedServiceDispatcher ruisd = new RelatesToBasedServiceDispatcher();
+ ruisd.invoke(messageContext);
+
+ assertEquals(as2, messageContext.getAxisService());
+ }
+
+}
Propchange: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/dispatchers/RelatesToBasedServiceDispatcherTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/dispatchers/RequestURIBasedOperationDispatcherTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/dispatchers/RequestURIBasedOperationDispatcherTest.java?view=diff&rev=511585&r1=511584&r2=511585
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/dispatchers/RequestURIBasedOperationDispatcherTest.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/dispatchers/RequestURIBasedOperationDispatcherTest.java Sun Feb 25 11:56:59 2007
@@ -1,56 +1,56 @@
-/*
-* Licensed 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.axis2.dispatchers;
-
-import junit.framework.TestCase;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.ConfigurationContextFactory;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.context.ContextFactory;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.InOnlyAxisOperation;
-import org.apache.axis2.engine.AxisConfiguration;
-
-import javax.xml.namespace.QName;
-
-public class RequestURIBasedOperationDispatcherTest extends TestCase {
-
- public void testFindService() throws AxisFault {
- MessageContext messageContext;
- AxisService as1 = new AxisService("Service1");
-
-
- AxisOperation operation1 = new InOnlyAxisOperation(new QName("operation1"));
- AxisOperation operation2 = new InOnlyAxisOperation(new QName("operation2"));
- as1.addOperation(operation1);
- as1.addOperation(operation2);
-
- ConfigurationContext cc = ConfigurationContextFactory.createEmptyConfigurationContext();
- AxisConfiguration ac = cc.getAxisConfiguration();
- ac.addService(as1);
- messageContext = ContextFactory.createMessageContext(cc);
-
- messageContext.setTo(new EndpointReference("http://127.0.0.1:8080/axis2/services/Service1/operation2"));
- messageContext.setAxisService(as1);
-
- RequestURIBasedOperationDispatcher ruisd = new RequestURIBasedOperationDispatcher();
- ruisd.invoke(messageContext);
-
- assertEquals(operation2, messageContext.getAxisOperation());
- }
-
-}
+/*
+* Licensed 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.axis2.dispatchers;
+
+import junit.framework.TestCase;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.ContextFactory;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.InOnlyAxisOperation;
+import org.apache.axis2.engine.AxisConfiguration;
+
+import javax.xml.namespace.QName;
+
+public class RequestURIBasedOperationDispatcherTest extends TestCase {
+
+ public void testFindService() throws AxisFault {
+ MessageContext messageContext;
+ AxisService as1 = new AxisService("Service1");
+
+
+ AxisOperation operation1 = new InOnlyAxisOperation(new QName("operation1"));
+ AxisOperation operation2 = new InOnlyAxisOperation(new QName("operation2"));
+ as1.addOperation(operation1);
+ as1.addOperation(operation2);
+
+ ConfigurationContext cc = ConfigurationContextFactory.createEmptyConfigurationContext();
+ AxisConfiguration ac = cc.getAxisConfiguration();
+ ac.addService(as1);
+ messageContext = ContextFactory.createMessageContext(cc);
+
+ messageContext.setTo(new EndpointReference("http://127.0.0.1:8080/axis2/services/Service1/operation2"));
+ messageContext.setAxisService(as1);
+
+ RequestURIBasedOperationDispatcher ruisd = new RequestURIBasedOperationDispatcher();
+ ruisd.invoke(messageContext);
+
+ assertEquals(operation2, messageContext.getAxisOperation());
+ }
+
+}
Propchange: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/dispatchers/RequestURIBasedOperationDispatcherTest.java
------------------------------------------------------------------------------
svn:eol-style = native
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org