Author: richard.opalka(a)jboss.com
Date: 2008-07-30 05:52:11 -0400 (Wed, 30 Jul 2008)
New Revision: 7946
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java
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/tools/scripts/ScriptTestCase.java
Log:
[JBWS-1987] make tests portable accross platforms
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java 2008-07-30
08:34:37 UTC (rev 7945)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java 2008-07-30
09:52:11 UTC (rev 7946)
@@ -43,6 +43,12 @@
*/
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
+
+ java.util.Properties props = System.getProperties();
+
public static Test suite()
{
return new JBossWSTestSetup(JBWS1666TestCase.class,
"jaxws-jbws1666.war");
@@ -56,30 +62,30 @@
public void testClientAccess() throws Exception
{
- File javaFile = new File (System.getProperty("java.home") +
"/bin/java");
+ 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 + "/client";
- String jbl = jbh + "/lib";
+ String jbc = jbh + FS + "client";
+ String jbl = jbh + FS + "lib";
// 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"));
- cp.append(":" + jbc + "/jbossws-native-client.jar");
+ cp.append(PS + jbc + FS + "jbossws-native-client.jar");
if (isTargetJBoss50())
{
- cp.append(":" + jbc + "/jboss-common-core.jar");
- cp.append(":" + jbc + "/jboss-logging-spi.jar");
+ cp.append(PS + jbc + FS + "jboss-common-core.jar");
+ cp.append(PS + jbc + FS + "jboss-logging-spi.jar");
}
else
{
- cp.append(":" + jbc + "/jboss-common-client.jar");
+ cp.append(PS + jbc + FS + "jboss-common-client.jar");
}
Runtime rt = Runtime.getRuntime();
- String command = javaCmd + " -Djava.endorsed.dirs=" + jbl +
"/endorsed -cp " + cp + " " + TestClient.class.getName() + "
" + getServerHost();
+ String command = javaCmd + " -Djava.endorsed.dirs=" + jbl + FS +
"endorsed -cp " + cp + " " + TestClient.class.getName() + "
" + getServerHost();
Process proc = rt.exec(command);
int status = proc.waitFor();
if (status == 0)
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-07-30
08:34:37 UTC (rev 7945)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws771/JBWS771TestCase.java 2008-07-30
09:52:11 UTC (rev 7946)
@@ -56,6 +56,10 @@
*/
public class JBWS771TestCase 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
+ private static final String LS = System.getProperty("line.separator"); //
'\n' on unix, '\r\n' on windows
+
private static final String TARGET_NAMESPACE =
"http://jbws771.jaxws.ws.test.jboss.org/";
private static URL wsdlURL;
private static IWebsvc port;
@@ -84,7 +88,7 @@
JBOSS_HOME = System.getProperty("jboss.home");
RESOURCES_DIR = createResourceFile(".").getPath();
- JDK_HOME = System.getProperty("java.home") + "/..";
+ JDK_HOME = System.getProperty("java.home") + FS + "..";
OS = System.getProperty("os.name").toLowerCase();
}
@@ -153,14 +157,14 @@
public void testWSConsume() throws Exception
{
// use absolute path for the output to be re-usable
- String absOutput =
createResourceFile("wsconsume/java").getAbsolutePath();
- String command = JBOSS_HOME + "/bin/wsconsume.sh -k -o " + absOutput +
" --extension --binding=" + RESOURCES_DIR + "/jaxws/jbws771/binding.xml
" + wsdlURL.toExternalForm();
+ String absOutput = createResourceFile("wsconsume" + FS +
"java").getAbsolutePath();
+ String command = JBOSS_HOME + FS + "bin" + FS + "wsconsume.sh -k -o
" + absOutput + " --extension --binding=" + RESOURCES_DIR + FS +
"jaxws" + FS + "jbws771" + FS + "binding.xml " +
wsdlURL.toExternalForm();
Process p = executeCommand(command);
// check status code
checkStatusCode(p, "wsconsume");
- File javaSource =
getResourceFile("wsconsume/java/org/jboss/test/ws/jaxws/jbws771/JBWS771Service.java");
+ File javaSource = getResourceFile("wsconsume" + FS + "java" +
FS + "org" + FS + "jboss" + FS + "test" + FS +
"ws" + FS + "jaxws" + FS + "jbws771" + FS +
"JBWS771Service.java");
assertTrue("Service endpoint interface not generated",
javaSource.exists());
}
@@ -204,9 +208,10 @@
StringBuffer buffer = new StringBuffer();
String line;
while ((line = in.readLine()) != null) {
- buffer.append(line + "\n");
+ buffer.append(line + LS);
}
- System.out.println(buffer.toString() + "\n");
+ System.out.println(buffer.toString());
System.out.println();
+ System.out.println();
}
}
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/scripts/ScriptTestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/scripts/ScriptTestCase.java 2008-07-30
08:34:37 UTC (rev 7945)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/tools/scripts/ScriptTestCase.java 2008-07-30
09:52:11 UTC (rev 7946)
@@ -34,6 +34,9 @@
*/
public class ScriptTestCase 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
+ private static final String LS = System.getProperty("line.separator"); //
'\n' on unix, '\r\n' on windows
private String TOOLS_CONFIG =
getResourceFile("tools/scripts/wstools-config.xml").getAbsolutePath();
private String JBOSS_HOME;
@@ -53,22 +56,17 @@
public void testWSToolsFromCommandLine() throws Exception
{
- if (isWindowsOS())
- {
- fail("This test has not been verified on windows");
- }
-
// use absolute path for the output to be re-usable
File dest = createResourceFile("wstools/java");
dest.mkdirs();
- String command = JBOSS_HOME + "/bin/wstools.sh -config " + TOOLS_CONFIG +
" -dest "+ dest.getAbsolutePath();
+ String command = JBOSS_HOME + FS + "bin" + FS + "wstools.sh -config
" + TOOLS_CONFIG + " -dest "+ dest.getAbsolutePath();
Process p = executeCommand(command);
// check status code
assertStatusCode(p, "wstools");
- File javaSource =
getResourceFile("wstools/java/org/jboss/test/ws/jbws810/PhoneBookService.java");
+ File javaSource = getResourceFile("wstools" + FS + "java" + FS
+ "org" + FS + "jboss" + FS + "test" + FS + "ws" +
FS + "jbws810" + FS + "PhoneBookService.java");
assertTrue("Service endpoint interface not generated",
javaSource.exists());
}
@@ -89,9 +87,4 @@
int status = p.waitFor();
assertTrue(s + " did exit with status " + status, status == 0);
}
-
- private boolean isWindowsOS()
- {
- return ((OS.indexOf("nt") > -1) || (OS.indexOf("windows")
> -1));
- }
}
Show replies by date