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 2014/03/27 14:07:53 UTC
[1/7] git commit: xsd:ID is only supposed to be used as Attributes,
not as element types as per: http://www.w3.org/TR/xmlschema11-2/#ID
Repository: cxf
Updated Branches:
refs/heads/master dc5bde7d9 -> 939b54221
xsd:ID is only supposed to be used as Attributes, not as element types as per:
http://www.w3.org/TR/xmlschema11-2/#ID
so don't test this.
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/939b5422
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/939b5422
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/939b5422
Branch: refs/heads/master
Commit: 939b54221d6e787acae16b21ec977e3a5cbd00dc
Parents: 3b3d0fd
Author: Daniel Kulp <dk...@apache.org>
Authored: Thu Mar 27 02:25:35 2014 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Thu Mar 27 09:07:49 2014 -0400
----------------------------------------------------------------------
.../type_test/AbstractTypeTestClient.java | 31 --------------------
.../main/resources/wsdl/type_test/type_test.xsd | 2 +-
.../wsdl/type_test/type_test_impl_java.xsl | 9 ------
3 files changed, 1 insertion(+), 41 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/939b5422/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java
----------------------------------------------------------------------
diff --git a/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java b/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java
index 7dfa642..baa043a 100644
--- a/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java
+++ b/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java
@@ -1119,37 +1119,6 @@ public abstract class AbstractTypeTestClient
}
@Test
- public void testID() throws Exception {
- if (!shouldRunTest("ID")) {
- return;
- }
- // n.b. to be valid, elements with an ID in the response message
- // must have a unique ID, so this test does not return x as the
- // return value (like the other tests).
- String valueSets[][] = {{"root.id-testartix.2", "L.-type_test"}, {"_iona.com", "zoo-5_wolf"},
- {"x-_liberty", "_-.-_"}};
-
- for (int i = 0; i < valueSets.length; i++) {
- String x = valueSets[i][0];
- String yOrig = valueSets[i][1];
- Holder<String> y = new Holder<String>(yOrig);
- Holder<String> z = new Holder<String>();
-
- if (testDocLiteral) {
- /* String ret = */docClient.testID(x, y, z);
- } else if (testXMLBinding) {
- /* String ret = */xmlClient.testID(x, y, z);
- } else {
- /* String ret = */rpcClient.testID(x, y, z);
- }
- if (!perfTestOnly) {
- assertEquals("testID(): Incorrect value for inout param", x, y.value);
- assertEquals("testID(): Incorrect value for out param", yOrig, z.value);
- }
- }
- }
-
- @Test
public void testDecimal() throws Exception {
if (!shouldRunTest("Decimal")) {
return;
http://git-wip-us.apache.org/repos/asf/cxf/blob/939b5422/testutils/src/main/resources/wsdl/type_test/type_test.xsd
----------------------------------------------------------------------
diff --git a/testutils/src/main/resources/wsdl/type_test/type_test.xsd b/testutils/src/main/resources/wsdl/type_test/type_test.xsd
index bd7b555..6fa0bc3 100644
--- a/testutils/src/main/resources/wsdl/type_test/type_test.xsd
+++ b/testutils/src/main/resources/wsdl/type_test/type_test.xsd
@@ -91,7 +91,7 @@
<itst:builtIn name="NMTOKENS" javaType="java.util.List<java.lang.String>" javaHolder="java.util.List<java.lang.String>"/>
<itst:builtIn name="Name" javaType="java.lang.String" javaHolder="java.lang.String"/>
<itst:builtIn name="NCName" javaType="java.lang.String" javaHolder="java.lang.String"/>
- <itst:builtIn name="ID" javaType="java.lang.String" javaHolder="java.lang.String"/>
+ <!-- itst:builtIn name="ID" javaType="java.lang.String" javaHolder="java.lang.String"/-->
<itst:builtIn name="base64Binary" javaType="byte[]" javaHolder="byte[]"/>
<itst:builtIn name="hexBinary" javaType="byte[]" javaHolder="byte[]"/>
http://git-wip-us.apache.org/repos/asf/cxf/blob/939b5422/testutils/src/main/resources/wsdl/type_test/type_test_impl_java.xsl
----------------------------------------------------------------------
diff --git a/testutils/src/main/resources/wsdl/type_test/type_test_impl_java.xsl b/testutils/src/main/resources/wsdl/type_test/type_test_impl_java.xsl
index 626b88f..c12c399 100644
--- a/testutils/src/main/resources/wsdl/type_test/type_test_impl_java.xsl
+++ b/testutils/src/main/resources/wsdl/type_test/type_test_impl_java.xsl
@@ -269,15 +269,6 @@ public class TypeTestImpl {
return x;
}
- public java.lang.String testID(
- java.lang.String x,
- Holder<java.lang.String> y,
- Holder<java.lang.String> z) {
- z.value = y.value;
- y.value = x;
- return x + y.value;
- }
-
public IDTypeAttribute testIDTypeAttribute(
IDTypeAttribute x,
Holder<IDTypeAttribute> y,
[4/7] git commit: Fix to check against the local name,
not the tag name
Posted by dk...@apache.org.
Fix to check against the local name, not the tag name
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/8749d147
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8749d147
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8749d147
Branch: refs/heads/master
Commit: 8749d147323bef3801e43b099cd4d455c00d1963
Parents: dc5bde7
Author: Daniel Kulp <dk...@apache.org>
Authored: Wed Mar 26 17:37:44 2014 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Thu Mar 27 09:07:49 2014 -0400
----------------------------------------------------------------------
.../notificationapi/assertions/WSAActionAssertingHandler.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/8749d147/rt/ws/eventing/src/test/java/org/apache/cxf/ws/eventing/integration/notificationapi/assertions/WSAActionAssertingHandler.java
----------------------------------------------------------------------
diff --git a/rt/ws/eventing/src/test/java/org/apache/cxf/ws/eventing/integration/notificationapi/assertions/WSAActionAssertingHandler.java b/rt/ws/eventing/src/test/java/org/apache/cxf/ws/eventing/integration/notificationapi/assertions/WSAActionAssertingHandler.java
index 7f30de0..5ae2ad7 100644
--- a/rt/ws/eventing/src/test/java/org/apache/cxf/ws/eventing/integration/notificationapi/assertions/WSAActionAssertingHandler.java
+++ b/rt/ws/eventing/src/test/java/org/apache/cxf/ws/eventing/integration/notificationapi/assertions/WSAActionAssertingHandler.java
@@ -61,7 +61,7 @@ public class WSAActionAssertingHandler implements SOAPHandler<SOAPMessageContext
try {
Element elm = DOMUtils.getFirstElement(context.getMessage().getSOAPHeader());
while (elm != null) {
- if (elm.getTagName().equals("Action") && elm.getNamespaceURI().contains("addressing")) {
+ if (elm.getLocalName().equals("Action") && elm.getNamespaceURI().contains("addressing")) {
if (!elm.getTextContent().equals(action)) {
throw new RuntimeException("The event sink should have received "
+ "WSA-Action: " + action + " but received: "
[2/7] git commit: With MOXy,
the array types namespace only comes from the package-info
Posted by dk...@apache.org.
With MOXy, the array types namespace only comes from the package-info
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1b9f0119
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1b9f0119
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1b9f0119
Branch: refs/heads/master
Commit: 1b9f011954eef8021927bfe498d5ce0b93c7a0c9
Parents: e97f8b2
Author: Daniel Kulp <dk...@apache.org>
Authored: Thu Mar 27 01:14:40 2014 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Thu Mar 27 09:07:49 2014 -0400
----------------------------------------------------------------------
.../org/apache/cxf/javascript/fortest/package-info.java | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/1b9f0119/rt/javascript/javascript-tests/src/test/java/org/apache/cxf/javascript/fortest/package-info.java
----------------------------------------------------------------------
diff --git a/rt/javascript/javascript-tests/src/test/java/org/apache/cxf/javascript/fortest/package-info.java b/rt/javascript/javascript-tests/src/test/java/org/apache/cxf/javascript/fortest/package-info.java
index 2968f4c..bd091d2 100644
--- a/rt/javascript/javascript-tests/src/test/java/org/apache/cxf/javascript/fortest/package-info.java
+++ b/rt/javascript/javascript-tests/src/test/java/org/apache/cxf/javascript/fortest/package-info.java
@@ -17,12 +17,5 @@
* under the License.
*/
-@javax.xml.bind.annotation.XmlSchema(xmlns = {
- @javax.xml.bind.annotation.XmlNs(
- namespaceURI = "uri:org.apache.cxf.javascript.testns3",
- prefix = "Plan3")
- }
- ,
- elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED
- )
-package org.apache.cxf.javascript.fortest;
\ No newline at end of file
+@javax.xml.bind.annotation.XmlSchema(namespace = "uri:org.apache.cxf.javascript.testns")
+package org.apache.cxf.javascript.fortest;
[7/7] git commit: Handle the case of Arrays and how they are mapped.
Posted by dk...@apache.org.
Handle the case of Arrays and how they are mapped.
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e97f8b2e
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e97f8b2e
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e97f8b2e
Branch: refs/heads/master
Commit: e97f8b2ebfbf3e0fe6a6a8e975f1aacf15e36b22
Parents: 589cfb1
Author: Daniel Kulp <dk...@apache.org>
Authored: Thu Mar 27 01:14:14 2014 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Thu Mar 27 09:07:49 2014 -0400
----------------------------------------------------------------------
.../cxf/common/jaxb/SchemaCollectionContextProxy.java | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/e97f8b2e/core/src/main/java/org/apache/cxf/common/jaxb/SchemaCollectionContextProxy.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/jaxb/SchemaCollectionContextProxy.java b/core/src/main/java/org/apache/cxf/common/jaxb/SchemaCollectionContextProxy.java
index b150fd0..c5e7d65 100644
--- a/core/src/main/java/org/apache/cxf/common/jaxb/SchemaCollectionContextProxy.java
+++ b/core/src/main/java/org/apache/cxf/common/jaxb/SchemaCollectionContextProxy.java
@@ -125,6 +125,12 @@ public class SchemaCollectionContextProxy implements JAXBContextProxy {
}
public Object getBeanInfo(Class<?> cls) {
+ Class<?> origCls = cls;
+ String postfix = "";
+ while (cls.isArray()) {
+ cls = cls.getComponentType();
+ postfix += "Array";
+ }
XmlRootElement xre = cls.getAnnotation(XmlRootElement.class);
String name = xre == null ? "##default" : xre.name();
String namespace = xre == null ? "##default" : xre.namespace();
@@ -143,20 +149,20 @@ public class SchemaCollectionContextProxy implements JAXBContextProxy {
namespace = defaultNamespace;
}
}
- final QName qname = new QName(namespace, name);
+ final QName qname = new QName(namespace, name + postfix);
final XmlSchemaElement el = schemas.getElementByQName(qname);
XmlSchemaType type = null;
if (el != null) {
type = el.getSchemaType();
}
if (type == null) {
- type = schemas.getTypeByQName(getTypeQName(cls, namespace));
+ type = schemas.getTypeByQName(getTypeQName(origCls, namespace));
if (type == null) {
type = schemas.getTypeByQName(qname);
}
}
if (type == null) {
- type = mapToSchemaType(cls, namespace);
+ type = mapToSchemaType(origCls, namespace);
/*
if (type == null) {
type = mapToSchemaType(cls, namespace);
[6/7] git commit: Fix how the test looks for the messageId
Posted by dk...@apache.org.
Fix how the test looks for the messageId
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/3b3d0fd1
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/3b3d0fd1
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/3b3d0fd1
Branch: refs/heads/master
Commit: 3b3d0fd140ccd741253d5c0727d6a264af76d125
Parents: 1b9f011
Author: Daniel Kulp <dk...@apache.org>
Authored: Thu Mar 27 01:25:24 2014 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Thu Mar 27 09:07:49 2014 -0400
----------------------------------------------------------------------
.../java/org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/3b3d0fd1/services/ws-discovery/ws-discovery-api/src/test/java/org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java
----------------------------------------------------------------------
diff --git a/services/ws-discovery/ws-discovery-api/src/test/java/org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java b/services/ws-discovery/ws-discovery-api/src/test/java/org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java
index f404dbe..2a548aa 100644
--- a/services/ws-discovery/ws-discovery-api/src/test/java/org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java
+++ b/services/ws-discovery/ws-discovery-api/src/test/java/org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java
@@ -95,8 +95,9 @@ public final class WSDiscoveryClientTest {
s.receive(p);
SocketAddress sa = p.getSocketAddress();
String incoming = new String(p.getData(), 0, p.getLength(), "UTF-8");
- int idx = incoming.indexOf("MessageID>");
- incoming = incoming.substring(idx + 10);
+ int idx = incoming.indexOf("MessageID");
+ idx = incoming.indexOf('>', idx);
+ incoming = incoming.substring(idx + 1);
idx = incoming.indexOf("</");
incoming = incoming.substring(0, idx);
for (int x = 1; x < 4; x++) {
[3/7] git commit: The the rs/providers working with MOXy
Posted by dk...@apache.org.
The the rs/providers working with MOXy
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/43480782
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/43480782
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/43480782
Branch: refs/heads/master
Commit: 434807822d07b68df50c96f005c1085a12b51e74
Parents: 8749d14
Author: Daniel Kulp <dk...@apache.org>
Authored: Wed Mar 26 19:07:01 2014 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Thu Mar 27 09:07:49 2014 -0400
----------------------------------------------------------------------
.../transform/DelegatingNamespaceContext.java | 6 +++--
.../jaxrs/provider/json/utils/JSONUtils.java | 9 ++++++++
.../jaxrs/provider/json/JSONProviderTest.java | 23 ++++++++++++++++++--
3 files changed, 34 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/43480782/core/src/main/java/org/apache/cxf/staxutils/transform/DelegatingNamespaceContext.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/staxutils/transform/DelegatingNamespaceContext.java b/core/src/main/java/org/apache/cxf/staxutils/transform/DelegatingNamespaceContext.java
index 9d5737f..041b181 100644
--- a/core/src/main/java/org/apache/cxf/staxutils/transform/DelegatingNamespaceContext.java
+++ b/core/src/main/java/org/apache/cxf/staxutils/transform/DelegatingNamespaceContext.java
@@ -52,8 +52,10 @@ class DelegatingNamespaceContext implements NamespaceContext {
}
public void addPrefix(String prefix, String ns) {
- namespaces.getFirst().put(prefix, ns);
- prefixes.getFirst().put(ns, prefix);
+ if (!namespaces.isEmpty()) {
+ namespaces.getFirst().put(prefix, ns);
+ prefixes.getFirst().put(ns, prefix);
+ }
}
public String findUniquePrefix(String ns) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/43480782/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/utils/JSONUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/utils/JSONUtils.java b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/utils/JSONUtils.java
index 27642a4..348cd84 100644
--- a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/utils/JSONUtils.java
+++ b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/utils/JSONUtils.java
@@ -176,6 +176,15 @@ public final class JSONUtils {
this.namespaceMap = nsMap;
}
+
+ public String getNamespaceURI(String arg0) {
+ String uri = super.getNamespaceURI(arg0);
+ if (uri == null) {
+ uri = getNamespaceContext().getNamespaceURI(arg0);
+ }
+ return uri;
+ }
+
@Override
public String getAttributePrefix(int n) {
QName name = getAttributeName(n);
http://git-wip-us.apache.org/repos/asf/cxf/blob/43480782/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java b/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java
index 9437bae..adccbb5 100644
--- a/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java
+++ b/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java
@@ -61,6 +61,7 @@ import javax.xml.stream.XMLStreamWriter;
import javax.xml.transform.stream.StreamSource;
import org.w3c.dom.Document;
+
import org.apache.cxf.common.util.StringUtils;
import org.apache.cxf.helpers.CastUtils;
import org.apache.cxf.jaxrs.impl.MetadataMap;
@@ -76,6 +77,7 @@ import org.apache.cxf.jaxrs.resources.jaxb.Book2;
import org.apache.cxf.jaxrs.resources.jaxb.Book2NoRootElement;
import org.apache.cxf.staxutils.DelegatingXMLStreamWriter;
import org.apache.cxf.staxutils.StaxUtils;
+
import org.junit.Assert;
import org.junit.Test;
@@ -635,6 +637,10 @@ public class JSONProviderTest extends Assert {
@Test
public void testWriteToSingleQualifiedTagBadgerFish() throws Exception {
JSONProvider<TagVO2> p = new JSONProvider<TagVO2>();
+ Map<String, String> namespaceMap = new HashMap<String, String>();
+ namespaceMap.put("http://tags", "ns2");
+ p.setNamespaceMap(namespaceMap);
+
p.setConvention("badgerfish");
TagVO2 tag = createTag2("a", "b");
@@ -895,9 +901,10 @@ public class JSONProviderTest extends Assert {
private void doTestMixedContent(String data, boolean ignore, String fileName) throws Exception {
InputStream is = getClass().getResourceAsStream(fileName);
- JAXBContext context = JAXBContext.newInstance(new Class[]{Books.class, Book.class});
+ JAXBContext context = JAXBContext.newInstance(Books.class);
Unmarshaller um = context.createUnmarshaller();
JAXBElement<?> jaxbEl = um.unmarshal(new StreamSource(is), Books.class);
+
JSONProvider<JAXBElement<?>> p = new JSONProvider<JAXBElement<?>>();
p.setIgnoreMixedContent(ignore);
ByteArrayOutputStream os = new ByteArrayOutputStream();
@@ -1368,6 +1375,11 @@ public class JSONProviderTest extends Assert {
@Test
public void testOutAppendElementsSameNs() throws Exception {
JSONProvider<TagVO2> provider = new JSONProvider<TagVO2>();
+
+ Map<String, String> namespaceMap = new HashMap<String, String>();
+ namespaceMap.put("http://tags", "ns2");
+ provider.setNamespaceMap(namespaceMap);
+
Map<String, String> map = new HashMap<String, String>();
map.put("{http://tags}thetag", "{http://tags}t");
provider.setOutAppendElements(map);
@@ -1382,6 +1394,11 @@ public class JSONProviderTest extends Assert {
@Test
public void testOutAppendElementsDiffNs() throws Exception {
JSONProvider<TagVO2> provider = new JSONProvider<TagVO2>();
+
+ Map<String, String> namespaceMap = new HashMap<String, String>();
+ namespaceMap.put("http://tags", "ns2");
+ provider.setNamespaceMap(namespaceMap);
+
Map<String, String> map = new HashMap<String, String>();
map.put("{http://tags}thetag", "{http://tagsvo2}t");
provider.setOutAppendElements(map);
@@ -1396,6 +1413,9 @@ public class JSONProviderTest extends Assert {
@Test
public void testOutElementsMapLocalNsToLocalNs() throws Exception {
JSONProvider<TagVO2> provider = new JSONProvider<TagVO2>();
+ Map<String, String> namespaceMap = new HashMap<String, String>();
+ namespaceMap.put("http://tags", "ns2");
+ provider.setNamespaceMap(namespaceMap);
Map<String, String> map = new HashMap<String, String>();
map.put("{http://tags}thetag", "{http://tagsvo2}t");
provider.setOutTransformElements(map);
@@ -1475,7 +1495,6 @@ public class JSONProviderTest extends Assert {
provider.writeTo(b, Base1.class, Base1.class,
new Annotation[0], MediaType.APPLICATION_JSON_TYPE,
new MetadataMap<String, Object>(), bos);
-
readBase(bos.toString());
}
[5/7] git commit: Moxy doesn't set the "type" properly,
do an instanceof
Posted by dk...@apache.org.
Moxy doesn't set the "type" properly, do an instanceof
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/589cfb13
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/589cfb13
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/589cfb13
Branch: refs/heads/master
Commit: 589cfb1388d22ca9df1a6f48e37aa20ca5bb50e3
Parents: 4348078
Author: Daniel Kulp <dk...@apache.org>
Authored: Thu Mar 27 01:13:07 2014 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Thu Mar 27 09:07:49 2014 -0400
----------------------------------------------------------------------
.../main/java/org/apache/cxf/sts/request/RequestParser.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/589cfb13/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
index 0ed2e51..c716d80 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
@@ -331,7 +331,8 @@ public class RequestParser {
byte[] x509 = null;
if (useKey.getAny() instanceof JAXBElement<?>) {
JAXBElement<?> useKeyJaxb = (JAXBElement<?>)useKey.getAny();
- if (KeyInfoType.class == useKeyJaxb.getDeclaredType()) {
+ Object obj = useKeyJaxb.getValue();
+ if (KeyInfoType.class == useKeyJaxb.getDeclaredType() || obj instanceof KeyInfoType) {
KeyInfoType keyInfoType = KeyInfoType.class.cast(useKeyJaxb.getValue());
LOG.fine("Found KeyInfo UseKey type");
for (Object keyInfoContent : keyInfoType.getContent()) {
@@ -348,7 +349,8 @@ public class RequestParser {
}
}
}
- } else if (SecurityTokenReferenceType.class == useKeyJaxb.getDeclaredType()) {
+ } else if (SecurityTokenReferenceType.class == useKeyJaxb.getDeclaredType()
+ || obj instanceof SecurityTokenReferenceType) {
SecurityTokenReferenceType strType =
SecurityTokenReferenceType.class.cast(useKeyJaxb.getValue());
Element token = fetchTokenElementFromReference(strType, wsContext);