axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r545299 - /webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/description/AxisServiceTest.java
Date Thu, 07 Jun 2007 20:26:18 GMT
Author: dims
Date: Thu Jun  7 13:26:15 2007
New Revision: 545299

URL: http://svn.apache.org/viewvc?view=rev&rev=545299
Log:
test case from Jarek for AXIS2-2783 - Better checking for overloaded operations in AxisService
addMessageElementQNameToOperationMapping()

Added:
    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/description/AxisServiceTest.java

Added: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/description/AxisServiceTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/description/AxisServiceTest.java?view=auto&rev=545299
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/description/AxisServiceTest.java
(added)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/description/AxisServiceTest.java
Thu Jun  7 13:26:15 2007
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2004,2005 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.description;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+public class AxisServiceTest extends TestCase {
+
+    public void testAddMessageElementQNameToOperationMappingBasic() {
+        AxisService service = new AxisService();
+        
+        AxisOperation op1 = new InOnlyAxisOperation();
+        QName opName = new QName("foo");
+        
+        // test registering the same operation multiple times
+        
+        assertEquals(null, service.getOperationByMessageElementQName(opName));
+        
+        service.addMessageElementQNameToOperationMapping(opName, op1);
+        
+        assertEquals(op1, service.getOperationByMessageElementQName(opName));
+        
+        service.addMessageElementQNameToOperationMapping(opName, op1);
+        
+        assertEquals(op1, service.getOperationByMessageElementQName(opName));
+        
+        service.addMessageElementQNameToOperationMapping(opName, op1);
+        
+        assertEquals(op1, service.getOperationByMessageElementQName(opName));        
+    }
+    
+    public void testAddMessageElementQNameToOperationMappingOverloading() {
+        AxisService service = new AxisService();
+        
+        AxisOperation op1 = new InOnlyAxisOperation();
+        AxisOperation op2 = new InOnlyAxisOperation();
+        AxisOperation op3 = new InOnlyAxisOperation();
+        QName opName = new QName("foo");
+        
+        // test registering different operations under the same opName
+        
+        assertEquals(null, service.getOperationByMessageElementQName(opName));
+        
+        service.addMessageElementQNameToOperationMapping(opName, op1);
+        
+        assertEquals(op1, service.getOperationByMessageElementQName(opName));
+        
+        service.addMessageElementQNameToOperationMapping(opName, op2);
+        
+        assertEquals(null, service.getOperationByMessageElementQName(opName));
+        
+        service.addMessageElementQNameToOperationMapping(opName, op3);
+        
+        assertEquals(null, service.getOperationByMessageElementQName(opName));       
+    }
+    
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message