Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 25136 invoked from network); 18 Jun 2009 21:05:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Jun 2009 21:05:31 -0000 Received: (qmail 11976 invoked by uid 500); 18 Jun 2009 21:04:42 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 11389 invoked by uid 500); 18 Jun 2009 21:04:41 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 10784 invoked by uid 99); 18 Jun 2009 21:04:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jun 2009 21:04:39 +0000 X-ASF-Spam-Status: No, hits=-1998.5 required=10.0 tests=ALL_TRUSTED,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jun 2009 21:04:36 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5C0EC23888FD; Thu, 18 Jun 2009 21:04:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r786272 - in /cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws: wssc/WSSCTest.java wssec10/WSSecurity10Test.java wssec11/WSSecurity11Common.java Date: Thu, 18 Jun 2009 21:04:16 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090618210416.5C0EC23888FD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Thu Jun 18 21:04:15 2009 New Revision: 786272 URL: http://svn.apache.org/viewvc?rev=786272&view=rev Log: Update to not print stuff on the console Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCTest.java cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10Test.java cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCTest.java?rev=786272&r1=786271&r2=786272&view=diff ============================================================================== --- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCTest.java (original) +++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCTest.java Thu Jun 18 21:04:15 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 results = new ArrayList(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/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10Test.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10Test.java?rev=786272&r1=786271&r2=786272&view=diff ============================================================================== --- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10Test.java (original) +++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10Test.java Thu Jun 18 21:04:15 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 results = new ArrayList(); 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/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java?rev=786272&r1=786271&r2=786272&view=diff ============================================================================== --- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java (original) +++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java Thu Jun 18 21:04:15 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 results = new ArrayList(); 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); } }