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 2009/06/19 19:18:08 UTC
svn commit: r786588 - in /cxf/branches/2.2.x-fixes: ./
systests/src/test/java/org/apache/cxf/systest/ws/wssc/
systests/src/test/java/org/apache/cxf/systest/ws/wssec10/
systests/src/test/java/org/apache/cxf/systest/ws/wssec11/
Author: dkulp
Date: Fri Jun 19 17:18:08 2009
New Revision: 786588
URL: http://svn.apache.org/viewvc?rev=786588&view=rev
Log:
Merged revisions 786272 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r786272 | dkulp | 2009-06-18 17:04:15 -0400 (Thu, 18 Jun 2009) | 1 line
Update to not print stuff on the console
........
Modified:
cxf/branches/2.2.x-fixes/ (props changed)
cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCTest.java
cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10Test.java
cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java
Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun 19 17:18:08 2009
@@ -1 +1 @@
-/cxf/trunk:782728-782730,783097,783294,783396,784059,784181-784184,784893,784895,785279-785282,785468,785621,785624,785651,785734,785866,786142,786271,786514
+/cxf/trunk:782728-782730,783097,783294,783396,784059,784181-784184,784893,784895,785279-785282,785468,785621,785624,785651,785734,785866,786142,786271-786272,786514
Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Jun 19 17:18:08 2009
@@ -1 +1 @@
-/cxf/trunk:1-782619,782728-782730,783097,783294,783396,784059,784181-784184,784893-785866,785932,786142,786271,786514
+/cxf/trunk:1-782619,782728-782730,783097,783294,783396,784059,784181-784184,784893-785866,785932,786142,786271-786272,786514
Modified: cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCTest.java?rev=786588&r1=786587&r2=786588&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCTest.java Fri Jun 19 17:18:08 2009
@@ -20,8 +20,6 @@
package org.apache.cxf.systest.ws.wssc;
import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
@@ -42,7 +40,6 @@
import wssec.wssc.PingResponse;
import wssec.wssc.PingService;
-
/**
*
*/
@@ -66,7 +63,7 @@
}
@Test
- public void testClientServer() {
+ public void testClientServer() throws Exception {
if (!WSSecurity11Common.checkUnrestrictedPoliciesInstalled()) {
//do nothing
return;
@@ -104,67 +101,36 @@
new SpringBusFactory().createBus("org/apache/cxf/systest/ws/wssc/client/client.xml");
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
- List<String> results = new ArrayList<String>(argv.length);
URL wsdlLocation = null;
for (String portPrefix : argv) {
- try {
- PingService svc;
- wsdlLocation = new URL("http://localhost:9001/" + portPrefix + "?wsdl");
-
- svc = new PingService(wsdlLocation);
- final IPingService port =
- svc.getPort(
- new QName(
- "http://WSSec/wssc",
- portPrefix
- ),
- IPingService.class
- );
-
-
- if (portPrefix.charAt(0) == '_') {
- //MS would like the _ versions to send a cancel
- ((BindingProvider)port).getRequestContext()
- .put(SecurityConstants.STS_TOKEN_DO_CANCEL, Boolean.TRUE);
- }
- PingRequest params = new PingRequest();
- Ping ping = new Ping();
- ping.setOrigin("CXF");
- ping.setScenario("Scenario5");
- ping.setText("ping");
- params.setPing(ping);
- PingResponse output = port.ping(params);
- assertTrue("Expected OUT, " + OUT + ", not equal to received :"
- + output.getPingResponse().getText(),
- OUT.equals(output.getPingResponse().getText()));
- if (!OUT.equals(output.getPingResponse().getText())) {
- System.err.println(
- "Expected " + OUT + " but got " + output.getPingResponse().getText()
- );
- results.add("Unexpected output " + output.getPingResponse().getText());
-
- } else {
- System.out.println(portPrefix + ": OK!");
- results.add("OK!");
- }
- } catch (Throwable t) {
- t.printStackTrace();
- results.add("Exception: " + t);
- assertTrue("Unexpected exception thrown, t : " + t,
- t == null);
- }
- //blasting the MS endpoints tends to cause a hang
- //pause a sec to allow it to recover
- try {
- Thread.sleep(1000);
- System.gc();
- } catch (Exception e) {
- //not really a problem
+ PingService svc;
+ wsdlLocation = new URL("http://localhost:9001/" + portPrefix + "?wsdl");
+
+ svc = new PingService(wsdlLocation);
+ final IPingService port =
+ svc.getPort(
+ new QName(
+ "http://WSSec/wssc",
+ portPrefix
+ ),
+ IPingService.class
+ );
+
+
+ if (portPrefix.charAt(0) == '_') {
+ //MS would like the _ versions to send a cancel
+ ((BindingProvider)port).getRequestContext()
+ .put(SecurityConstants.STS_TOKEN_DO_CANCEL, Boolean.TRUE);
}
- }
- for (int x = 0; x < argv.length; x++) {
- System.out.println(argv[x] + ": " + results.get(x));
+ PingRequest params = new PingRequest();
+ Ping ping = new Ping();
+ ping.setOrigin("CXF");
+ ping.setScenario("Scenario5");
+ ping.setText("ping");
+ params.setPing(ping);
+ PingResponse output = port.ping(params);
+ assertEquals(OUT, output.getPingResponse().getText());
}
}
Modified: cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10Test.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10Test.java?rev=786588&r1=786587&r2=786588&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10Test.java (original)
+++ cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10Test.java Fri Jun 19 17:18:08 2009
@@ -22,8 +22,6 @@
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
import javax.xml.namespace.QName;
@@ -81,43 +79,22 @@
}
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
- List<String> results = new ArrayList<String>();
URL wsdlLocation = null;
for (String portPrefix : argv) {
- try {
- PingService svc = null;
- wsdlLocation = getWsdlLocation(portPrefix);
- svc = new PingService(wsdlLocation);
- final IPingService port =
- svc.getPort(
- new QName(
- "http://WSSec/wssec10",
- portPrefix + "_IPingService"
- ),
- IPingService.class
- );
-
- final String output = port.echo(INPUT);
- assertTrue("Input, " + INPUT + " not equal to Output " + output,
- INPUT.equals(output));
- 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);
- t.printStackTrace();
- assertTrue("Caught excetion: " + t,
- false);
- }
- }
- for (int x = 0; x < argv.length; x++) {
- System.out.println(argv[x] + ": " + results.get(x));
+ PingService svc = null;
+ wsdlLocation = getWsdlLocation(portPrefix);
+ svc = new PingService(wsdlLocation);
+ final IPingService port =
+ svc.getPort(
+ new QName(
+ "http://WSSec/wssec10",
+ portPrefix + "_IPingService"
+ ),
+ IPingService.class
+ );
+
+ final String output = port.echo(INPUT);
+ assertEquals(INPUT, output);
}
}
Modified: cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java?rev=786588&r1=786587&r2=786588&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java (original)
+++ cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java Fri Jun 19 17:18:08 2009
@@ -22,8 +22,6 @@
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
@@ -58,44 +56,22 @@
}
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
- List<String> results = new ArrayList<String>();
URL wsdlLocation = null;
for (String portPrefix : argv) {
- try {
- PingService11 svc = null;
- wsdlLocation = getWsdlLocation(portPrefix);
- svc = new PingService11(wsdlLocation);
- final IPingService port =
- svc.getPort(
- new QName(
- "http://WSSec/wssec11",
- portPrefix + "_IPingService"
- ),
- IPingService.class
- );
-
- final String output = port.echo(INPUT);
- assertTrue("INPUT, " + INPUT + " not equal to output, " + output,
- output.equals(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);
- t.printStackTrace();
- assertTrue("Unexpected exception thrown, t = " + t,
- t == null);
-
- }
- }
- for (int x = 0; x < argv.length; x++) {
- System.out.println(argv[x] + ": " + results.get(x));
+ PingService11 svc = null;
+ wsdlLocation = getWsdlLocation(portPrefix);
+ svc = new PingService11(wsdlLocation);
+ final IPingService port =
+ svc.getPort(
+ new QName(
+ "http://WSSec/wssec11",
+ portPrefix + "_IPingService"
+ ),
+ IPingService.class
+ );
+
+ final String output = port.echo(INPUT);
+ assertEquals(INPUT, output);
}
}