axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r387899 - /webservices/axis/trunk/java/test/wsdd/TestUndeployment.java
Date Wed, 22 Mar 2006 17:30:43 GMT
Author: gawor
Date: Wed Mar 22 09:30:40 2006
New Revision: 387899

URL: http://svn.apache.org/viewcvs?rev=387899&view=rev
Log:
test for undeploy typemappings

Modified:
    webservices/axis/trunk/java/test/wsdd/TestUndeployment.java

Modified: webservices/axis/trunk/java/test/wsdd/TestUndeployment.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/test/wsdd/TestUndeployment.java?rev=387899&r1=387898&r2=387899&view=diff
==============================================================================
--- webservices/axis/trunk/java/test/wsdd/TestUndeployment.java (original)
+++ webservices/axis/trunk/java/test/wsdd/TestUndeployment.java Wed Mar 22 09:30:40 2006
@@ -8,6 +8,7 @@
 import org.apache.axis.deployment.wsdd.WSDDConstants;
 import org.apache.axis.deployment.wsdd.WSDDDeployment;
 import org.apache.axis.deployment.wsdd.WSDDDocument;
+import org.apache.axis.deployment.wsdd.WSDDTypeMapping;
 import org.apache.axis.server.AxisServer;
 import org.apache.axis.utils.XMLUtils;
 
@@ -41,6 +42,22 @@
             " <handler name=\"other\"/>\n" +
             "</undeployment>";
 
+
+   static final String typeMappingDeployDoc =
+        "<deployment xmlns=\"http://xml.apache.org/axis/wsdd/\" " +
+        "xmlns:java=\"" + WSDDConstants.URI_WSDD_JAVA + "\">\n" +
+        "<beanMapping languageSpecificType=\"java:java.lang.String\" qname=\"ns21:LineItem1\"
xmlns:ns21=\"http://www.soapinterop.org/Bid\"/>\n" +
+        "<beanMapping languageSpecificType=\"java:java.lang.String\" qname=\"ns21:LineItem2\"
xmlns:ns21=\"http://www.soapinterop.org/Bid\"/>\n" +
+        "<typeMapping deserializer=\"org.apache.axis.encoding.ser.BeanDeserializerFactory\"
encodingStyle=\"\" qname=\"ns13:&gt;Record2\" serializer=\"org.apache.axis.encoding.ser.BeanSerializerFactory\"
type=\"java:java.lang.String\" xmlns:ns13=\"http://tempuri.org/\"/>" +
+        "</deployment>";
+    
+    static final String typeMappingUndeployDoc =
+        "<undeployment xmlns=\"http://xml.apache.org/axis/wsdd/\">\n" +
+        "<beanMapping languageSpecificType=\"java:java.lang.String\" qname=\"ns21:LineItem1\"
xmlns:ns21=\"http://www.soapinterop.org/Bid\"/>\n" +
+        "<beanMapping languageSpecificType=\"java:samples.bidbuy.LineItem\" qname=\"ns21:LineItem\"
xmlns:ns21=\"http://www.soapinterop.org/Bid\"/>\n" +
+        "<typeMapping deserializer=\"org.apache.axis.encoding.ser.BeanDeserializerFactory\"
encodingStyle=\"\" qname=\"ns13:&gt;Record2\" serializer=\"org.apache.axis.encoding.ser.BeanSerializerFactory\"
type=\"java:java.lang.String\" xmlns:ns13=\"http://tempuri.org/\"/>" +
+        "</undeployment>";
+
     public TestUndeployment (String name) {
         super(name);
     }
@@ -78,6 +95,29 @@
         
         handler = server.getHandler(HANDLER_NAME);
         assertNotNull("Couldn't get handler (2nd time)", handler);
+    }
+    
+    public void testUndeployTypeMapping() throws Exception
+    {
+        XMLStringProvider provider = 
+            new XMLStringProvider(typeMappingDeployDoc);
+        AxisServer server = new AxisServer(provider);
+        WSDDDeployment dep = provider.getDeployment();
+         
+        InputStream is = new StringBufferInputStream(typeMappingUndeployDoc);
+        WSDDDocument doc = new WSDDDocument(XMLUtils.newDocument(is));
+
+        WSDDTypeMapping[] mappingsBefore = dep.getTypeMappings();
+
+        assertEquals(3, mappingsBefore.length);
+
+        // perform undeploy
+        doc.deploy(dep);
+
+        WSDDTypeMapping[] mappingsAfter = dep.getTypeMappings();
+
+        assertEquals(1, mappingsAfter.length);
+        assertEquals("LineItem2", mappingsAfter[0].getQName().getLocalPart());
     }
     
     public static void main(String[] args) throws Exception {



Mime
View raw message