JBossWS SVN: r7309 - maven/parent/trunk.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-06-04 04:53:33 -0400 (Wed, 04 Jun 2008)
New Revision: 7309
Modified:
maven/parent/trunk/pom.xml
Log:
version=1.0.0.GA
Modified: maven/parent/trunk/pom.xml
===================================================================
--- maven/parent/trunk/pom.xml 2008-06-04 08:28:37 UTC (rev 7308)
+++ maven/parent/trunk/pom.xml 2008-06-04 08:53:33 UTC (rev 7309)
@@ -7,7 +7,7 @@
<artifactId>jbossws-parent</artifactId>
<packaging>pom</packaging>
- <version>1.0-SNAPSHOT</version>
+ <version>1.0.0.GA</version>
<organization>
<name>JBoss, a division of Red Hat</name>
16 years, 7 months
JBossWS SVN: r7308 - framework/trunk/testsuite/test/java/org/jboss/test/ws/projectGenerator.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-06-04 04:28:37 -0400 (Wed, 04 Jun 2008)
New Revision: 7308
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/projectGenerator/ProjectGeneratorTestCase.java
Log:
increase scanner wait period
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/projectGenerator/ProjectGeneratorTestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/projectGenerator/ProjectGeneratorTestCase.java 2008-06-04 08:06:56 UTC (rev 7307)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/projectGenerator/ProjectGeneratorTestCase.java 2008-06-04 08:28:37 UTC (rev 7308)
@@ -91,8 +91,8 @@
try
{
assertStatusCode(executeCommand("ant -f " + projectBuild + " deploy"), "Error while compiling / deploying the user project!");
- //Sleeping 6 sec to let the deployment scanner pick up the user project jar
- Thread.sleep(6000);
+ //Sleeping 15 sec to let the deployment scanner pick up the user project jar
+ Thread.sleep(15000);
//Running the actual test
URL wsdlURL = new URL(endpointURL + "?wsdl");
QName serviceName = new QName(targetNS, "EndpointService");
16 years, 7 months
JBossWS SVN: r7307 - stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-06-04 04:06:56 -0400 (Wed, 04 Jun 2008)
New Revision: 7307
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java
Log:
optimization
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java 2008-06-04 08:05:30 UTC (rev 7306)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java 2008-06-04 08:06:56 UTC (rev 7307)
@@ -187,7 +187,7 @@
{
// check status code
int status = p.waitFor();
- if (p.exitValue() != 0)
+ if (status != 0)
{
System.out.println("Input stream");
printStream(p.getInputStream());
16 years, 7 months
JBossWS SVN: r7306 - stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-06-04 04:05:30 -0400 (Wed, 04 Jun 2008)
New Revision: 7306
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java
Log:
fix JDK_HOME + print both input and error streams when error is detected
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java 2008-06-04 08:03:46 UTC (rev 7305)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java 2008-06-04 08:05:30 UTC (rev 7306)
@@ -23,8 +23,11 @@
// $Id: JBWS771TestCase.java 3729 2007-06-26 19:38:00Z thomas.diesler(a)jboss.com $
+import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
import java.net.URL;
import java.util.List;
@@ -81,7 +84,7 @@
JBOSS_HOME = System.getProperty("jboss.home");
RESOURCES_DIR = createResourceFile(".").getPath();
- JDK_HOME = System.getProperty("java.home");
+ JDK_HOME = System.getProperty("java.home") + "/..";
OS = System.getProperty("os.name").toLowerCase();
}
@@ -155,7 +158,7 @@
Process p = executeCommand(command);
// check status code
- printStatusCode(p, "wsconsume");
+ checkStatusCode(p, "wsconsume");
File javaSource = getResourceFile("wsconsume/java/org/jboss/test/ws/jaxws/jbws771/JBWS771Service.java");
assertTrue("Service endpoint interface not generated", javaSource.exists());
@@ -180,10 +183,30 @@
return p;
}
- private void printStatusCode(Process p, String s) throws InterruptedException
+ private void checkStatusCode(Process p, String s) throws InterruptedException, IOException
{
// check status code
int status = p.waitFor();
- System.out.println(s + " did exit with status " + status);
+ if (p.exitValue() != 0)
+ {
+ System.out.println("Input stream");
+ printStream(p.getInputStream());
+ System.out.println("Error stream");
+ printStream(p.getErrorStream());
+ }
+ assertTrue(s + " did exit with status " + status, status == 0);
}
+
+ private void printStream(InputStream is) throws IOException
+ {
+ System.out.println();
+ BufferedReader in = new BufferedReader(new InputStreamReader(is));
+ StringBuffer buffer = new StringBuffer();
+ String line;
+ while ((line = in.readLine()) != null) {
+ buffer.append(line + "\n");
+ }
+ System.out.println(buffer.toString() + "\n");
+ System.out.println();
+ }
}
16 years, 7 months
JBossWS SVN: r7305 - framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-06-04 04:03:46 -0400 (Wed, 04 Jun 2008)
New Revision: 7305
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java
Log:
[JBWS-2013] Implement standard message context properties
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java 2008-06-04 07:11:48 UTC (rev 7304)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java 2008-06-04 08:03:46 UTC (rev 7305)
@@ -23,6 +23,7 @@
// $Id$
+import java.io.IOException;
import java.security.Principal;
import javax.annotation.Resource;
@@ -32,10 +33,16 @@
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
+import javax.xml.namespace.QName;
import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
import javax.xml.ws.handler.MessageContext;
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.common.DOMWriter;
import org.jboss.wsf.spi.annotation.WebContext;
+import org.w3c.dom.Element;
+import org.xml.sax.InputSource;
@WebService(name = "Endpoint", serviceName="EndpointService", targetNamespace = "http://org.jboss.ws/jaxws/context")
@SOAPBinding(style = Style.RPC)
@@ -54,8 +61,38 @@
@WebMethod
public String testGetMessageContext()
{
- MessageContext jaxwsContext = (MessageContext)wsCtx.getMessageContext();
- return jaxwsContext != null ? "pass" : "fail";
+ MessageContext msgContext = (MessageContext)wsCtx.getMessageContext();
+ if (msgContext == null)
+ return "fail";
+
+ QName service = (QName)msgContext.get(MessageContext.WSDL_SERVICE);
+ if (!service.equals(new QName("http://org.jboss.ws/jaxws/context", "EndpointService")))
+ throw new WebServiceException("Invalid qname: " + service);
+
+ QName portType = (QName)msgContext.get(MessageContext.WSDL_INTERFACE);
+ if (!portType.equals(new QName("http://org.jboss.ws/jaxws/context", "Endpoint")))
+ throw new WebServiceException("Invalid qname: " + portType);
+
+ QName port = (QName)msgContext.get(MessageContext.WSDL_PORT);
+ if (!port.equals(new QName("http://org.jboss.ws/jaxws/context", "EndpointPort")))
+ throw new WebServiceException("Invalid qname: " + port);
+
+ QName operation = (QName)msgContext.get(MessageContext.WSDL_OPERATION);
+ if (!operation.equals(new QName("http://org.jboss.ws/jaxws/context", "testGetMessageContext")))
+ throw new WebServiceException("Invalid qname: " + operation);
+
+ try
+ {
+ InputSource wsdlSource = (InputSource)msgContext.get(MessageContext.WSDL_DESCRIPTION);
+ Element root = DOMUtils.parse(wsdlSource);
+ new DOMWriter(System.out).setPrettyprint(true).print(root);
+ }
+ catch (IOException ex)
+ {
+ throw new WebServiceException("Cannot parse MessageContext.WSDL_DESCRIPTION", ex);
+ }
+
+ return "pass";
}
@WebMethod
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java 2008-06-04 07:11:48 UTC (rev 7304)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java 2008-06-04 08:03:46 UTC (rev 7305)
@@ -23,6 +23,7 @@
// $Id: $
+import java.io.IOException;
import java.security.Principal;
import javax.annotation.Resource;
@@ -30,9 +31,16 @@
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
+import javax.xml.namespace.QName;
import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
import javax.xml.ws.handler.MessageContext;
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.common.DOMWriter;
+import org.w3c.dom.Element;
+import org.xml.sax.InputSource;
+
@WebService(name = "Endpoint", serviceName = "EndpointService", targetNamespace = "http://org.jboss.ws/jaxws/context")
@SOAPBinding(style = Style.RPC)
public class EndpointJSE
@@ -43,8 +51,38 @@
@WebMethod
public String testGetMessageContext()
{
- MessageContext jaxwsContext = (MessageContext)wsCtx.getMessageContext();
- return jaxwsContext != null ? "pass" : "fail";
+ MessageContext msgContext = (MessageContext)wsCtx.getMessageContext();
+ if (msgContext == null)
+ return "fail";
+
+ QName service = (QName)msgContext.get(MessageContext.WSDL_SERVICE);
+ if (!service.equals(new QName("http://org.jboss.ws/jaxws/context", "EndpointService")))
+ throw new WebServiceException("Invalid qname: " + service);
+
+ QName portType = (QName)msgContext.get(MessageContext.WSDL_INTERFACE);
+ if (!portType.equals(new QName("http://org.jboss.ws/jaxws/context", "Endpoint")))
+ throw new WebServiceException("Invalid qname: " + portType);
+
+ QName port = (QName)msgContext.get(MessageContext.WSDL_PORT);
+ if (!port.equals(new QName("http://org.jboss.ws/jaxws/context", "EndpointPort")))
+ throw new WebServiceException("Invalid qname: " + port);
+
+ QName operation = (QName)msgContext.get(MessageContext.WSDL_OPERATION);
+ if (!operation.equals(new QName("http://org.jboss.ws/jaxws/context", "testGetMessageContext")))
+ throw new WebServiceException("Invalid qname: " + operation);
+
+ try
+ {
+ InputSource wsdlSource = (InputSource)msgContext.get(MessageContext.WSDL_DESCRIPTION);
+ Element root = DOMUtils.parse(wsdlSource);
+ new DOMWriter(System.out).setPrettyprint(true).print(root);
+ }
+ catch (IOException ex)
+ {
+ throw new WebServiceException("Cannot parse MessageContext.WSDL_DESCRIPTION", ex);
+ }
+
+ return "pass";
}
@WebMethod
16 years, 7 months
JBossWS SVN: r7304 - stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-06-04 03:11:48 -0400 (Wed, 04 Jun 2008)
New Revision: 7304
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java
Log:
fix hudson regression - just print status code
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java 2008-06-04 06:55:10 UTC (rev 7303)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java 2008-06-04 07:11:48 UTC (rev 7304)
@@ -155,7 +155,7 @@
Process p = executeCommand(command);
// check status code
- assertStatusCode(p, "wsconsume");
+ printStatusCode(p, "wsconsume");
File javaSource = getResourceFile("wsconsume/java/org/jboss/test/ws/jaxws/jbws771/JBWS771Service.java");
assertTrue("Service endpoint interface not generated", javaSource.exists());
@@ -180,10 +180,10 @@
return p;
}
- private void assertStatusCode(Process p, String s) throws InterruptedException
+ private void printStatusCode(Process p, String s) throws InterruptedException
{
// check status code
int status = p.waitFor();
- assertTrue(s + " did exit with status " + status, status == 0);
+ System.out.println(s + " did exit with status " + status);
}
}
16 years, 7 months
JBossWS SVN: r7303 - framework/trunk/hudson/jboss/bin.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-06-04 02:55:10 -0400 (Wed, 04 Jun 2008)
New Revision: 7303
Modified:
framework/trunk/hudson/jboss/bin/http-spider.sh
Log:
rollback previous commit (svn merge -r 7273:7272 .)
Modified: framework/trunk/hudson/jboss/bin/http-spider.sh
===================================================================
--- framework/trunk/hudson/jboss/bin/http-spider.sh 2008-06-04 05:52:45 UTC (rev 7302)
+++ framework/trunk/hudson/jboss/bin/http-spider.sh 2008-06-04 06:55:10 UTC (rev 7303)
@@ -14,9 +14,9 @@
#
#############################################################
-TIMEOUT=3 # wget timeout in sec
+TIMEOUT=2 # wget timeout in sec
SLEEP_TIME=10 # the actual sleep time in between test
-NUM_RETRIES=30 # equals 300 seconds before exit
+NUM_RETRIES=18 # equals 180 seconds before exit
if [ "x$1" = "x" ]; then
echo "Usage: http.sh <hostname:port> <output_dir>"
16 years, 7 months
JBossWS SVN: r7302 - stack/native/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-06-04 01:52:45 -0400 (Wed, 04 Jun 2008)
New Revision: 7302
Modified:
stack/native/trunk/modules/testsuite/test-excludes-jboss421.txt
Log:
[JBWS-2107] exclude test for AS 421
Modified: stack/native/trunk/modules/testsuite/test-excludes-jboss421.txt
===================================================================
--- stack/native/trunk/modules/testsuite/test-excludes-jboss421.txt 2008-06-04 05:51:36 UTC (rev 7301)
+++ stack/native/trunk/modules/testsuite/test-excludes-jboss421.txt 2008-06-04 05:52:45 UTC (rev 7302)
@@ -35,3 +35,8 @@
# [JBWS-2170] Fix embedded for maven build
org/jboss/test/ws/embedded/**
+
+# [JBWS-2107] Resolve dependency on @SecurityDomain
+org/jboss/test/ws/jaxws/samples/dar/AddressingClientTestCase.*
+org/jboss/test/ws/jaxws/samples/dar/ClientTestCase.*
+
16 years, 7 months
JBossWS SVN: r7301 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2008-06-04 01:51:36 -0400 (Wed, 04 Jun 2008)
New Revision: 7301
Modified:
stack/cxf/trunk/pom.xml
Log:
fix hudson regression - exclude JSR181 because it's not available
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2008-06-03 17:44:52 UTC (rev 7300)
+++ stack/cxf/trunk/pom.xml 2008-06-04 05:51:36 UTC (rev 7301)
@@ -242,6 +242,12 @@
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<version>${jaxws.api.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.jws</groupId>
+ <artifactId>jsr181</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>com.sun.xml.fastinfoset</groupId>
16 years, 7 months
JBossWS SVN: r7300 - in stack/cxf/trunk/modules/testsuite/cxf-tests: src/test/java/org/jboss/test/ws/jaxws/samples/wsse and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-06-03 13:44:52 -0400 (Tue, 03 Jun 2008)
New Revision: 7300
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServerUsernamePasswordCallback.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernamePasswordCallback.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernameTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/WEB-INF/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/WEB-INF/jbossws-cxf.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/WEB-INF/web.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/WEB-INF/wsdl/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/WEB-INF/wsdl/SecurityService.wsdl
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/WEB-INF/wsdl/SecurityService_schema1.xsd
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jaxws.xml
Log:
[JBWS-2098] Adding Username Token Profile test case
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jaxws.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jaxws.xml 2008-06-03 16:45:47 UTC (rev 7299)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jaxws.xml 2008-06-03 17:44:52 UTC (rev 7300)
@@ -103,6 +103,21 @@
<include name="alice.jks" />
</metainf>
</jar>
+
+ <!-- jaxws-samples-wsse-username -->
+ <war
+ warfile="${tests.output.dir}/test-libs/jaxws-samples-wsse-username.war"
+ webxml="${tests.output.dir}/test-resources/jaxws/samples/wsse/username/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/samples/wsse/Service*.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/wsse/jaxws/*.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/wsse/ServerUsernamePasswordCallback.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/username/WEB-INF">
+ <include name="jbossws-cxf.xml"/>
+ <include name="wsdl/*"/>
+ </webinf>
+ </war>
<!-- Please add alphabetically -->
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServerUsernamePasswordCallback.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServerUsernamePasswordCallback.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServerUsernamePasswordCallback.java 2008-06-03 17:44:52 UTC (rev 7300)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import org.apache.ws.security.WSPasswordCallback;
+
+public class ServerUsernamePasswordCallback implements CallbackHandler
+{
+ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
+ {
+ WSPasswordCallback pc = (WSPasswordCallback)callbacks[0];
+ if (!("kermit".equals(pc.getIdentifer()) && "thefrog".equals(pc.getPassword())))
+ throw new SecurityException("User '" + pc.getIdentifer() + "' with password '" + pc.getPassword() + "' not allowed.");
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServerUsernamePasswordCallback.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernamePasswordCallback.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernamePasswordCallback.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernamePasswordCallback.java 2008-06-03 17:44:52 UTC (rev 7300)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import org.apache.ws.security.WSPasswordCallback;
+
+public class UsernamePasswordCallback implements CallbackHandler
+{
+ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
+ {
+ WSPasswordCallback pc = (WSPasswordCallback)callbacks[0];
+ if ("kermit".equals(pc.getIdentifer()))
+ pc.setPassword("thefrog");
+ else
+ pc.setPassword("wrong password");
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernamePasswordCallback.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernameTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernameTestCase.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernameTestCase.java 2008-06-03 17:44:52 UTC (rev 7300)
@@ -0,0 +1,104 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.JBossWSTestSetup;
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor;
+import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
+import org.apache.cxf.binding.soap.saaj.SAAJInInterceptor;
+import org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor;
+
+/**
+ * WS-Security username test case
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 28-May-2008
+ */
+public final class UsernameTestCase extends JBossWSTest
+{
+ private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-username";
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(UsernameTestCase.class,"jaxws-samples-wsse-username.war");
+ }
+
+ public void test() throws Exception
+ {
+ QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecurity", "SecurityService");
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
+ setupWsse(proxy, "kermit");
+ assertEquals("Secure Hello World!", proxy.sayHello());
+ }
+
+ public void testWrongPassword() throws Exception
+ {
+ QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecurity", "SecurityService");
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
+ setupWsse(proxy, "snoopy");
+ try
+ {
+ proxy.sayHello();
+ fail("User snoopy shouldn't be authenticated.");
+ }
+ catch (Exception e)
+ {
+ //OK
+ }
+ }
+
+ private void setupWsse(ServiceIface proxy, String username)
+ {
+ Client client = ClientProxy.getClient(proxy);
+ Endpoint cxfEndpoint = client.getEndpoint();
+
+ Map<String,Object> outProps = new HashMap<String,Object>();
+ outProps.put("action", "UsernameToken");
+ outProps.put("user", username);
+ outProps.put("passwordType", "PasswordText");
+ outProps.put("passwordCallbackClass", "org.jboss.test.ws.jaxws.samples.wsse.UsernamePasswordCallback");
+ WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps); //request
+ cxfEndpoint.getOutInterceptors().add(wssOut);
+ cxfEndpoint.getOutInterceptors().add(new SAAJOutInterceptor());
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernameTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/WEB-INF/jbossws-cxf.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/WEB-INF/jbossws-cxf.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/WEB-INF/jbossws-cxf.xml 2008-06-03 17:44:52 UTC (rev 7300)
@@ -0,0 +1,34 @@
+<beans
+ xmlns='http://www.springframework.org/schema/beans'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:beans='http://www.springframework.org/schema/beans'
+ xmlns:jaxws='http://cxf.apache.org/jaxws'
+ xsi:schemaLocation='http://cxf.apache.org/core
+ http://cxf.apache.org/schemas/core.xsd
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+ http://cxf.apache.org/jaxws
+ http://cxf.apache.org/schemas/jaxws.xsd'>
+
+ <bean id="UsernameToken_Request" class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="UsernameToken"/>
+ <!-- <entry key="passwordType" value="PasswordDigest"/> -->
+ <entry key="passwordCallbackClass" value="org.jboss.test.ws.jaxws.samples.wsse.ServerUsernamePasswordCallback"/>
+ </map>
+ </constructor-arg>
+ </bean>
+
+ <jaxws:endpoint
+ id='ServiceImpl'
+ address='http://@jboss.bind.address@:8080/jaxws-samples-wsse-username'
+ implementor='org.jboss.test.ws.jaxws.samples.wsse.ServiceImpl'>
+ <jaxws:inInterceptors>
+ <ref bean="UsernameToken_Request"/>
+ <bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/>
+ </jaxws:inInterceptors>
+ </jaxws:endpoint>
+
+
+</beans>
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/WEB-INF/jbossws-cxf.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/WEB-INF/web.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/WEB-INF/web.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/WEB-INF/web.xml 2008-06-03 17:44:52 UTC (rev 7300)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app
+ version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+ <servlet>
+ <servlet-name>TestService</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.samples.wsse.ServiceImpl</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestService</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+</web-app>
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/WEB-INF/wsdl/SecurityService.wsdl
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/WEB-INF/wsdl/SecurityService.wsdl (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/WEB-INF/wsdl/SecurityService.wsdl 2008-06-03 17:44:52 UTC (rev 7300)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<definitions targetNamespace="http://www.jboss.org/jbossws/ws-extensions/wssecurity" name="SecurityService"
+ xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/wssecurity"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xsd:schema>
+ <xsd:import namespace="http://www.jboss.org/jbossws/ws-extensions/wssecurity" schemaLocation="SecurityService_schema1.xsd"/>
+ </xsd:schema>
+ </types>
+ <message name="sayHello">
+ <part name="parameters" element="tns:sayHello"/>
+ </message>
+ <message name="sayHelloResponse">
+ <part name="parameters" element="tns:sayHelloResponse"/>
+ </message>
+ <portType name="ServiceIface">
+ <operation name="sayHello">
+ <input message="tns:sayHello"/>
+ <output message="tns:sayHelloResponse"/>
+ </operation>
+ </portType>
+ <binding name="SecurityServicePortBinding" type="tns:ServiceIface">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="SecurityService">
+ <port name="SecurityServicePort" binding="tns:SecurityServicePortBinding">
+ <soap:address location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-username"/>
+ </port>
+ </service>
+</definitions>
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/WEB-INF/wsdl/SecurityService.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/WEB-INF/wsdl/SecurityService_schema1.xsd
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/WEB-INF/wsdl/SecurityService_schema1.xsd (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/WEB-INF/wsdl/SecurityService_schema1.xsd 2008-06-03 17:44:52 UTC (rev 7300)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/jbossws/ws-extensions/wssecurity" xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/wssecurity" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:element name="sayHello" type="tns:sayHello"/>
+
+ <xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/>
+
+ <xs:complexType name="sayHello">
+ <xs:sequence/>
+ </xs:complexType>
+
+ <xs:complexType name="sayHelloResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
+
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username/WEB-INF/wsdl/SecurityService_schema1.xsd
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
16 years, 7 months