Author: alessio.soldano(a)jboss.com
Date: 2012-09-17 10:33:36 -0400 (Mon, 17 Sep 2012)
New Revision: 16733
Added:
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws1666/META-INF/
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws1666/META-INF/MANIFEST-jbossws-cxf-client.MF
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws1666/META-INF/MANIFEST.MF
Modified:
shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestClient.java
Log:
[JBWS-3531][JBWS-3503] Refactoring JBWS1666TestCase to use jboss-modules client
Modified: shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml 2012-09-17
11:15:30 UTC (rev 16732)
+++ shared-testsuite/trunk/testsuite/src/test/ant-import/build-jars-jaxws.xml 2012-09-17
14:33:36 UTC (rev 16733)
@@ -378,6 +378,21 @@
<include name="org/jboss/test/ws/jaxws/jbws1666/TestEndpointImpl.class"
/>
</classes>
</war>
+ <jar
destfile="${tests.output.dir}/test-libs/jaxws-jbws1666-client.jar"
+
manifest="${tests.output.dir}/test-resources/jaxws/jbws1666/META-INF/MANIFEST.MF">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws1666/TestClient.class" />
+ <include
name="org/jboss/test/ws/jaxws/jbws1666/TestEndpoint.class" />
+ </fileset>
+ </jar>
+ <jar
destfile="${tests.output.dir}/test-libs/jaxws-jbws1666-b-client.jar"
+
manifest="${tests.output.dir}/test-resources/jaxws/jbws1666/META-INF/MANIFEST-jbossws-cxf-client.MF">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws1666/TestClient.class" />
+ <include
name="org/jboss/test/ws/jaxws/jbws1666/TestEndpoint.class" />
+ </fileset>
+ </jar>
+
<!-- jaxws-jbws1694 -->
<jar jarfile="${tests.output.dir}/test-libs/jaxws-jbws1694.jar">
Modified:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java 2012-09-17
11:15:30 UTC (rev 16732)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java 2012-09-17
14:33:36 UTC (rev 16733)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2009, 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.
*
@@ -25,22 +25,24 @@
import java.io.ByteArrayOutputStream;
import java.io.File;
+import javax.xml.ws.spi.Provider;
+
import junit.framework.Test;
import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
import org.jboss.wsf.test.JBossWSTestSetup;
/**
* [JBWS-1666] Simplify JBossWS jar dependencies
- *
- *
http://jira.jboss.org/jira/browse/JBWS-1666
+ * [JBWS-3531] Provide testcase for jboss-modules enabled clients
*
* @author Thomas.Diesler(a)jboss.com
+ * @author alessio.soldano(a)jboss.com
* @since 14-Jun-2007
*/
public class JBWS1666TestCase extends JBossWSTest
{
-
private static final String FS = System.getProperty("file.separator"); //
'/' on unix, '\' on windows
private static final String PS = System.getProperty("path.separator"); //
':' on unix, ';' on windows
@@ -51,48 +53,37 @@
return new JBossWSTestSetup(JBWS1666TestCase.class,
"jaxws-jbws1666.war");
}
- public void testPortAccess() throws Exception
+ public void testClientInTestsuiteJVM() throws Exception
{
String resStr = TestClient.testPortAccess(getServerHost());
assertEquals(TestClient.REQ_STR, resStr);
}
+
+ public void testClientUsingJBossModules() throws Exception {
+ runJBossModulesClient("jaxws-jbws1666-client.jar");
+ }
- public void testClientAccess() throws Exception
- {
+ public void testClientUsingJBossModulesWithJBossWSClientAggregationModule() throws
Exception {
+ if (!isIntegrationCXF()) {
+ return;
+ }
+ runJBossModulesClient("jaxws-jbws1666-b-client.jar");
+ }
+
+ private void runJBossModulesClient(String clientJar) throws Exception {
File javaFile = new File (System.getProperty("java.home") + FS +
"bin" + FS + "java");
String javaCmd = javaFile.exists() ? javaFile.getCanonicalPath() :
"java";
- String jbh = System.getProperty("jboss.home");
- String jbc = jbh + FS + "client";
- String jbl = jbh + FS + "lib";
+ final String jbh = System.getProperty("jboss.home");
+ final String jbm = jbh + FS + "modules";
+ final String jbmjar = jbh + FS + "jboss-modules.jar";
- // Setup the classpath - do not modify this lightheartedly.
- // Maybe you should extend the Class-Path in the MANIFEST instead.
- StringBuffer cp = new
StringBuffer(System.getProperty("test.classes.directory"));
- String stackName = null;
- if (isIntegrationCXF())
- {
- stackName = "cxf";
- }
- else if (isIntegrationNative())
- {
- stackName = "native";
- }
- else
- {
- throw new Exception("unsupported stack");
- }
- cp.append(PS + jbc + FS + "jbossws-" + stackName +
"-client.jar");
- cp.append(PS + jbc + FS + "jboss-common-core.jar");
- cp.append(PS + jbc + FS + "jboss-javaee.jar");
- cp.append(PS + jbc + FS + "log4j.jar");
- cp.append(PS + jbc + FS + "resolver.jar");
- cp.append(PS + jbc + FS + "xercesImpl.jar");
- cp.append(PS + jbc + FS + "jboss-logging.jar");
+ final File f = new File(JBossWSTestHelper.getTestArchiveDir(), clientJar);
- String props = " -Djava.endorsed.dirs=" + jbl + FS + "endorsed
";
- props += " -Dlog4j.output.dir=" +
System.getProperty("log4j.output.dir") + " ";
- String command = javaCmd + props + " -cp " + cp + " " +
TestClient.class.getName() + " " + getServerHost();
+ //java -jar $JBOSS_HOME/jboss-modules.jar -mp $JBOSS_HOME/modules -jar client.jar
+ String props = " -Dlog4j.output.dir=" +
System.getProperty("log4j.output.dir") + " -jar " + jbmjar + "
-mp " + jbm;
+ final String command = javaCmd + props + " -jar " + f.getAbsolutePath() +
" " + getServerHost();
+ System.out.println("**** " + command);
ByteArrayOutputStream bout = new ByteArrayOutputStream();
executeCommand(command, bout);
String res = null;
@@ -101,6 +92,7 @@
BufferedReader reader = new BufferedReader(new java.io.StringReader(output));
res = reader.readLine();
}
- assertEquals(TestClient.REQ_STR, res);
+ //check result (includes check on Provider impl, which might be affected by missing
javax.xml.ws.api module dependency
+ assertEquals(Provider.provider().getClass().getName() + ", " +
TestClient.REQ_STR, res);
}
}
Modified:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestClient.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestClient.java 2012-09-17
11:15:30 UTC (rev 16732)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws1666/TestClient.java 2012-09-17
14:33:36 UTC (rev 16733)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.
*
@@ -25,6 +25,7 @@
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
+import javax.xml.ws.spi.Provider;
public class TestClient
{
@@ -46,6 +47,6 @@
{
String serverHost = args[0];
String resStr = testPortAccess(serverHost);
- System.out.println(resStr);
+ System.out.println(Provider.provider().getClass().getName() + ", " +
resStr);
}
}
Added:
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws1666/META-INF/MANIFEST-jbossws-cxf-client.MF
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws1666/META-INF/MANIFEST-jbossws-cxf-client.MF
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws1666/META-INF/MANIFEST-jbossws-cxf-client.MF 2012-09-17
14:33:36 UTC (rev 16733)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Main-Class: org.jboss.test.ws.jaxws.jbws1666.TestClient
+Dependencies: org.jboss.ws.cxf.jbossws-cxf-client
\ No newline at end of file
Added:
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws1666/META-INF/MANIFEST.MF
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws1666/META-INF/MANIFEST.MF
(rev 0)
+++
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/jbws1666/META-INF/MANIFEST.MF 2012-09-17
14:33:36 UTC (rev 16733)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Main-Class: org.jboss.test.ws.jaxws.jbws1666.TestClient
+Dependencies: javax.jws.api,javax.xml.ws.api
\ No newline at end of file