JBossWS SVN: r15910 - shared-testsuite/trunk/src/main/java/org/jboss/wsf/test.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-03-12 05:24:04 -0400 (Mon, 12 Mar 2012)
New Revision: 15910
Modified:
shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestSetup.java
Log:
Only create securityDomains map for tests requiring security domain deployment
Modified: shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestSetup.java
===================================================================
--- shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestSetup.java 2012-03-12 09:22:42 UTC (rev 15909)
+++ shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestSetup.java 2012-03-12 09:24:04 UTC (rev 15910)
@@ -60,7 +60,7 @@
private OutputStream appclientOutputStream;
private String appclientArg;
private ClassLoader originalClassLoader;
- private Map<String, Map<String, String>> securityDomains = new HashMap<String, Map<String,String>>();
+ private Map<String, Map<String, String>> securityDomains;
private boolean defaultSecurityDomainRequirement = false;
public JBossWSTestSetup(Class<?> testClass, String archiveList)
@@ -137,7 +137,7 @@
String integrationTarget = JBossWSTestHelper.getIntegrationTarget();
log.debug("Integration target: " + integrationTarget);
- if (!securityDomains.isEmpty())
+ if (securityDomains != null && !securityDomains.isEmpty())
{
for (String key : securityDomains.keySet())
{
@@ -249,7 +249,7 @@
{
Thread.currentThread().setContextClassLoader(originalClassLoader);
- if (!securityDomains.isEmpty())
+ if (securityDomains != null && !securityDomains.isEmpty())
{
for (String key : securityDomains.keySet())
{
@@ -275,6 +275,9 @@
public void addSecurityDomainRequirement(String securityDomainName, Map<String, String> authenticationOptions)
{
+ if (securityDomains == null) {
+ securityDomains = new HashMap<String, Map<String,String>>();
+ }
securityDomains.put(securityDomainName, authenticationOptions);
}
14 years, 1 month
JBossWS SVN: r15909 - shared-testsuite/trunk/src/main/java/org/jboss/wsf/test.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-03-12 05:22:42 -0400 (Mon, 12 Mar 2012)
New Revision: 15909
Modified:
shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
Log:
[JBWS-3435] Use thread pool for running appclients copy jobs; properly terminate/kill additional threads at undeploy time (instead of next appclient deploy); allow execution of different appclient tests at the same time
Modified: shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
===================================================================
--- shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java 2012-03-09 08:58:00 UTC (rev 15908)
+++ shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java 2012-03-12 09:22:42 UTC (rev 15909)
@@ -30,9 +30,12 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.net.UnknownHostException;
+import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
import javax.management.MBeanServerConnection;
import javax.management.remote.JMXConnectorFactory;
@@ -81,11 +84,16 @@
private static String implVersion;
private static String testArchiveDir;
private static String testResourcesDir;
- private static Process appclientProcess;
- private static OutputStream appclientOutput;
- private static CopyJob appclientOutTask;
- private static CopyJob appclientErrTask;
+ private static Map<String, AppclientProcess> appclients = new HashMap<String, JBossWSTestHelper.AppclientProcess>();
+ private static ExecutorService es = Executors.newCachedThreadPool();
+ private static class AppclientProcess {
+ public Process process;
+ public CopyJob outTask;
+ public CopyJob errTask;
+ public OutputStream output;
+ }
+
private static synchronized Deployer getDeployer()
{
//lazy loading of deployer
@@ -132,10 +140,11 @@
final String appclientName = archive.substring(sharpIndex + 1);
final String appclientFullName = getArchiveFile(earName).getParent() + FS + archive;
final String touchFile = JBOSS_HOME + FS + "bin" + FS + appclientName + ".kill";
- appclientOutput = new ByteArrayOutputStream();
+ AppclientProcess ap = new AppclientProcess();
+ ap.output = new ByteArrayOutputStream();
if (appclientOS == null)
{
- appclientProcess = new ProcessBuilder().command(appclientScript, appclientFullName, touchFile).start();
+ ap.process = new ProcessBuilder().command(appclientScript, appclientFullName, touchFile).start();
}
else
{
@@ -147,30 +156,26 @@
{
args.add(appclientArg);
}
- appclientProcess = new ProcessBuilder().command(args).start();
+ ap.process = new ProcessBuilder().command(args).start();
}
// appclient out
- if (appclientOutTask != null) {
- appclientOutTask.kill();
- }
- appclientOutTask = new CopyJob(appclientProcess.getInputStream(),
- appclientOS == null ? new TeeOutputStream(appclientOutput, System.out) : new TeeOutputStream(appclientOutput, System.out, appclientOS));
+ ap.outTask = new CopyJob(ap.process.getInputStream(),
+ appclientOS == null ? new TeeOutputStream(ap.output, System.out) : new TeeOutputStream(ap.output, System.out, appclientOS));
// appclient err
- if (appclientErrTask != null) {
- appclientErrTask.kill();
- }
- appclientErrTask = new CopyJob(appclientProcess.getErrorStream(), System.err);
+ ap.errTask = new CopyJob(ap.process.getErrorStream(), System.err);
// unfortunately the following threads are needed because of Windows behavior
- new Thread(appclientOutTask).start();
- new Thread(appclientErrTask).start();
+ es.submit(ap.outTask);
+ es.submit(ap.errTask);
final String patternToMatch = "Deployed \"" + earName + "\"";
final String errorMessage = "Cannot deploy " + appclientFullName + " to appclient";
- awaitOutput(patternToMatch, errorMessage);
+ awaitOutput(ap.output, patternToMatch, errorMessage);
System.out.println("-----------------");
System.out.println("appclient started");
System.out.println("-----------------");
+ appclients.put(archive, ap);
+ return ap.process;
}
- return appclientProcess;
+ return null;
}
/** Undeploy the given archive from the appclient
@@ -180,6 +185,7 @@
{
if (DEPLOY_PROCESS_ENABLED)
{
+ AppclientProcess ap = appclients.get(archive);
final int sharpIndex = archive.indexOf('#');
final String earName = archive.substring(0, sharpIndex);
final String appclientFullName = getArchiveFile(earName).getParent() + FS + archive;
@@ -189,22 +195,26 @@
final String errorMessage = "Cannot undeploy " + appclientFullName + " from appclient";
try
{
- awaitOutput(patternToMatch, errorMessage);
+ awaitOutput(ap.output, patternToMatch, errorMessage);
}
finally
{
touchFile.delete();
+ ap.outTask.kill();
+ ap.errTask.kill();
+ ap.process.destroy();
+ appclients.remove(archive);
}
System.out.println("-----------------");
System.out.println("appclient stopped");
System.out.println("-----------------");
}
}
-
- private static void awaitOutput(final String patternToMatch, final String errorMessage) throws InterruptedException {
+
+ private static void awaitOutput(final OutputStream os, final String patternToMatch, final String errorMessage) throws InterruptedException {
int countOfAttempts = 0;
final int maxCountOfAttempts = 120; // max wait time: 2 minutes
- while (!appclientOutput.toString().contains(patternToMatch))
+ while (!os.toString().contains(patternToMatch))
{
Thread.sleep(1000);
if (countOfAttempts++ == maxCountOfAttempts)
14 years, 1 month
JBossWS SVN: r15908 - stack/native/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-03-09 03:58:00 -0500 (Fri, 09 Mar 2012)
New Revision: 15908
Modified:
stack/native/trunk/modules/testsuite/pom.xml
Log:
[JBWS-3435] Move to jboss remote naming 1.0.2.Final
Modified: stack/native/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/native/trunk/modules/testsuite/pom.xml 2012-03-09 07:39:41 UTC (rev 15907)
+++ stack/native/trunk/modules/testsuite/pom.xml 2012-03-09 08:58:00 UTC (rev 15908)
@@ -1065,7 +1065,7 @@
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-remote-naming</artifactId>
- <version>1.0.1.Final</version>
+ <version>1.0.2.Final</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
14 years, 1 month
JBossWS SVN: r15907 - stack/cxf/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-03-09 02:39:41 -0500 (Fri, 09 Mar 2012)
New Revision: 15907
Modified:
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[JBWS-3435] Move to jboss remote naming 1.0.2.Final
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2012-03-09 06:59:21 UTC (rev 15906)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2012-03-09 07:39:41 UTC (rev 15907)
@@ -1170,7 +1170,7 @@
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-remote-naming</artifactId>
- <version>1.0.1.Final</version>
+ <version>1.0.2.Final</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
14 years, 1 month
JBossWS SVN: r15906 - shared-testsuite/trunk/testsuite/src/test/ant-import.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-03-09 01:59:21 -0500 (Fri, 09 Mar 2012)
New Revision: 15906
Modified:
shared-testsuite/trunk/testsuite/src/test/ant-import/build-testsuite.xml
Log:
[JBWS-3454] Fixing syntax error
Modified: shared-testsuite/trunk/testsuite/src/test/ant-import/build-testsuite.xml
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/ant-import/build-testsuite.xml 2012-03-08 16:53:27 UTC (rev 15905)
+++ shared-testsuite/trunk/testsuite/src/test/ant-import/build-testsuite.xml 2012-03-09 06:59:21 UTC (rev 15906)
@@ -596,7 +596,7 @@
<sysproperty key="test.classes.directory" value="${tests.output.dir}/test-classes"/>
<sysproperty key="test.resources.directory" value="${tests.output.dir}/test-resources"/>
<sysproperty key="test.username" value="${test.username}"/>
- <sysproperty key="test.password" value="${test.password"/>
+ <sysproperty key="test.password" value="${test.password}"/>
<sysproperty key="binary.distribution" value="true"/>
<classpath>
<path refid="tests.client.classpath"/>
14 years, 1 month
JBossWS SVN: r15905 - hudson/trunk/scripts.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-03-08 11:53:27 -0500 (Thu, 08 Mar 2012)
New Revision: 15905
Modified:
hudson/trunk/scripts/jbossws-qa.sh
Log:
[JBWS-3454] Overwrite test application-*.properties as part of hudson jobs
Modified: hudson/trunk/scripts/jbossws-qa.sh
===================================================================
--- hudson/trunk/scripts/jbossws-qa.sh 2012-03-08 16:52:38 UTC (rev 15904)
+++ hudson/trunk/scripts/jbossws-qa.sh 2012-03-08 16:53:27 UTC (rev 15905)
@@ -11,6 +11,8 @@
rm -rf $WORKSPACE/jboss-as
cp -r $JBOSS_INSTANCE $WORKSPACE/jboss-as
export JBOSS_HOME=$WORKSPACE/jboss-as
+ echo "Overwriting default application-users.properties / application-roles.properties on AS..."
+ cp $STACK_DIR/etc/application-*.properties $JBOSS_HOME/standalone/configuration
# HACK if running cxf on AS71x, first install/update native
if [ "$STACK_ID" = "cxf" ] && [[ $JBOSS_TARGET == jboss71* ]]; then
echo "cxf stack with AS 71x, first installing native..."
14 years, 1 month
JBossWS SVN: r15904 - in stack/native/trunk: etc and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-03-08 11:52:38 -0500 (Thu, 08 Mar 2012)
New Revision: 15904
Added:
stack/native/trunk/etc/
stack/native/trunk/etc/application-roles.properties
stack/native/trunk/etc/application-users.properties
Log:
[JBWS-3454] Adding test user properties in native stack too
Added: stack/native/trunk/etc/application-roles.properties
===================================================================
--- stack/native/trunk/etc/application-roles.properties (rev 0)
+++ stack/native/trunk/etc/application-roles.properties 2012-03-08 16:52:38 UTC (rev 15904)
@@ -0,0 +1 @@
+kermit=guest
Added: stack/native/trunk/etc/application-users.properties
===================================================================
--- stack/native/trunk/etc/application-users.properties (rev 0)
+++ stack/native/trunk/etc/application-users.properties 2012-03-08 16:52:38 UTC (rev 15904)
@@ -0,0 +1 @@
+kermit=0491092837b7e5aef6f270a3b85f8336
14 years, 1 month
JBossWS SVN: r15903 - in stack/cxf/trunk/modules/testsuite: cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-03-08 11:47:24 -0500 (Thu, 08 Mar 2012)
New Revision: 15903
Modified:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointOnlyDeploymentTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms_http/JMSHTTPEndpointDeploymentTestCase.java
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[JBWS-3454] Restoring fixme for AS 7.0.x only (remote JNDI not supported there) and fixing 710 dependencies
Modified: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointOnlyDeploymentTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointOnlyDeploymentTestCase.java 2012-03-08 16:28:47 UTC (rev 15902)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointOnlyDeploymentTestCase.java 2012-03-08 16:47:24 UTC (rev 15903)
@@ -75,6 +75,10 @@
public void testJMSEndpointClientSide() throws Exception
{
+ if (isTargetJBoss70()) {
+ System.out.println("FIXME: can't lookup remote ConnectionFactory, remote JNDI binding not available yet on AS 7.0.x");
+ return;
+ }
URL wsdlUrl = getResourceURL("jaxws/cxf/jms/META-INF-as7/wsdl/HelloWorldService.wsdl");
QName serviceName = new QName("http://org.jboss.ws/jaxws/cxf/jms", "HelloWorldService");
@@ -90,6 +94,11 @@
public void testMessagingClient() throws Exception
{
+ if (isTargetJBoss70()) {
+ System.out.println("FIXME: can't lookup remote ConnectionFactory, remote JNDI binding not available yet on AS 7.0.x");
+ return;
+ }
+
String reqMessage =
"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
" <soap:Body>" +
Modified: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms_http/JMSHTTPEndpointDeploymentTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms_http/JMSHTTPEndpointDeploymentTestCase.java 2012-03-08 16:28:47 UTC (rev 15902)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms_http/JMSHTTPEndpointDeploymentTestCase.java 2012-03-08 16:47:24 UTC (rev 15903)
@@ -62,6 +62,11 @@
public void testJMSEndpointClientSide() throws Exception
{
+ if (isTargetJBoss70()) {
+ System.out.println("FIXME: can't lookup remote ConnectionFactory, remote JNDI binding not available yet on AS 7.0.x");
+ return;
+ }
+
URL wsdlUrl = getResourceURL("jaxws/cxf/jms_http/WEB-INF/wsdl/HelloWorldService.wsdl");
QName serviceName = new QName("http://org.jboss.ws/jaxws/cxf/jms", "HelloWorldService");
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2012-03-08 16:28:47 UTC (rev 15902)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2012-03-08 16:47:24 UTC (rev 15903)
@@ -1041,6 +1041,18 @@
<version>3.2.1.GA</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.hornetq</groupId>
+ <artifactId>hornetq-jms</artifactId>
+ <version>2.2.11.Final</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hornetq</groupId>
+ <artifactId>hornetq-core</artifactId>
+ <version>2.2.11.Final</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
14 years, 1 month
JBossWS SVN: r15902 - in stack/cxf/trunk: etc and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-03-08 11:28:47 -0500 (Thu, 08 Mar 2012)
New Revision: 15902
Added:
stack/cxf/trunk/etc/
stack/cxf/trunk/etc/application-roles.properties
stack/cxf/trunk/etc/application-users.properties
Modified:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointOnlyDeploymentTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms_http/JMSHTTPEndpointDeploymentTestCase.java
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[JBWS-3454] Adding test user properties, cleaning up testcases, adding hornetq dependencies (test scope)
Added: stack/cxf/trunk/etc/application-roles.properties
===================================================================
--- stack/cxf/trunk/etc/application-roles.properties (rev 0)
+++ stack/cxf/trunk/etc/application-roles.properties 2012-03-08 16:28:47 UTC (rev 15902)
@@ -0,0 +1 @@
+kermit=guest
Added: stack/cxf/trunk/etc/application-users.properties
===================================================================
--- stack/cxf/trunk/etc/application-users.properties (rev 0)
+++ stack/cxf/trunk/etc/application-users.properties 2012-03-08 16:28:47 UTC (rev 15902)
@@ -0,0 +1 @@
+kermit=0491092837b7e5aef6f270a3b85f8336
Modified: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointOnlyDeploymentTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointOnlyDeploymentTestCase.java 2012-03-08 16:24:43 UTC (rev 15901)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointOnlyDeploymentTestCase.java 2012-03-08 16:28:47 UTC (rev 15902)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -49,6 +49,7 @@
import org.jboss.ws.common.DOMUtils;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
/**
* Test case for deploying an archive with a JMS (SOAP-over-JMS 1.0) endpoint only
@@ -80,7 +81,11 @@
Service service = Service.create(wsdlUrl, serviceName);
HelloWorld proxy = (HelloWorld) service.getPort(new QName("http://org.jboss.ws/jaxws/cxf/jms", "HelloWorldImplPort"), HelloWorld.class);
setupProxy(proxy);
- assertEquals("Hi", proxy.echo("Hi"));
+ try {
+ assertEquals("Hi", proxy.echo("Hi"));
+ } catch (Exception e) {
+ rethrowAndHandleAuthWarning(e);
+ }
}
public void testMessagingClient() throws Exception
@@ -106,14 +111,19 @@
Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
env.put(Context.PROVIDER_URL, "remote://" + getServerHost() + ":4447");
- env.put(Context.SECURITY_PRINCIPAL, "guest");
- env.put(Context.SECURITY_CREDENTIALS, "pass");
- InitialContext context = new InitialContext(env);
+ env.put(Context.SECURITY_PRINCIPAL, JBossWSTestHelper.getTestUsername());
+ env.put(Context.SECURITY_CREDENTIALS, JBossWSTestHelper.getTestPassword());
+ InitialContext context = null;
+ try {
+ context = new InitialContext(env);
+ } catch (Exception e) {
+ rethrowAndHandleAuthWarning(e);
+ }
QueueConnectionFactory connectionFactory = (QueueConnectionFactory)context.lookup("jms/RemoteConnectionFactory");
Queue reqQueue = (Queue)context.lookup("jms/queue/test");
Queue resQueue = (Queue)context.lookup("jms/queue/test");
- QueueConnection con = connectionFactory.createQueueConnection("guest", "pass");
+ QueueConnection con = connectionFactory.createQueueConnection(JBossWSTestHelper.getTestUsername(), JBossWSTestHelper.getTestPassword());
QueueSession session = con.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
QueueReceiver receiver = session.createReceiver(resQueue);
ResponseListener responseListener = new ResponseListener();
@@ -168,14 +178,21 @@
}
private void setupProxy(HelloWorld proxy) {
- final String user = "guest";
- final String pwd = "pass";
JMSConduit conduit = (JMSConduit)ClientProxy.getClient(proxy).getConduit();
JNDIConfiguration jndiConfig = conduit.getJmsConfig().getJndiConfig();
- jndiConfig.setConnectionUserName(user);
- jndiConfig.setConnectionPassword(pwd);
+ jndiConfig.setConnectionUserName(JBossWSTestHelper.getTestUsername());
+ jndiConfig.setConnectionPassword(JBossWSTestHelper.getTestPassword());
Properties props = conduit.getJmsConfig().getJndiTemplate().getEnvironment();
- props.put(Context.SECURITY_PRINCIPAL, user);
- props.put(Context.SECURITY_CREDENTIALS, pwd);
+ props.put(Context.SECURITY_PRINCIPAL, JBossWSTestHelper.getTestUsername());
+ props.put(Context.SECURITY_CREDENTIALS, JBossWSTestHelper.getTestPassword());
}
+
+ private static void rethrowAndHandleAuthWarning(Exception e) throws Exception {
+ final String msg = "Authentication failed";
+ if (e.getMessage().contains(msg) || e.getCause().getMessage().contains(msg)) {
+ System.out.println("This test requires an user with 'guest' role to be available on the application server; " +
+ "please ensure that then specify user and password using -Dtest.username=\"foo\" -Dtest.password=\"bar\".");
+ }
+ throw e;
+ }
}
Modified: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms_http/JMSHTTPEndpointDeploymentTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms_http/JMSHTTPEndpointDeploymentTestCase.java 2012-03-08 16:24:43 UTC (rev 15901)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms_http/JMSHTTPEndpointDeploymentTestCase.java 2012-03-08 16:28:47 UTC (rev 15902)
@@ -38,6 +38,7 @@
import org.jboss.test.ws.jaxws.cxf.jms.HelloWorld;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
/**
* Test case for deploying an archive with a JMS (SOAP-over-JMS 1.0) and a HTTP endpoints
@@ -67,7 +68,15 @@
Service service = Service.create(wsdlUrl, serviceName);
HelloWorld proxy = (HelloWorld) service.getPort(new QName("http://org.jboss.ws/jaxws/cxf/jms", "HelloWorldImplPort"), HelloWorld.class);
setupProxy(proxy);
- assertEquals("Hi", proxy.echo("Hi"));
+ try {
+ assertEquals("Hi", proxy.echo("Hi"));
+ } catch (Exception e) {
+ if (e.getMessage().contains("Authentication failed")) {
+ System.out.println("This test requires an user with 'guest' role to be available on the application server; " +
+ "please ensure that then specify user and password using -Dtest.username=\"foo\" -Dtest.password=\"bar\".");
+ }
+ throw e;
+ }
}
public void testHTTPEndpointClientSide() throws Exception
@@ -81,14 +90,12 @@
}
private void setupProxy(HelloWorld proxy) {
- final String user = "guest";
- final String pwd = "pass";
JMSConduit conduit = (JMSConduit)ClientProxy.getClient(proxy).getConduit();
JNDIConfiguration jndiConfig = conduit.getJmsConfig().getJndiConfig();
- jndiConfig.setConnectionUserName(user);
- jndiConfig.setConnectionPassword(pwd);
+ jndiConfig.setConnectionUserName(JBossWSTestHelper.getTestUsername());
+ jndiConfig.setConnectionPassword(JBossWSTestHelper.getTestPassword());
Properties props = conduit.getJmsConfig().getJndiTemplate().getEnvironment();
- props.put(Context.SECURITY_PRINCIPAL, user);
- props.put(Context.SECURITY_CREDENTIALS, pwd);
+ props.put(Context.SECURITY_PRINCIPAL, JBossWSTestHelper.getTestUsername());
+ props.put(Context.SECURITY_CREDENTIALS, JBossWSTestHelper.getTestPassword());
}
}
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2012-03-08 16:24:43 UTC (rev 15901)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2012-03-08 16:28:47 UTC (rev 15902)
@@ -330,6 +330,14 @@
<value>${test.resources.directory}</value>
</property>
<property>
+ <name>test.username</name>
+ <value>${test.username}</value>
+ </property>
+ <property>
+ <name>test.password</name>
+ <value>${test.password}</value>
+ </property>
+ <property>
<name>wsdl.publish.location</name>
<value>${wsdl.publish.location}</value>
</property>
@@ -1254,6 +1262,18 @@
<version>3.2.2.GA</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.hornetq</groupId>
+ <artifactId>hornetq-jms</artifactId>
+ <version>2.2.11.Final</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hornetq</groupId>
+ <artifactId>hornetq-core</artifactId>
+ <version>2.2.11.Final</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
14 years, 1 month
JBossWS SVN: r15901 - in shared-testsuite/trunk: testsuite/src/test/ant-import and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-03-08 11:24:43 -0500 (Thu, 08 Mar 2012)
New Revision: 15901
Modified:
shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
shared-testsuite/trunk/testsuite/src/test/ant-import/build-testsuite.xml
Log:
[JBWS-3454] test username/pwd support
Modified: shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
===================================================================
--- shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java 2012-03-08 12:14:52 UTC (rev 15900)
+++ shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java 2012-03-08 16:24:43 UTC (rev 15901)
@@ -69,6 +69,8 @@
private static final String SYSPROP_JBOSS_BIND_ADDRESS = "jboss.bind.address";
private static final String SYSPROP_TEST_ARCHIVE_DIRECTORY = "test.archive.directory";
private static final String SYSPROP_TEST_RESOURCES_DIRECTORY = "test.resources.directory";
+ private static final String TEST_USERNAME = "test.username";
+ private static final String TEST_PASSWORD = "test.password";
private static final boolean DEPLOY_PROCESS_ENABLED = !Boolean.getBoolean("disable.test.archive.deployment");
private static Deployer DEPLOYER;
@@ -407,6 +409,22 @@
return testResourcesDir;
}
+ public static String getTestUsername() {
+ String prop = System.getProperty(TEST_USERNAME);
+ if (prop == null || "".equals(prop)) {
+ prop = "kermit";
+ }
+ return prop;
+ }
+
+ public static String getTestPassword() {
+ String prop = System.getProperty(TEST_PASSWORD);
+ if (prop == null || "".equals(prop)) {
+ prop = "thefrog";
+ }
+ return prop;
+ }
+
public static void addSecurityDomain(String name, Map<String,String> authenticationOptions) throws Exception
{
getDeployer().addSecurityDomain(name, authenticationOptions);
Modified: shared-testsuite/trunk/testsuite/src/test/ant-import/build-testsuite.xml
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/ant-import/build-testsuite.xml 2012-03-08 12:14:52 UTC (rev 15900)
+++ shared-testsuite/trunk/testsuite/src/test/ant-import/build-testsuite.xml 2012-03-08 16:24:43 UTC (rev 15901)
@@ -595,6 +595,8 @@
<sysproperty key="test.archive.directory" value="${tests.output.dir}/test-libs"/>
<sysproperty key="test.classes.directory" value="${tests.output.dir}/test-classes"/>
<sysproperty key="test.resources.directory" value="${tests.output.dir}/test-resources"/>
+ <sysproperty key="test.username" value="${test.username}"/>
+ <sysproperty key="test.password" value="${test.password"/>
<sysproperty key="binary.distribution" value="true"/>
<classpath>
<path refid="tests.client.classpath"/>
@@ -659,6 +661,8 @@
<sysproperty key="test.archive.directory" value="${tests.output.dir}/test-libs"/>
<sysproperty key="test.classes.directory" value="${tests.output.dir}/test-classes"/>
<sysproperty key="test.resources.directory" value="${tests.output.dir}/test-resources"/>
+ <sysproperty key="test.username" value="${test.username}"/>
+ <sysproperty key="test.password" value="${test.password"/>
<sysproperty key="binary.distribution" value="true"/>
<classpath>
<path refid="tests.client.classpath"/>
14 years, 1 month