Author: jboynes
Date: Sun Feb 18 10:26:15 2007
New Revision: 508930
URL: http://svn.apache.org/viewvc?view=rev&rev=508930
Log:
add launch test for command line args
add test that reference/property are initialized
Modified:
incubator/tuscany/java/sca/runtime/standalone/smoketest/src/main/java/org/apache/tuscany/sca/runtime/standalone/smoketest/Launched.java
incubator/tuscany/java/sca/runtime/standalone/smoketest/src/test/java/org/apache/tuscany/sca/runtime/standalone/smoketest/SmokeTestLauncher.java
Modified:
incubator/tuscany/java/sca/runtime/standalone/smoketest/src/main/java/org/apache/tuscany/sca/runtime/standalone/smoketest/Launched.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/standalone/smoketest/src/main/java/org/apache/tuscany/sca/runtime/standalone/smoketest/Launched.java?view=diff&rev=508930&r1=508929&r2=508930
==============================================================================
---
incubator/tuscany/java/sca/runtime/standalone/smoketest/src/main/java/org/apache/tuscany/sca/runtime/standalone/smoketest/Launched.java
(original)
+++
incubator/tuscany/java/sca/runtime/standalone/smoketest/src/main/java/org/apache/tuscany/sca/runtime/standalone/smoketest/Launched.java
Sun Feb 18 10:26:15 2007
@@ -18,8 +18,6 @@
*/
package org.apache.tuscany.sca.runtime.standalone.smoketest;
-import java.util.concurrent.Callable;
-
import org.osoa.sca.annotations.Reference;
/**
@@ -33,11 +31,19 @@
this.hello = hello;
}
- public Object main(String[] args) throws Exception {
- if ("Hello World".equals(hello.getGreeting())) {
+ public int main(String[] args) throws Exception {
+ if (args.length == 0) {
+ System.out.println("No Args");
return 0;
- } else {
- return 1;
}
+ String command = args[0];
+ if ("testReference".equals(command)) {
+ if ("Hello World".equals(hello.getGreeting())) {
+ return 0;
+ } else {
+ return 1;
+ }
+ }
+ return 1;
}
}
Modified:
incubator/tuscany/java/sca/runtime/standalone/smoketest/src/test/java/org/apache/tuscany/sca/runtime/standalone/smoketest/SmokeTestLauncher.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/standalone/smoketest/src/test/java/org/apache/tuscany/sca/runtime/standalone/smoketest/SmokeTestLauncher.java?view=diff&rev=508930&r1=508929&r2=508930
==============================================================================
---
incubator/tuscany/java/sca/runtime/standalone/smoketest/src/test/java/org/apache/tuscany/sca/runtime/standalone/smoketest/SmokeTestLauncher.java
(original)
+++
incubator/tuscany/java/sca/runtime/standalone/smoketest/src/test/java/org/apache/tuscany/sca/runtime/standalone/smoketest/SmokeTestLauncher.java
Sun Feb 18 10:26:15 2007
@@ -45,38 +45,34 @@
}
}
-/*
- public void testLauncherNoComponent() throws Exception {
- ProcessBuilder pb = new ProcessBuilder("java",
- "-jar",
- launcher.getAbsolutePath(),
- testJar.getAbsolutePath());
+ public void testLauncherWithNoArgs() throws Exception {
+ ProcessBuilder pb = new ProcessBuilder("java", "-jar",
launcher.getAbsolutePath(), testJar.getAbsolutePath());
pb.directory(installDir);
Process process = pb.start();
try {
- compareOutput(loadResource("LauncherNoComponent.txt"),
process.getErrorStream());
+ compareOutput("No Args" + LF, process.getInputStream());
process.waitFor();
- assertEquals(2, process.exitValue());
+ assertEquals(0, process.exitValue());
} finally {
process.destroy();
}
}
-*/
-/*
- public void testLauncherWithNoArgs() throws Exception {
- ProcessBuilder pb = new ProcessBuilder("java", "-jar",
launcher.getAbsolutePath(), testJar.getAbsolutePath());
+ public void testReference() throws Exception {
+ ProcessBuilder pb = new ProcessBuilder("java",
+ "-jar",
+ launcher.getAbsolutePath(),
+ testJar.getAbsolutePath(),
+ "testReference");
pb.directory(installDir);
Process process = pb.start();
try {
- compareOutput("No Args" + LF, process.getInputStream());
process.waitFor();
assertEquals(0, process.exitValue());
} finally {
process.destroy();
}
}
-*/
protected void setUp() throws Exception {
super.setUp();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]