Author: dkulp
Date: Mon Jul 30 20:01:29 2007
New Revision: 561224
URL: http://svn.apache.org/viewvc?view=rev&rev=561224
Log:
More fixes for cxf-790 security test from Fred
Support List<FooObject[]> in wrapped doc/lit
Removed:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/alice.pfx
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/certs.jks
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/logging.properties
Modified:
incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstService.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstServiceImpl.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/KeystorePasswordCallback.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/alice.jks
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/alice.properties
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/bob.jks
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/bob.properties
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/client.xml
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/server.xml
Modified:
incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java?view=diff&rev=561224&r1=561223&r2=561224
==============================================================================
---
incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
(original)
+++
incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
Mon Jul 30 20:01:29 2007
@@ -94,6 +94,17 @@
if (isFromWrapper) {
addType(clazz.getComponentType());
}
+ } else if (pt.getActualTypeArguments().length > 0
+ && pt.getActualTypeArguments()[0] instanceof
GenericArrayType) {
+ GenericArrayType gat =
(GenericArrayType)pt.getActualTypeArguments()[0];
+ gat.getGenericComponentType();
+ Class<? extends Object> arrayCls =
+ Array.newInstance((Class)
gat.getGenericComponentType(), 0).getClass();
+ clazz = Array.newInstance(arrayCls, 0).getClass();
+ part.setTypeClass(clazz);
+ if (isFromWrapper) {
+ addType(clazz.getComponentType());
+ }
}
}
if (isFromWrapper && isList) {
Modified:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java?view=diff&rev=561224&r1=561223&r2=561224
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
(original)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
Mon Jul 30 20:01:29 2007
@@ -248,6 +248,12 @@
assertEquals(2, foos.size());
assertEquals("a", foos.get(0).getName());
assertEquals("b", foos.get(1).getName());
+
+ List<Foo[]> foos2 = port.listObjectArrayOutput();
+ assertNotNull(foos2);
+ assertEquals(2, foos2.size());
+ assertEquals(2, foos2.get(0).length);
+ assertEquals(2, foos2.get(1).length);
}
@Test
public void testRpcLitNoWsdl() throws Exception {
@@ -360,7 +366,18 @@
assertEquals("d", d.value);
assertEquals("e", e.value);
assertEquals("f", f.value);
- assertEquals("g", g.value);
+ assertEquals("g", g.value);
+
+ List<org.apache.cxf.systest.jaxws.RpcLitCodeFirstService.Foo> foos =
port.listObjectOutput();
+ assertEquals(2, foos.size());
+ assertEquals("a", foos.get(0).getName());
+ assertEquals("b", foos.get(1).getName());
+
+ List<org.apache.cxf.systest.jaxws.RpcLitCodeFirstService.Foo[]> foos2
= port.listObjectArrayOutput();
+ assertNotNull(foos2);
+ assertEquals(2, foos2.size());
+ assertEquals(2, foos2.get(0).length);
+ assertEquals(2, foos2.get(1).length);
}
@Test
Modified:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java?view=diff&rev=561224&r1=561223&r2=561224
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
(original)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
Mon Jul 30 20:01:29 2007
@@ -33,6 +33,7 @@
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT,
use = SOAPBinding.Use.LITERAL)
public interface DocLitWrappedCodeFirstService {
+
@WebMethod
String[] arrayOutput();
@@ -68,7 +69,10 @@
@WebMethod
List<Foo> listObjectOutput();
-
+
+ @WebMethod
+ List<Foo[]> listObjectArrayOutput();
+
static class Foo {
String name;
Modified:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java?view=diff&rev=561224&r1=561223&r2=561224
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
(original)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
Mon Jul 30 20:01:29 2007
@@ -99,6 +99,19 @@
b.setName("b");
return Arrays.asList(a, b);
}
+
+ public List<Foo[]> listObjectArrayOutput() {
+ Foo a = new Foo();
+ a.setName("a");
+ Foo b = new Foo();
+ b.setName("b");
+ Foo c = new Foo();
+ a.setName("c");
+ Foo d = new Foo();
+ b.setName("d");
+
+ return Arrays.asList(new Foo[] {a, b}, new Foo[] {c, d});
+ }
}
Modified:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstService.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstService.java?view=diff&rev=561224&r1=561223&r2=561224
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstService.java
(original)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstService.java
Mon Jul 30 20:01:29 2007
@@ -27,6 +27,8 @@
import javax.jws.soap.SOAPBinding;
import javax.xml.ws.Holder;
+import org.apache.cxf.systest.jaxws.DocLitWrappedCodeFirstService.Foo;
+
@WebService(name = "RpcLitCodeFirstService",
targetNamespace =
"http://cxf.apache.org/systest/jaxws/RpcLitCodeFirstService")
@@ -82,5 +84,25 @@
Holder<String> f,
@WebParam(mode = WebParam.Mode.OUT)
Holder<String> g);
+
+ @WebMethod
+ List<Foo> listObjectOutput();
+
+ @WebMethod
+ List<Foo[]> listObjectArrayOutput();
+
+ static class Foo {
+ String name;
+
+ public Foo() {
+ }
+
+ public void setName(String n) {
+ name = n;
+ }
+ public String getName() {
+ return name;
+ }
+ }
}
Modified:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstServiceImpl.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstServiceImpl.java?view=diff&rev=561224&r1=561223&r2=561224
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstServiceImpl.java
(original)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstServiceImpl.java
Mon Jul 30 20:01:29 2007
@@ -25,6 +25,8 @@
import javax.jws.WebService;
import javax.xml.ws.Holder;
+import org.apache.cxf.systest.jaxws.DocLitWrappedCodeFirstService.Foo;
+
@WebService(endpointInterface =
"org.apache.cxf.systest.jaxws.RpcLitCodeFirstService",
serviceName = "RpcLitCodeFirstService",
portName = "RpcLitCodeFirstServicePort",
@@ -103,5 +105,26 @@
f.value = "f";
g.value = "g";
return ret;
+ }
+
+ public List<Foo> listObjectOutput() {
+ Foo a = new Foo();
+ a.setName("a");
+ Foo b = new Foo();
+ b.setName("b");
+ return Arrays.asList(a, b);
+ }
+
+ public List<Foo[]> listObjectArrayOutput() {
+ Foo a = new Foo();
+ a.setName("a");
+ Foo b = new Foo();
+ b.setName("b");
+ Foo c = new Foo();
+ a.setName("c");
+ Foo d = new Foo();
+ b.setName("d");
+
+ return Arrays.asList(new Foo[] {a, b}, new Foo[] {c, d});
}
}
Modified:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/KeystorePasswordCallback.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/KeystorePasswordCallback.java?view=diff&rev=561224&r1=561223&r2=561224
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/KeystorePasswordCallback.java
(original)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/KeystorePasswordCallback.java
Mon Jul 30 20:01:29 2007
@@ -37,10 +37,8 @@
new HashMap<String, String>();
public KeystorePasswordCallback() {
- passwords.put("Alice", "abcd!1234");
- passwords.put("alice", "abcd!1234");
- passwords.put("Bob", "abcd!1234");
- passwords.put("bob", "abcd!1234");
+ passwords.put("alice", "password");
+ passwords.put("bob", "password");
}
/**
Modified:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/alice.jks
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/alice.jks?view=diff&rev=561224&r1=561223&r2=561224
==============================================================================
Binary files - no diff available.
Modified:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/alice.properties
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/alice.properties?view=diff&rev=561224&r1=561223&r2=561224
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/alice.properties
(original)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/alice.properties
Mon Jul 30 20:01:29 2007
@@ -19,5 +19,5 @@
org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
org.apache.ws.security.crypto.merlin.keystore.type=jks
org.apache.ws.security.crypto.merlin.keystore.password=password
-org.apache.ws.security.crypto.merlin.keystore.alias=Alice
+org.apache.ws.security.crypto.merlin.keystore.alias=alice
org.apache.ws.security.crypto.merlin.file=src/test/java/org/apache/cxf/systest/ws/security/alice.jks
Modified:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/bob.jks
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/bob.jks?view=diff&rev=561224&r1=561223&r2=561224
==============================================================================
Binary files - no diff available.
Modified:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/bob.properties
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/bob.properties?view=diff&rev=561224&r1=561223&r2=561224
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/bob.properties
(original)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/bob.properties
Mon Jul 30 20:01:29 2007
@@ -19,5 +19,5 @@
org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
org.apache.ws.security.crypto.merlin.keystore.type=jks
org.apache.ws.security.crypto.merlin.keystore.password=password
-org.apache.ws.security.crypto.merlin.keystore.alias=Bob
+org.apache.ws.security.crypto.merlin.keystore.alias=bob
org.apache.ws.security.crypto.merlin.file=src/test/java/org/apache/cxf/systest/ws/security/bob.jks
Modified:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/client.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/client.xml?view=diff&rev=561224&r1=561223&r2=561224
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/client.xml
(original)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/client.xml
Mon Jul 30 20:01:29 2007
@@ -51,7 +51,7 @@
<map>
<entry key="action" value="Timestamp Signature Encrypt"/>
<!-- <entry key="action" value="Timestamp Signature"/> -->
- <entry key="user" value="Alice"/>
+ <entry key="user" value="alice"/>
<entry key="signaturePropFile"
value="org/apache/cxf/systest/ws/security/alice.properties"/>
<entry key="encryptionPropFile"
value="org/apache/cxf/systest/ws/security/bob.properties"/>
<entry key="encryptionUser" value="Bob"/>
Modified:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/server.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/server.xml?view=diff&rev=561224&r1=561223&r2=561224
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/server.xml
(original)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/server.xml
Mon Jul 30 20:01:29 2007
@@ -45,7 +45,7 @@
<constructor-arg>
<map>
<entry key="action" value="Timestamp Signature Encrypt"/>
- <entry key="user" value="Bob"/>
+ <entry key="user" value="bob"/>
<entry key="signaturePropFile"
value="org/apache/cxf/systest/ws/security/bob.properties"/>
<entry key="encryptionPropFile"
value="org/apache/cxf/systest/ws/security/alice.properties"/>
<entry key="encryptionUser" value="Alice"/>