You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2013/07/15 19:12:00 UTC
svn commit: r1503346 -
/cxf/branches/2.7.x-fixes/api/src/test/java/org/apache/cxf/wsdl/JAXBExtensionHelperTest.java
Author: dkulp
Date: Mon Jul 15 17:11:59 2013
New Revision: 1503346
URL: http://svn.apache.org/r1503346
Log:
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.7.x-fixes/api/src/test/java/org/apache/cxf/wsdl/JAXBExtensionHelperTest.java
Modified: cxf/branches/2.7.x-fixes/api/src/test/java/org/apache/cxf/wsdl/JAXBExtensionHelperTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/api/src/test/java/org/apache/cxf/wsdl/JAXBExtensionHelperTest.java?rev=1503346&r1=1503345&r2=1503346&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/api/src/test/java/org/apache/cxf/wsdl/JAXBExtensionHelperTest.java (original)
+++ cxf/branches/2.7.x-fixes/api/src/test/java/org/apache/cxf/wsdl/JAXBExtensionHelperTest.java Mon Jul 15 17:11:59 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);