cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1490373 - in /cxf/branches/dkulp-nowsdl4j: rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/ rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/ rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/j...
Date Thu, 06 Jun 2013 17:39:40 GMT
Author: dkulp
Date: Thu Jun  6 17:39:39 2013
New Revision: 1490373

URL: http://svn.apache.org/r1490373
Log:
Move test specific stuff to testutils

Added:
    cxf/branches/dkulp-nowsdl4j/testutils/src/main/java/org/apache/cxf/test/
    cxf/branches/dkulp-nowsdl4j/testutils/src/main/java/org/apache/cxf/test/AbstractCXFSpringTest.java
      - copied, changed from r1490347, cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/test/AbstractCXFSpringTest.java
    cxf/branches/dkulp-nowsdl4j/testutils/src/main/java/org/apache/cxf/test/AbstractCXFTest.java
      - copied, changed from r1490347, cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/test/AbstractCXFTest.java
    cxf/branches/dkulp-nowsdl4j/testutils/src/main/java/org/apache/cxf/test/TestApplicationContext.java
      - copied, changed from r1490347, cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/test/TestApplicationContext.java
    cxf/branches/dkulp-nowsdl4j/testutils/src/main/java/org/apache/cxf/test/TestUtilities.java
      - copied, changed from r1490347, cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/test/TestUtilities.java
    cxf/branches/dkulp-nowsdl4j/testutils/src/main/java/org/apache/cxf/test/XPathAssert.java
      - copied, changed from r1490347, cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/test/XPathAssert.java
    cxf/branches/dkulp-nowsdl4j/testutils/src/test/java/org/apache/cxf/test/
    cxf/branches/dkulp-nowsdl4j/testutils/src/test/java/org/apache/cxf/test/XPathAssertTest.java
      - copied, changed from r1490347, cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/test/java/org/apache/cxf/test/XPathAssertTest.java
    cxf/branches/dkulp-nowsdl4j/testutils/src/test/java/org/apache/cxf/test/test.xml
      - copied, changed from r1490347, cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/test/java/org/apache/cxf/test/test.xml
    cxf/branches/dkulp-nowsdl4j/testutils/src/test/java/org/apache/cxf/test/test2.xml
      - copied, changed from r1490347, cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/test/java/org/apache/cxf/test/test2.xml
Removed:
    cxf/branches/dkulp-nowsdl4j/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/Configuration.java
    cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/test/AbstractCXFSpringTest.java
    cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/test/AbstractCXFTest.java
    cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/test/TestApplicationContext.java
    cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/test/TestUtilities.java
    cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/test/XPathAssert.java
    cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/test/java/org/apache/cxf/test/XPathAssertTest.java
    cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/test/java/org/apache/cxf/test/test.xml
    cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/test/java/org/apache/cxf/test/test2.xml
Modified:
    cxf/branches/dkulp-nowsdl4j/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java
    cxf/branches/dkulp-nowsdl4j/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireXmlParamTypeTest.java
    cxf/branches/dkulp-nowsdl4j/rt/ws/security/pom.xml
    cxf/branches/dkulp-nowsdl4j/tools/common/src/main/java/org/apache/cxf/tools/common/ToolTestBase.java
    cxf/branches/dkulp-nowsdl4j/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/SpringServiceBuilderFactory.java
    cxf/branches/dkulp-nowsdl4j/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/AegisTest.java
    cxf/branches/dkulp-nowsdl4j/tools/javato/ws/src/test/resources/revisedAegisDefaultBeans.xml

Modified: cxf/branches/dkulp-nowsdl4j/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java?rev=1490373&r1=1490372&r2=1490373&view=diff
==============================================================================
--- cxf/branches/dkulp-nowsdl4j/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java
(original)
+++ cxf/branches/dkulp-nowsdl4j/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java
Thu Jun  6 17:39:39 2013
@@ -21,17 +21,22 @@ package org.apache.cxf.binding.soap.inte
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
+import java.util.HashMap;
+import java.util.Map;
 
 import javax.xml.namespace.QName;
 import javax.xml.soap.SOAPFault;
 import javax.xml.soap.SOAPPart;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
+import javax.xml.xpath.XPathConstants;
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
+import junit.framework.AssertionFailedError;
+
 import org.apache.cxf.binding.soap.Soap11;
 import org.apache.cxf.binding.soap.Soap12;
 import org.apache.cxf.binding.soap.SoapFault;
@@ -42,15 +47,33 @@ import org.apache.cxf.binding.soap.inter
 import org.apache.cxf.binding.soap.saaj.SAAJInInterceptor;
 import org.apache.cxf.binding.soap.saaj.SAAJInInterceptor.SAAJPreInInterceptor;
 import org.apache.cxf.helpers.DOMUtils;
+import org.apache.cxf.helpers.XMLUtils;
+import org.apache.cxf.helpers.XPathUtils;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.ExchangeImpl;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.staxutils.StaxUtils;
-import org.apache.cxf.test.AbstractCXFTest;
+
+import org.junit.Assert;
 import org.junit.Test;
 
-public class SoapFaultSerializerTest extends AbstractCXFTest {
+public class SoapFaultSerializerTest extends Assert {
+    private void assertValid(String xpathExpression, Document doc) {
+        Map<String, String> namespaces = new HashMap<String, String>();
+        namespaces.put("s", "http://schemas.xmlsoap.org/soap/envelope/");
+        namespaces.put("xsd", "http://www.w3.org/2001/XMLSchema");
+        namespaces.put("wsdl", "http://schemas.xmlsoap.org/wsdl/");
+        namespaces.put("wsdlsoap", "http://schemas.xmlsoap.org/wsdl/soap/");
+        namespaces.put("soap", "http://schemas.xmlsoap.org/soap/");
+        namespaces.put("soap12env", "http://www.w3.org/2003/05/soap-envelope");
+        namespaces.put("xml", "http://www.w3.org/XML/1998/namespace");
+        XPathUtils xpu = new XPathUtils(namespaces);
+        if (!xpu.isExist(xpathExpression, doc, XPathConstants.NODE)) {
+            throw new AssertionFailedError("Failed to select any nodes for expression:\n"
+ xpathExpression
+                                           + " from document:\n" + XMLUtils.toString(doc));
+        }
+    }
     
     @Test
     public void testSoap11Out() throws Exception {
@@ -200,7 +223,6 @@ public class SoapFaultSerializerTest ext
         assertEquals(fault.getMessage(), fault2.getMessage());        
         assertEquals(fault.getSubCodes(), fault2.getSubCodes());
     }
-
     @Test
     public void testFaultToSoapFault() throws Exception {
         Exception ex = new Exception();

Modified: cxf/branches/dkulp-nowsdl4j/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireXmlParamTypeTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireXmlParamTypeTest.java?rev=1490373&r1=1490372&r2=1490373&view=diff
==============================================================================
--- cxf/branches/dkulp-nowsdl4j/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireXmlParamTypeTest.java
(original)
+++ cxf/branches/dkulp-nowsdl4j/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/XFireXmlParamTypeTest.java
Thu Jun  6 17:39:39 2013
@@ -36,7 +36,6 @@ public class XFireXmlParamTypeTest exten
     private DefaultTypeMapping tm;
     private Java5TypeCreator creator;
 
-    @SuppressWarnings("deprecation")
     @Before
     public void setUp() throws Exception {
         super.setUp();
@@ -44,7 +43,7 @@ public class XFireXmlParamTypeTest exten
         tm = new DefaultTypeMapping(null, DefaultTypeMapping.createDefaultTypeMapping(false,
false));
         creator = new Java5TypeCreator();
         creator.setNextCreator(new DefaultTypeCreator());
-        creator.setConfiguration(new org.apache.cxf.aegis.type.Configuration());
+        creator.setConfiguration(new org.apache.cxf.aegis.type.TypeCreationOptions());
         tm.setTypeCreator(creator);
     }
 

Modified: cxf/branches/dkulp-nowsdl4j/rt/ws/security/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/rt/ws/security/pom.xml?rev=1490373&r1=1490372&r2=1490373&view=diff
==============================================================================
--- cxf/branches/dkulp-nowsdl4j/rt/ws/security/pom.xml (original)
+++ cxf/branches/dkulp-nowsdl4j/rt/ws/security/pom.xml Thu Jun  6 17:39:39 2013
@@ -146,6 +146,12 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-testutils</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.easymock</groupId>
             <artifactId>easymock</artifactId>
             <scope>test</scope>

Copied: cxf/branches/dkulp-nowsdl4j/testutils/src/main/java/org/apache/cxf/test/AbstractCXFSpringTest.java
(from r1490347, cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/test/AbstractCXFSpringTest.java)
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/testutils/src/main/java/org/apache/cxf/test/AbstractCXFSpringTest.java?p2=cxf/branches/dkulp-nowsdl4j/testutils/src/main/java/org/apache/cxf/test/AbstractCXFSpringTest.java&p1=cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/test/AbstractCXFSpringTest.java&r1=1490347&r2=1490373&rev=1490373&view=diff
==============================================================================
    (empty)

Copied: cxf/branches/dkulp-nowsdl4j/testutils/src/main/java/org/apache/cxf/test/AbstractCXFTest.java
(from r1490347, cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/test/AbstractCXFTest.java)
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/testutils/src/main/java/org/apache/cxf/test/AbstractCXFTest.java?p2=cxf/branches/dkulp-nowsdl4j/testutils/src/main/java/org/apache/cxf/test/AbstractCXFTest.java&p1=cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/test/AbstractCXFTest.java&r1=1490347&r2=1490373&rev=1490373&view=diff
==============================================================================
    (empty)

Copied: cxf/branches/dkulp-nowsdl4j/testutils/src/main/java/org/apache/cxf/test/TestApplicationContext.java
(from r1490347, cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/test/TestApplicationContext.java)
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/testutils/src/main/java/org/apache/cxf/test/TestApplicationContext.java?p2=cxf/branches/dkulp-nowsdl4j/testutils/src/main/java/org/apache/cxf/test/TestApplicationContext.java&p1=cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/test/TestApplicationContext.java&r1=1490347&r2=1490373&rev=1490373&view=diff
==============================================================================
    (empty)

Copied: cxf/branches/dkulp-nowsdl4j/testutils/src/main/java/org/apache/cxf/test/TestUtilities.java
(from r1490347, cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/test/TestUtilities.java)
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/testutils/src/main/java/org/apache/cxf/test/TestUtilities.java?p2=cxf/branches/dkulp-nowsdl4j/testutils/src/main/java/org/apache/cxf/test/TestUtilities.java&p1=cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/test/TestUtilities.java&r1=1490347&r2=1490373&rev=1490373&view=diff
==============================================================================
    (empty)

Copied: cxf/branches/dkulp-nowsdl4j/testutils/src/main/java/org/apache/cxf/test/XPathAssert.java
(from r1490347, cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/test/XPathAssert.java)
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/testutils/src/main/java/org/apache/cxf/test/XPathAssert.java?p2=cxf/branches/dkulp-nowsdl4j/testutils/src/main/java/org/apache/cxf/test/XPathAssert.java&p1=cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/main/java/org/apache/cxf/test/XPathAssert.java&r1=1490347&r2=1490373&rev=1490373&view=diff
==============================================================================
    (empty)

Copied: cxf/branches/dkulp-nowsdl4j/testutils/src/test/java/org/apache/cxf/test/XPathAssertTest.java
(from r1490347, cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/test/java/org/apache/cxf/test/XPathAssertTest.java)
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/testutils/src/test/java/org/apache/cxf/test/XPathAssertTest.java?p2=cxf/branches/dkulp-nowsdl4j/testutils/src/test/java/org/apache/cxf/test/XPathAssertTest.java&p1=cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/test/java/org/apache/cxf/test/XPathAssertTest.java&r1=1490347&r2=1490373&rev=1490373&view=diff
==============================================================================
    (empty)

Copied: cxf/branches/dkulp-nowsdl4j/testutils/src/test/java/org/apache/cxf/test/test.xml (from
r1490347, cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/test/java/org/apache/cxf/test/test.xml)
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/testutils/src/test/java/org/apache/cxf/test/test.xml?p2=cxf/branches/dkulp-nowsdl4j/testutils/src/test/java/org/apache/cxf/test/test.xml&p1=cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/test/java/org/apache/cxf/test/test.xml&r1=1490347&r2=1490373&rev=1490373&view=diff
==============================================================================
    (empty)

Copied: cxf/branches/dkulp-nowsdl4j/testutils/src/test/java/org/apache/cxf/test/test2.xml
(from r1490347, cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/test/java/org/apache/cxf/test/test2.xml)
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/testutils/src/test/java/org/apache/cxf/test/test2.xml?p2=cxf/branches/dkulp-nowsdl4j/testutils/src/test/java/org/apache/cxf/test/test2.xml&p1=cxf/branches/dkulp-nowsdl4j/rt/wsdl/src/test/java/org/apache/cxf/test/test2.xml&r1=1490347&r2=1490373&rev=1490373&view=diff
==============================================================================
    (empty)

Modified: cxf/branches/dkulp-nowsdl4j/tools/common/src/main/java/org/apache/cxf/tools/common/ToolTestBase.java
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/tools/common/src/main/java/org/apache/cxf/tools/common/ToolTestBase.java?rev=1490373&r1=1490372&r2=1490373&view=diff
==============================================================================
--- cxf/branches/dkulp-nowsdl4j/tools/common/src/main/java/org/apache/cxf/tools/common/ToolTestBase.java
(original)
+++ cxf/branches/dkulp-nowsdl4j/tools/common/src/main/java/org/apache/cxf/tools/common/ToolTestBase.java
Thu Jun  6 17:39:39 2013
@@ -24,12 +24,12 @@ import java.io.File;
 import java.io.PrintStream;
 
 import org.apache.cxf.helpers.FileUtils;
-import org.apache.cxf.test.AbstractCXFTest;
 
 import org.junit.After;
+import org.junit.Assert;
 import org.junit.Before;
 
-public abstract class ToolTestBase extends AbstractCXFTest {
+public abstract class ToolTestBase extends Assert {
 
     protected PrintStream oldStdErr; 
     protected PrintStream oldStdOut; 

Modified: cxf/branches/dkulp-nowsdl4j/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/SpringServiceBuilderFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/SpringServiceBuilderFactory.java?rev=1490373&r1=1490372&r2=1490373&view=diff
==============================================================================
--- cxf/branches/dkulp-nowsdl4j/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/SpringServiceBuilderFactory.java
(original)
+++ cxf/branches/dkulp-nowsdl4j/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/SpringServiceBuilderFactory.java
Thu Jun  6 17:39:39 2013
@@ -78,7 +78,7 @@ public final class SpringServiceBuilderF
             dataBinding = (DataBinding)applicationContext.getBean(databindingBeanName);
         } catch (RuntimeException e) {
             throw new ToolException("Cannot get databinding bean " + databindingBeanName
-                                    + " for databinding " + databindingName);
+                                    + " for databinding " + databindingName, e);
         }
 
         String beanName = getBuilderBeanName(s);

Modified: cxf/branches/dkulp-nowsdl4j/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/AegisTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/AegisTest.java?rev=1490373&r1=1490372&r2=1490373&view=diff
==============================================================================
--- cxf/branches/dkulp-nowsdl4j/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/AegisTest.java
(original)
+++ cxf/branches/dkulp-nowsdl4j/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/AegisTest.java
Thu Jun  6 17:39:39 2013
@@ -20,14 +20,21 @@ package org.apache.cxf.tools.java2ws;
 
 import java.io.File;
 import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
 
 import javax.wsdl.Definition;
 import javax.wsdl.factory.WSDLFactory;
 import javax.wsdl.xml.WSDLReader;
+import javax.xml.xpath.XPathConstants;
 
 import org.w3c.dom.Document;
 
+import junit.framework.AssertionFailedError;
+
 import org.apache.cxf.helpers.FileUtils;
+import org.apache.cxf.helpers.XMLUtils;
+import org.apache.cxf.helpers.XPathUtils;
 import org.apache.cxf.tools.common.ToolTestBase;
 import org.junit.After;
 import org.junit.Before;
@@ -39,12 +46,6 @@ public class AegisTest extends ToolTestB
     private String cp;
     private File inputData;
     
-    private void checkStdErr() {
-        String err = getStdErr();
-        if (err != null) {
-            assertEquals("errors: ", "", err);
-        }
-    }
 
     @Before
     public void startUp() throws Exception {
@@ -80,21 +81,18 @@ public class AegisTest extends ToolTestB
         File wsdlFile = null;
         wsdlFile = outputFile("aegis.wsdl");
         JavaToWS.main(args);
-        checkStdErr();
         assertTrue("wsdl is not generated", wsdlFile.exists());
     
         WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
         reader.setFeature("javax.wsdl.verbose", false);
         Definition def = reader.readWSDL(wsdlFile.toURI().toURL().toString());
         Document wsdl = WSDLFactory.newInstance().newWSDLWriter().getDocument(def);
-        addNamespace("ns0", "http://aegis2ws.fortest.tools.cxf.apache.org/");
         assertValid("//xsd:element[@type='ns0:Something']", wsdl);
     }
     
     @Test 
-    @org.junit.Ignore("Failed on Windows Vista")
     public void testAegisReconfigureDatabinding() throws Exception {
-        final String sei = "org.apache.cxf.tools.fortest.aegis2ws.TestAegisSEI";
+        final String sei = org.apache.cxf.tools.fortest.aegis2ws.TestAegisSEI.class.getName();
         String[] args = new String[] {"-wsdl", "-o", output.getPath() + "/aegis.wsdl", 
                                       "-beans",
                                       new File(inputData, "revisedAegisDefaultBeans.xml").
@@ -105,21 +103,43 @@ public class AegisTest extends ToolTestB
         File wsdlFile = null;
         wsdlFile = outputFile("aegis.wsdl");
         JavaToWS.main(args);
-        checkStdErr();
         assertTrue("wsdl is not generated", wsdlFile.exists());
     
         WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
         reader.setFeature("javax.wsdl.verbose", false);
         Definition def = reader.readWSDL(wsdlFile.toURI().toURL().toString());
         Document wsdl = WSDLFactory.newInstance().newWSDLWriter().getDocument(def);
-        addNamespace("ns0", "http://aegis2ws.fortest.tools.cxf.apache.org/");
         assertValid("//xsd:element[@type='ns0:Something']", wsdl);
-        assertXPathEquals("//xsd:complexType[@name='Something']/" 
-                          + "xsd:sequence/xsd:element[@name='multiple']/@minOccurs", 
-                          "50", wsdl);
-        assertInvalid("//xsd:complexType[@name='Something']/" 
-                          + "xsd:sequence/xsd:element[@name='singular']/@minOccurs", 
-                          wsdl);
+        XPathUtils xpu = new XPathUtils(getNSMap());
+        
+        String s = (String)xpu.getValue("//xsd:complexType[@name='takeSomething']/"
+                                + "xsd:sequence/xsd:element[@name='arg0']/@minOccurs",
+                                wsdl, XPathConstants.STRING);
+        assertEquals("50", s);
+        assertFalse(xpu.isExist("//xsd:complexType[@name='Something']/xsd:sequence/"
+                                + "xsd:element[@name='singular']/@minOccurs",
+                         wsdl, XPathConstants.NODE));
     }
 
+
+    private Map<String, String> getNSMap() {
+        Map<String, String> namespaces = new HashMap<String, String>();
+        namespaces.put("s", "http://schemas.xmlsoap.org/soap/envelope/");
+        namespaces.put("xsd", "http://www.w3.org/2001/XMLSchema");
+        namespaces.put("wsdl", "http://schemas.xmlsoap.org/wsdl/");
+        namespaces.put("wsdlsoap", "http://schemas.xmlsoap.org/wsdl/soap/");
+        namespaces.put("soap", "http://schemas.xmlsoap.org/soap/");
+        namespaces.put("soap12env", "http://www.w3.org/2003/05/soap-envelope");
+        namespaces.put("xml", "http://www.w3.org/XML/1998/namespace");
+        namespaces.put("ns0", "http://aegis2ws.fortest.tools.cxf.apache.org/");
+        return namespaces;
+    }
+    
+    private void assertValid(String xpathExpression, Document doc) {
+        XPathUtils xpu = new XPathUtils(getNSMap());
+        if (!xpu.isExist(xpathExpression, doc, XPathConstants.NODE)) {
+            throw new AssertionFailedError("Failed to select any nodes for expression:\n"
+ xpathExpression
+                                           + " from document:\n" + XMLUtils.toString(doc));
+        }
+    }    
 }

Modified: cxf/branches/dkulp-nowsdl4j/tools/javato/ws/src/test/resources/revisedAegisDefaultBeans.xml
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/tools/javato/ws/src/test/resources/revisedAegisDefaultBeans.xml?rev=1490373&r1=1490372&r2=1490373&view=diff
==============================================================================
--- cxf/branches/dkulp-nowsdl4j/tools/javato/ws/src/test/resources/revisedAegisDefaultBeans.xml
(original)
+++ cxf/branches/dkulp-nowsdl4j/tools/javato/ws/src/test/resources/revisedAegisDefaultBeans.xml
Thu Jun  6 17:39:39 2013
@@ -22,17 +22,12 @@
        xsi:schemaLocation="
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
 
-<bean id="AegisDatabindingBean" class="org.apache.cxf.aegis.databinding.AegisDatabinding"
 >
-	<property name="typeMappingRegistry">
-		<bean class="org.apache.cxf.aegis.type.DefaultTypeMappingRegistry">
-		    <constructor-arg index="0" value="true"/>
-			<property name="configuration">
-				<bean class="org.apache.cxf.aegis.type.Configuration">
-					<property name="defaultMinOccurs" value="50"/>
-				</bean>
-			</property>
-		</bean>
-	</property>
-</bean>
+    <bean id="AegisDatabindingBean" class="org.apache.cxf.aegis.databinding.AegisDatabinding"
 >
+        <property name="configuration">
+            <bean class="org.apache.cxf.aegis.type.TypeCreationOptions">
+                <property name="defaultMinOccurs" value="50"/>
+            </bean>
+        </property>
+    </bean>
 
 </beans>



Mime
View raw message