cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r727831 - in /cxf/sandbox/interopfest: wssec10/src/main/java/interop/client/ wssec11/src/main/java/interop/client/ wstrust13/src/main/java/interop/client/ wstrust13/src/main/resources/etc/
Date Thu, 18 Dec 2008 21:28:10 GMT
Author: dkulp
Date: Thu Dec 18 13:28:09 2008
New Revision: 727831

URL: http://svn.apache.org/viewvc?rev=727831&view=rev
Log:
Update clients to run all their tests if no arg given.  (so I can test if I broke anything
easier)
Update to wss4j 1.5.5 apis


Modified:
    cxf/sandbox/interopfest/wssec10/src/main/java/interop/client/Client.java
    cxf/sandbox/interopfest/wssec10/src/main/java/interop/client/UTPasswordCallback.java
    cxf/sandbox/interopfest/wssec11/src/main/java/interop/client/Client.java
    cxf/sandbox/interopfest/wssec11/src/main/java/interop/client/KeystorePasswordCallback.java
    cxf/sandbox/interopfest/wssec11/src/main/java/interop/client/UTPasswordCallback.java
    cxf/sandbox/interopfest/wstrust13/src/main/java/interop/client/Client.java
    cxf/sandbox/interopfest/wstrust13/src/main/resources/etc/bob.properties
    cxf/sandbox/interopfest/wstrust13/src/main/resources/etc/client.xml

Modified: cxf/sandbox/interopfest/wssec10/src/main/java/interop/client/Client.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wssec10/src/main/java/interop/client/Client.java?rev=727831&r1=727830&r2=727831&view=diff
==============================================================================
--- cxf/sandbox/interopfest/wssec10/src/main/java/interop/client/Client.java (original)
+++ cxf/sandbox/interopfest/wssec10/src/main/java/interop/client/Client.java Thu Dec 18 13:28:09
2008
@@ -23,6 +23,9 @@
 
 package interop.client;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import javax.xml.namespace.QName;
 import javax.xml.ws.BindingProvider;
 
@@ -47,42 +50,50 @@
     public static void main(String argv[])
         throws Exception {
         if (argv.length < 1) {
-            System.err.println(
-                "SYNTAX: java Client <port-prefix>"
-            );
-           //argv = new String[] {"UserNameOverTransport"};
-           argv = new String[] {"MutualCertificate10SignEncryptRsa15TripleDes"};
+           argv = new String[] {
+                                "UserNameOverTransport",
+                                "MutualCertificate10SignEncryptRsa15TripleDes"
+                                };
         }
 
         new SpringBusFactory().createBus("etc/client.xml");
         
-        
-        final String portPrefix = argv[0];
-
-        final PingService10 svc = new PingService10();
-        final IPingService port = 
-            svc.getPort(
-                new QName(
-                    "http://InteropBaseAddress/interop",
-                    portPrefix + "_IPingService"
-                ),
-                IPingService.class
-            );
-        
-        /*
-        ((BindingProvider)port)
-            .getRequestContext()
-                .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
-                     "http://localhost:9000/MutualCertificate10SignEncryptRsa15TripleDes");
-        */
-        
-        final String output = port.echo(INPUT);
-        if (!INPUT.equals(output)) {
-            System.err.println(
-                "Expected " + INPUT + " but got " + output
-            );
-        } else {
-            System.out.println("OK!");
+        List<String> results = new ArrayList<String>();
+        for (String portPrefix : argv) {
+            try {
+                final PingService10 svc = new PingService10();
+                final IPingService port = 
+                    svc.getPort(
+                        new QName(
+                            "http://InteropBaseAddress/interop",
+                            portPrefix + "_IPingService"
+                        ),
+                        IPingService.class
+                    );
+                
+                /*
+                ((BindingProvider)port)
+                    .getRequestContext()
+                        .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
+                             "http://localhost:9000/MutualCertificate10SignEncryptRsa15TripleDes");
+                */
+                
+                final String output = port.echo(INPUT);
+                if (!INPUT.equals(output)) {
+                    System.err.println(
+                        "Expected " + INPUT + " but got " + output
+                    );
+                    results.add("Expected " + INPUT + " but got " + output);
+                } else {
+                    System.out.println("OK!");
+                    results.add("OK");
+                }
+            } catch (Throwable t) {
+                results.add("Exception: " + t);
+            }
+        }
+        for (int x = 0; x < argv.length; x++) {
+            System.out.println(argv[x] + ": " + results.get(x));
         }
     }
 

Modified: cxf/sandbox/interopfest/wssec10/src/main/java/interop/client/UTPasswordCallback.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wssec10/src/main/java/interop/client/UTPasswordCallback.java?rev=727831&r1=727830&r2=727831&view=diff
==============================================================================
--- cxf/sandbox/interopfest/wssec10/src/main/java/interop/client/UTPasswordCallback.java (original)
+++ cxf/sandbox/interopfest/wssec10/src/main/java/interop/client/UTPasswordCallback.java Thu
Dec 18 13:28:09 2008
@@ -36,7 +36,7 @@
         for (int i = 0; i < callbacks.length; i++) {
             WSPasswordCallback pc = (WSPasswordCallback)callbacks[i];
 
-            String pass = passwords.get(pc.getIdentifer());
+            String pass = passwords.get(pc.getIdentifier());
             if (pass != null) {
                 pc.setPassword(pass);
                 return;

Modified: cxf/sandbox/interopfest/wssec11/src/main/java/interop/client/Client.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wssec11/src/main/java/interop/client/Client.java?rev=727831&r1=727830&r2=727831&view=diff
==============================================================================
--- cxf/sandbox/interopfest/wssec11/src/main/java/interop/client/Client.java (original)
+++ cxf/sandbox/interopfest/wssec11/src/main/java/interop/client/Client.java Thu Dec 18 13:28:09
2008
@@ -23,6 +23,9 @@
 
 package interop.client;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import javax.xml.namespace.QName;
 import javax.xml.ws.BindingProvider;
 
@@ -49,58 +52,64 @@
     public static void main(String argv[])
         throws Exception {
         if (argv.length < 1) {
-            System.err.println(
-                "SYNTAX: java Client <port-prefix>"
-            );
-            //argv = new String[] {"A"};
-            //argv = new String[] {"A-NoTimestamp"};
-            argv = new String[] {"AD"};
-            //argv = new String[] {"A-ES"};
-            //argv = new String[] {"AD-ES"};
-            //argv = new String[] {"UX"}; //NOT WORKING YET
-            //argv = new String[] {"UX-NoTimestamp"}; //NOT WORKING YET
-            //argv = new String[] {"UXD"}; //NOT WORKING YET
-            //argv = new String[] {"UX-SEES"}; //NOT WORKING YET
-            //argv = new String[] {"UXD-SEES"}; //NOT WORKING YET 
-            //argv = new String[] {"X"};
-            //argv = new String[] {"X-NoTimestamp"};
-            //argv = new String[] {"X-AES128"};
-            //argv = new String[] {"X-AES192"};
-            //argv = new String[] {"X-TripleDES"};
-            //argv = new String[] {"XD"};
-            //argv = new String[] {"XD-ES"};
-            //argv = new String[] {"XD-SEES"};
+            argv = new String[] {"A",
+                                 "A-NoTimestamp",
+                                 "AD",
+                                 "A-ES",
+                                 "AD-ES",
+                                 //"UX", //NOT WORKING YET
+                                 //"UX-NoTimestamp", //NOT WORKING YET
+                                 //"UXD", //NOT WORKING YET
+                                 //"UX-SEES", //NOT WORKING YET
+                                 //"UXD-SEES", //NOT WORKING YET 
+                                 "X",
+                                 "X-NoTimestamp",
+                                 "X-AES128",
+                                 "X-AES192",
+                                 "X-TripleDES",
+                                 "XD",
+                                 "XD-ES",
+                                 "XD-SEES",
+            };
         }
 
         new SpringBusFactory().createBus("etc/client.xml");
-        
-        
-        final String portPrefix = argv[0];
-
-        final PingService11 svc = new PingService11();
-        final IPingService port = 
-            svc.getPort(
-                new QName(
-                    "http://InteropBaseAddress/interop",
-                    portPrefix + "_IPingService"
-                ),
-                IPingService.class
-            );
-        
-        /*
-        ((BindingProvider)port)
-            .getRequestContext()
-                .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
-                     "http://localhost:9001/" + portPrefix + "PingService");
-        */
-        
-        final String output = port.echo(INPUT);
-        if (!INPUT.equals(output)) {
-            System.err.println(
-                "Expected " + INPUT + " but got " + output
-            );
-        } else {
-            System.out.println("OK!");
+        List<String> results = new ArrayList<String>();
+        for (String portPrefix : argv) {
+            try {
+                final PingService11 svc = new PingService11();
+                final IPingService port = 
+                    svc.getPort(
+                        new QName(
+                            "http://InteropBaseAddress/interop",
+                            portPrefix + "_IPingService"
+                        ),
+                        IPingService.class
+                    );
+                
+                /*
+                ((BindingProvider)port)
+                    .getRequestContext()
+                        .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
+                             "http://localhost:9001/" + portPrefix + "PingService");
+                */
+                
+                final String output = port.echo(INPUT);
+                if (!INPUT.equals(output)) {
+                    System.err.println(
+                        "Expected " + INPUT + " but got " + output
+                    );
+                    results.add("Expected " + INPUT + " but got " + output);
+                } else {
+                    System.out.println("OK!");
+                    results.add("OK");
+                }
+            } catch (Throwable t) {
+                results.add("Exception: " + t);
+            }
+        }
+        for (int x = 0; x < argv.length; x++) {
+            System.out.println(argv[x] + ": " + results.get(x));
         }
     }
 

Modified: cxf/sandbox/interopfest/wssec11/src/main/java/interop/client/KeystorePasswordCallback.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wssec11/src/main/java/interop/client/KeystorePasswordCallback.java?rev=727831&r1=727830&r2=727831&view=diff
==============================================================================
--- cxf/sandbox/interopfest/wssec11/src/main/java/interop/client/KeystorePasswordCallback.java
(original)
+++ cxf/sandbox/interopfest/wssec11/src/main/java/interop/client/KeystorePasswordCallback.java
Thu Dec 18 13:28:09 2008
@@ -37,7 +37,7 @@
         for (int i = 0; i < callbacks.length; i++) {
             WSPasswordCallback pc = (WSPasswordCallback)callbacks[i];
 
-            String pass = passwords.get(pc.getIdentifer());
+            String pass = passwords.get(pc.getIdentifier());
             if (pass != null) {
                 pc.setPassword(pass);
                 return;

Modified: cxf/sandbox/interopfest/wssec11/src/main/java/interop/client/UTPasswordCallback.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wssec11/src/main/java/interop/client/UTPasswordCallback.java?rev=727831&r1=727830&r2=727831&view=diff
==============================================================================
--- cxf/sandbox/interopfest/wssec11/src/main/java/interop/client/UTPasswordCallback.java (original)
+++ cxf/sandbox/interopfest/wssec11/src/main/java/interop/client/UTPasswordCallback.java Thu
Dec 18 13:28:09 2008
@@ -36,7 +36,7 @@
         for (int i = 0; i < callbacks.length; i++) {
             WSPasswordCallback pc = (WSPasswordCallback)callbacks[i];
 
-            String pass = passwords.get(pc.getIdentifer());
+            String pass = passwords.get(pc.getIdentifier());
             if (pass != null) {
                 pc.setPassword(pass);
                 return;

Modified: cxf/sandbox/interopfest/wstrust13/src/main/java/interop/client/Client.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wstrust13/src/main/java/interop/client/Client.java?rev=727831&r1=727830&r2=727831&view=diff
==============================================================================
--- cxf/sandbox/interopfest/wstrust13/src/main/java/interop/client/Client.java (original)
+++ cxf/sandbox/interopfest/wstrust13/src/main/java/interop/client/Client.java Thu Dec 18
13:28:09 2008
@@ -23,6 +23,9 @@
 
 package interop.client;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import javax.xml.namespace.QName;
 import javax.xml.ws.BindingProvider;
 
@@ -66,61 +69,71 @@
      */
     public static void main(String argv[])
         throws Exception {
-        if (argv.length < 2) {
-            //argv = new String[] {"CustomBinding_IPingServiceContract"};
-            //argv = new String[] {"OasisScenario2Binding_IPingServiceContract"};  //NOT_WORKING
-            //argv = new String[] {"CustomBinding_IPingServiceContract1"};
-            argv = new String[] {"OasisScenario4Binding_IPingServiceContract"};
+        if (argv.length < 1) {
+            argv = new String[] {
+                                 "CustomBinding_IPingServiceContract",
+                                 //"OasisScenario2Binding_IPingServiceContract",  //NOT_WORKING
+                                 "CustomBinding_IPingServiceContract1",
+                                 "OasisScenario4Binding_IPingServiceContract",
+                                };
         }
 
         Bus b = new SpringBusFactory().createBus("etc/client.xml");
+        List<String> results = new ArrayList<String>(argv.length);
         
+        for (String portPrefix : argv) {
+            try {
+                final PingService svc = new PingService();
+                final IPingServiceContract port = 
+                    svc.getPort(
+                        new QName(
+                            "http://tempuri.org/",
+                            portPrefix
+                        ),
+                        IPingServiceContract.class
+                    );
+                
+                STSClient stsClient = new STSClient(b);
+                stsClient.setBeanName(portPrefix);
+                
+                //TODO: get the Trust10 token out of the port
+                PolicyEngine pe = b.getExtension(PolicyEngine.class);
+                org.apache.cxf.endpoint.Client client = ClientProxy.getClient(port);
+                for (PolicyAssertion as : pe.getClientEndpointPolicy(client.getEndpoint().getEndpointInfo(),

+                                                      client.getConduit()).getChosenAlternative())
{
+                    if (as instanceof Trust10) {
+                        stsClient.setTrust((Trust10)as);
+                    } else if (as instanceof Trust13) {
+                        stsClient.setTrust((Trust13)as);
+                    } else if (as instanceof SupportingToken) {
+                        Token t2 = ((SupportingToken)as).getToken();
+                        if (t2 instanceof IssuedToken) {
+                            IssuedToken token = (IssuedToken)t2;
+                            stsClient.setTemplate(token.getRstTemplate());
+                        }
+                    }
+                }
+                
+                SecurityToken responseToken = stsClient.requestSecurityToken();
         
-        final String portPrefix = argv[0];
-
-        final PingService svc = new PingService();
-        final IPingServiceContract port = 
-            svc.getPort(
-                new QName(
-                    "http://tempuri.org/",
-                    portPrefix
-                ),
-                IPingServiceContract.class
-            );
-        
-        STSClient stsClient = new STSClient(b);
-        stsClient.setBeanName(argv[0]);
-        
-        //TODO: get the Trust10 token out of the port
-        PolicyEngine pe = b.getExtension(PolicyEngine.class);
-        org.apache.cxf.endpoint.Client client = ClientProxy.getClient(port);
-        for (PolicyAssertion as : pe.getClientEndpointPolicy(client.getEndpoint().getEndpointInfo(),

-                                              client.getConduit()).getChosenAlternative())
{
-            if (as instanceof Trust10) {
-                stsClient.setTrust((Trust10)as);
-            } else if (as instanceof Trust13) {
-                stsClient.setTrust((Trust13)as);
-            } else if (as instanceof SupportingToken) {
-                Token t2 = ((SupportingToken)as).getToken();
-                if (t2 instanceof IssuedToken) {
-                    IssuedToken token = (IssuedToken)t2;
-                    stsClient.setTemplate(token.getRstTemplate());
+                ((BindingProvider)port).getRequestContext().put(SecurityConstants.TRUST_TOKEN,
responseToken);
+            
+                final String output = port.ping(INPUT);
+                if (!INPUT.equals(output)) {
+                    System.err.println(
+                        "Expected " + INPUT + " but got " + output
+                    );
+                    results.add("Unexpected output " + output);
+                } else {
+                    System.out.println("OK!");
+                    results.add("OK!");
                 }
+            } catch (Throwable t) {
+                results.add("Exception: " + t);
             }
         }
-        
-        SecurityToken responseToken = stsClient.requestSecurityToken();
-
-        //TODO: stick security token into the RequestContext/TokenStore
-        ((BindingProvider)port).getRequestContext().put(SecurityConstants.TRUST_TOKEN, responseToken);
-        
-        final String output = port.ping(INPUT);
-        if (!INPUT.equals(output)) {
-            System.err.println(
-                "Expected " + INPUT + " but got " + output
-            );
-        } else {
-            System.out.println("OK!");
+        for (int x = 0; x < argv.length; x++) {
+            System.out.println(argv[x] + ": " + results.get(x));
         }
     }
 

Modified: cxf/sandbox/interopfest/wstrust13/src/main/resources/etc/bob.properties
URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wstrust13/src/main/resources/etc/bob.properties?rev=727831&r1=727830&r2=727831&view=diff
==============================================================================
--- cxf/sandbox/interopfest/wstrust13/src/main/resources/etc/bob.properties (original)
+++ cxf/sandbox/interopfest/wstrust13/src/main/resources/etc/bob.properties Thu Dec 18 13:28:09
2008
@@ -4,5 +4,3 @@
 # for some reason, bouncycastle has issues with bob.pfx
 org.apache.ws.security.crypto.merlin.keystore.provider=SunJSSE
 org.apache.ws.security.crypto.merlin.file=certs/bob.pfx
-#org.apache.ws.security.crypto.merlin.file=certs/bob.pfx
-org.apache.ws.security.crypto.merlin.file=certs/WssIP.pfx

Modified: cxf/sandbox/interopfest/wstrust13/src/main/resources/etc/client.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wstrust13/src/main/resources/etc/client.xml?rev=727831&r1=727830&r2=727831&view=diff
==============================================================================
--- cxf/sandbox/interopfest/wstrust13/src/main/resources/etc/client.xml (original)
+++ cxf/sandbox/interopfest/wstrust13/src/main/resources/etc/client.xml Thu Dec 18 13:28:09
2008
@@ -113,5 +113,6 @@
                 <sec:keyStore type="pkcs12" password="password" resource="certs/WssIP.pfx"/>
             </sec:trustManagers>
         </http:tlsClientParameters>
+        <http:client Connection="close" AllowChunking="false"/>
     </http:conduit>
 </beans>



Mime
View raw message