Author: dkulp Date: Mon Jul 15 18:04:04 2013 New Revision: 1503378 URL: http://svn.apache.org/r1503378 Log: Merged revisions 1503346 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes
........ r1503346 | dkulp | 2013-07-15 13:11:59 -0400 (Mon, 15 Jul 2013) | 10 lines Merged revisions 1502886 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/trunk ........ r1502886 | dkulp | 2013-07-13 17:29:32 -0400 (Sat, 13 Jul 2013) | 2 lines Use the output transformer to map the namespaces as other jaxb impls may not use the namespace context the same way. ........ ........ Modified: cxf/branches/2.6.x-fixes/api/src/test/java/org/apache/cxf/wsdl/JAXBExtensionHelperTest.java Modified: cxf/branches/2.6.x-fixes/api/src/test/java/org/apache/cxf/wsdl/JAXBExtensionHelperTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/api/src/test/java/org/apache/cxf/wsdl/JAXBExtensionHelperTest.java?rev=1503378&r1=1503377&r2=1503378&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/api/src/test/java/org/apache/cxf/wsdl/JAXBExtensionHelperTest.java (original) +++ cxf/branches/2.6.x-fixes/api/src/test/java/org/apache/cxf/wsdl/JAXBExtensionHelperTest.java Mon Jul 15 18:04:04 2013 @@ -30,6 +30,7 @@ import javax.wsdl.Definition; import javax.wsdl.Port; import javax.wsdl.Service; import javax.wsdl.extensions.ExtensionRegistry; +import javax.wsdl.extensions.UnknownExtensibilityElement; import javax.wsdl.factory.WSDLFactory; import javax.wsdl.xml.WSDLReader; import javax.xml.namespace.QName; @@ -39,6 +40,7 @@ import org.xml.sax.InputSource; import org.apache.cxf.abc.test.AnotherPolicyType; import org.apache.cxf.abc.test.NewServiceType; import org.apache.cxf.abc.test.TestPolicyType; + import org.junit.Assert; import org.junit.Before; import org.junit.Test; @@ -134,16 +136,16 @@ public class JAXBExtensionHelperTest ext @Test public void testMappedNamespace() throws Exception { - JAXBExtensionHelper.addExtensions(registry, "javax.wsdl.Port", - "org.apache.cxf.abc.test.TestPolicyType", + JAXBExtensionHelper.addExtensions(registry, javax.wsdl.Port.class, + org.apache.cxf.abc.test.TestPolicyType.class, "http://cxf.apache.org/abc/test/remapped"); - JAXBExtensionHelper.addExtensions(registry, "javax.wsdl.Port", - "org.apache.cxf.abc.test.AnotherPolicyType", + JAXBExtensionHelper.addExtensions(registry, javax.wsdl.Port.class, + org.apache.cxf.abc.test.AnotherPolicyType.class, "http://cxf.apache.org/abc/test/remapped"); - JAXBExtensionHelper.addExtensions(registry, "javax.wsdl.Definition", - "org.apache.cxf.abc.test.NewServiceType", + JAXBExtensionHelper.addExtensions(registry, javax.wsdl.Definition.class, + org.apache.cxf.abc.test.NewServiceType.class, "http://cxf.apache.org/abc/test/remapped"); String file = this.getClass().getResource("/wsdl/test_ext_remapped.wsdl").toURI().toString(); @@ -169,9 +171,11 @@ public class JAXBExtensionHelperTest ext for (Object ext : extPortList) { if (ext instanceof TestPolicyType) { tp = (TestPolicyType) ext; - } - if (ext instanceof AnotherPolicyType) { + } else if (ext instanceof AnotherPolicyType) { ap = (AnotherPolicyType) ext; + } else if (ext instanceof UnknownExtensibilityElement) { + UnknownExtensibilityElement e = (UnknownExtensibilityElement)ext; + System.out.println(e.getElementType()); } } assertNotNull("Could not find extension element TestPolicyType", tp);
