You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by sa...@apache.org on 2012/07/18 08:35:22 UTC

svn commit: r1362781 - /axis/axis2/java/core/trunk/modules/kernel/test/org/apache/axis2/description/WSDLSupplierTest.java

Author: sagara
Date: Wed Jul 18 06:35:21 2012
New Revision: 1362781

URL: http://svn.apache.org/viewvc?rev=1362781&view=rev
Log:
Fix the test cases.  It would be better to use XML level comparison framework such as XMLUnit instead of String based comparisons.  

Modified:
    axis/axis2/java/core/trunk/modules/kernel/test/org/apache/axis2/description/WSDLSupplierTest.java

Modified: axis/axis2/java/core/trunk/modules/kernel/test/org/apache/axis2/description/WSDLSupplierTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/test/org/apache/axis2/description/WSDLSupplierTest.java?rev=1362781&r1=1362780&r2=1362781&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/kernel/test/org/apache/axis2/description/WSDLSupplierTest.java (original)
+++ axis/axis2/java/core/trunk/modules/kernel/test/org/apache/axis2/description/WSDLSupplierTest.java Wed Jul 18 06:35:21 2012
@@ -99,46 +99,44 @@ public class WSDLSupplierTest extends Te
         assertTrue(wsdl.contains("</wsdl:description>"));
     }
 
-//    public void testWSDL11SupplierTemplate() throws Exception {
-//        WSDL11SupplierTemplate value = new TestWSDL11SupplierTemplate();
-//        axisService.addParameter(Constants.WSDL_SUPPLIER_PARAM, value);
-//        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-//        axisService.printWSDL(outputStream);
-//        String wsdl = outputStream.toString();
-//        assertTrue(wsdl
-//                .contains("<wsdl:definitions xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" xmlns:wsaw=\"http://www.w3.org/2006/05/"
-//                        + "addressing/wsdl\" xmlns:http=\"http://schemas.xmlsoap.org/wsdl/http/\" "
-//                        + "xmlns:tns=\"http://ws.apache.org/axis2\" xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\" "
-//                        + "xmlns:mime=\"http://schemas.xmlsoap.org/wsdl/mime/\" xmlns:soap12=\"http://schemas.xmlsoap.org/wsdl/soap12/\" "
-//                        + "targetNamespace=\"http://ws.apache.org/axis2\">"));
-//        assertTrue(wsdl.contains("<wsdl:documentation>"));
-//        assertTrue(wsdl.contains("<ap:detail xmlns:ap=\"http://axis.apache.org\">"));
-//        assertTrue(wsdl.contains("<ap:name>Apache Axis2</ap:name>"));
-//        assertTrue(wsdl.contains("<ap:email>user@axis.apache.org</ap:email>"));
-//        assertTrue(wsdl.contains(" </ap:detail>"));
-//        assertTrue(wsdl.contains("</wsdl:documentation>"));
-//        assertFalse(wsdl.contains("<documentation/>"));
-//    }
+    public void testWSDL11SupplierTemplate() throws Exception {
+        WSDL11SupplierTemplate value = new TestWSDL11SupplierTemplate();
+        axisService.addParameter(Constants.WSDL_SUPPLIER_PARAM, value);
+        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+        axisService.printWSDL(outputStream);
+        String wsdl = outputStream.toString();
+        assertTrue(wsdl.contains("<wsdl:definitions"));
+        assertTrue(wsdl.contains("xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" "));
+        assertTrue(wsdl.contains("xmlns:wsaw=\"http://www.w3.org/2006/05/"));
+        assertTrue(wsdl.contains("xmlns:tns=\"http://ws.apache.org/axis2\""));
+        assertTrue(wsdl.contains("xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\" "));
+        assertTrue(wsdl.contains("<wsdl:documentation>"));
+        assertTrue(wsdl.contains("<ap:detail xmlns:ap=\"http://axis.apache.org\">"));
+        assertTrue(wsdl.contains("<ap:name>Apache Axis2</ap:name>"));
+        assertTrue(wsdl.contains("<ap:email>user@axis.apache.org</ap:email>"));
+        assertTrue(wsdl.contains(" </ap:detail>"));
+        assertTrue(wsdl.contains("</wsdl:documentation>"));
+        assertFalse(wsdl.contains("<documentation/>"));
+    }
 
-//    public void testWSDL11SupplierTemplateWSDL1SupplierClass() throws Exception {
-//        String value = TestWSDL11SupplierTemplate.class.getName();
-//        axisService.addParameter(Constants.WSDL_11_SUPPLIER_CLASS_PARAM, value);
-//        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-//        axisService.printWSDL(outputStream);
-//        String wsdl = outputStream.toString();
-//        assertTrue(wsdl
-//                .contains("<wsdl:definitions xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" xmlns:wsaw=\"http://www.w3.org/2006/05/"
-//                        + "addressing/wsdl\" xmlns:http=\"http://schemas.xmlsoap.org/wsdl/http/\" "
-//                        + "xmlns:tns=\"http://ws.apache.org/axis2\" xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\" "
-//                        + "xmlns:mime=\"http://schemas.xmlsoap.org/wsdl/mime/\" xmlns:soap12=\"http://schemas.xmlsoap.org/wsdl/soap12/\" "
-//                        + "targetNamespace=\"http://ws.apache.org/axis2\">"));
-//        assertTrue(wsdl.contains("<wsdl:documentation>"));
-//        assertTrue(wsdl.contains("<ap:detail xmlns:ap=\"http://axis.apache.org\">"));
-//        assertTrue(wsdl.contains("<ap:name>Apache Axis2</ap:name>"));
-//        assertTrue(wsdl.contains("<ap:email>user@axis.apache.org</ap:email>"));
-//        assertTrue(wsdl.contains(" </ap:detail>"));
-//        assertTrue(wsdl.contains("</wsdl:documentation>"));
-//        assertFalse(wsdl.contains("<documentation/>"));
-//    }
+    public void testWSDL11SupplierTemplateWSDL1SupplierClass() throws Exception {
+        String value = TestWSDL11SupplierTemplate.class.getName();
+        axisService.addParameter(Constants.WSDL_11_SUPPLIER_CLASS_PARAM, value);
+        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+        axisService.printWSDL(outputStream);
+        String wsdl = outputStream.toString();
+        assertTrue(wsdl.contains("<wsdl:definitions"));
+        assertTrue(wsdl.contains("xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" "));
+        assertTrue(wsdl.contains("xmlns:wsaw=\"http://www.w3.org/2006/05/"));
+        assertTrue(wsdl.contains("xmlns:tns=\"http://ws.apache.org/axis2\""));
+        assertTrue(wsdl.contains("xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\" "));
+        assertTrue(wsdl.contains("<wsdl:documentation>"));
+        assertTrue(wsdl.contains("<ap:detail xmlns:ap=\"http://axis.apache.org\">"));
+        assertTrue(wsdl.contains("<ap:name>Apache Axis2</ap:name>"));
+        assertTrue(wsdl.contains("<ap:email>user@axis.apache.org</ap:email>"));
+        assertTrue(wsdl.contains(" </ap:detail>"));
+        assertTrue(wsdl.contains("</wsdl:documentation>"));
+        assertFalse(wsdl.contains("<documentation/>"));
+    }
 
 }