Commit 881681b5 authored by Lubomir Bulej's avatar Lubomir Bulej

Reduce the pollution of the "disl." property name space, to get less verbose job command lines.

build.xml: prefix properties intended for the test runner with "runner."
src-test/*Runner: expect runner-specific properties to have the "runner." prefix
src-test/*Runner: minor naming fixes and cosmetic cleanups.
src-test/BaseTest: check "test.debug" instead of "disl.test.debug".
parent b40ac5fd
......@@ -572,17 +572,18 @@
<pathelement location="${build.shvm}" />
</classpath>
<!-- allow "disl.", "dislserver.", and "dislreserver." properties to be passed to tests -->
<!-- pass properties starting with "disl.", "dislserver.", and "dislreserver." to the tests -->
<syspropertyset>
<propertyref prefix="disl." />
<propertyref prefix="dislserver." />
<propertyref prefix="dislreserver." />
</syspropertyset>
<sysproperty key="disl.lib.dir" value="${out.lib}" />
<sysproperty key="test.lib.dir" value="${out.test}" />
<sysproperty key="disl.agent.lib" value="${disl.agent.lib}" />
<sysproperty key="shvm.agent.lib" value="${shvm.agent.lib}" />
<sysproperty key="runner.disl.lib.dir" value="${out.lib}" />
<sysproperty key="runner.lib.dir" value="${out.test}" />
<sysproperty key="runner.disl.agent.lib" value="${disl.agent.lib}" />
<sysproperty key="runner.shvm.agent.lib" value="${shvm.agent.lib}" />
<sysproperty key="runner.debug" value="${test.debug}" />
<batchtest fork="yes">
<fileset refid="test.batch" />
......
......@@ -25,7 +25,7 @@ public abstract class BaseTest {
//
__runner.assertIsFinished ();
if (Boolean.getBoolean ("disl.test.verbose")) {
if (Boolean.getBoolean ("test.verbose")) {
__runner.destroyIfRunningAndDumpOutputs ();
}
......@@ -34,7 +34,7 @@ public abstract class BaseTest {
//
_checkOutErr (__runner);
__runner.assertRestOutErrNull ();
__runner.assertRestOutErrEmpty ();
}
......
......@@ -15,47 +15,36 @@ import ch.usi.dag.util.Lists;
public class ClientServerEvaluationRunner extends Runner {
private static final String __CLIENT_JAVA_COMMAND__ = _getJavaCommand (
System.getProperty ("disl.java.home")
System.getProperty ("runner.disl.java.home")
);
private static final String __SERVER_JAVA_COMMAND__ = _getJavaCommand (
System.getProperty ("disl.server.java.home")
System.getProperty ("runner.disl.server.java.home")
);
private static final String __SHADOW_JAVA_COMMAND__ = _getJavaCommand (
System.getProperty ("shvm.server.java.home")
System.getProperty ("runner.shvm.server.java.home")
);
//
private Job __client;
private boolean __clientOutEmpty = true;
private boolean __clientErrEmpty = true;
private Job __server;
private boolean __serverOutEmpty = true;
private boolean __serverErrEmpty = true;
private Job __shadow;
private boolean __shadowOutEmpty = true;
private boolean __shadowErrEmpty = true;
private boolean clientOutNull;
private boolean clientErrNull;
private boolean shadowOutNull;
private boolean shadowErrNull;
private boolean serverOutNull;
private boolean serverErrNull;
//
public ClientServerEvaluationRunner (final Class <?> testClass) {
super (testClass);
clientOutNull = true;
clientErrNull = true;
shadowOutNull = true;
shadowErrNull = true;
serverOutNull = true;
serverErrNull = true;
}
private Job __startServer (
......@@ -170,6 +159,7 @@ public class ClientServerEvaluationRunner extends Runner {
@Override
protected boolean _waitFor (final Duration duration) {
// FIXME Wait in parallel for the specified duration.
boolean finished = true;
finished = finished & __client.waitFor (duration);
finished = finished & __server.waitFor (duration);
......@@ -211,7 +201,7 @@ public class ClientServerEvaluationRunner extends Runner {
public void assertClientOut (final String fileName) throws IOException {
clientOutNull = false;
__clientOutEmpty = false;
assertEquals (
"client out does not match",
_loadResource (fileName), __client.getOutput ()
......@@ -219,14 +209,14 @@ public class ClientServerEvaluationRunner extends Runner {
}
public void assertClientOutNull () throws IOException {
clientOutNull = false;
assertEquals ("client out does not match", "", __client.getOutput ());
public void assertClientOutEmpty () throws IOException {
__clientOutEmpty = false;
assertEquals ("client out is not empty", "", __client.getOutput ());
}
public void assertClientErr (final String fileName) throws IOException {
clientErrNull = false;
__clientErrEmpty = false;
assertEquals (
"client err does not match",
_loadResource (fileName), __client.getError ()
......@@ -234,14 +224,14 @@ public class ClientServerEvaluationRunner extends Runner {
}
public void assertClientErrNull () throws IOException {
clientErrNull = false;
assertEquals ("client err does not match", "", __client.getError ());
public void assertClientErrEmpty () throws IOException {
__clientErrEmpty = false;
assertEquals ("client err is not empty", "", __client.getError ());
}
public void assertShadowOut (final String fileName) throws IOException {
shadowOutNull = false;
__shadowOutEmpty = false;
assertEquals (
"shadow out does not match",
_loadResource (fileName), __shadow.getOutput ()
......@@ -249,14 +239,14 @@ public class ClientServerEvaluationRunner extends Runner {
}
public void assertShadowOutNull () throws IOException {
shadowOutNull = false;
assertEquals ("shadow out does not match", "", __shadow.getOutput ());
public void assertShadowOutEmpty () throws IOException {
__shadowOutEmpty = false;
assertEquals ("shadow out is not empty", "", __shadow.getOutput ());
}
public void assertShadowErr (final String fileName) throws IOException {
shadowErrNull = false;
__shadowErrEmpty = false;
assertEquals (
"shadow err does not match",
_loadResource (fileName), __shadow.getError ()
......@@ -264,14 +254,14 @@ public class ClientServerEvaluationRunner extends Runner {
}
public void assertShadowErrNull () throws IOException {
shadowErrNull = false;
assertEquals ("shadow err does not match", "", __shadow.getError ());
public void assertShadowErrEmpty () throws IOException {
__shadowErrEmpty = false;
assertEquals ("shadow err is not empty", "", __shadow.getError ());
}
public void assertServerOut (final String fileName) throws IOException {
serverOutNull = false;
__serverOutEmpty = false;
assertEquals (
"server out does not match",
_loadResource (fileName), __server.getOutput ()
......@@ -279,15 +269,15 @@ public class ClientServerEvaluationRunner extends Runner {
}
public void assertServerOutNull ()
public void assertServerOutEmpty ()
throws IOException {
serverOutNull = false;
assertEquals ("server out does not match", "", __server.getOutput ());
__serverOutEmpty = false;
assertEquals ("server out is not empty", "", __server.getOutput ());
}
public void assertServerErr (final String fileName) throws IOException {
serverErrNull = false;
__serverErrEmpty = false;
assertEquals (
"server err does not match",
_loadResource (fileName), __server.getError ()
......@@ -295,34 +285,34 @@ public class ClientServerEvaluationRunner extends Runner {
}
public void assertServerErrNull () throws IOException {
serverErrNull = false;
assertEquals ("server err does not match", "", __server.getError ());
public void assertServerErrEmpty () throws IOException {
__serverErrEmpty = false;
assertEquals ("server err is not empty", "", __server.getError ());
}
@Override
protected void _assertRestOutErrNull () throws IOException {
if (clientOutNull) {
assertClientOutNull ();
protected void _assertRestOutErrEmpty () throws IOException {
if (__clientOutEmpty) {
assertClientOutEmpty ();
}
if (clientErrNull) {
assertClientErrNull ();
if (__clientErrEmpty) {
assertClientErrEmpty ();
}
if (shadowOutNull) {
assertShadowOutNull ();
if (__shadowOutEmpty) {
assertShadowOutEmpty ();
}
if (shadowErrNull) {
assertShadowErrNull ();
if (__shadowErrEmpty) {
assertShadowErrEmpty ();
}
if (serverOutNull) {
assertServerOutNull ();
if (__serverOutEmpty) {
assertServerOutEmpty ();
}
if (serverErrNull) {
assertServerErrNull ();
if (__serverErrEmpty) {
assertServerErrEmpty ();
}
}
......
......@@ -14,36 +14,27 @@ import ch.usi.dag.util.Lists;
public class ClientServerRunner extends Runner {
private static final String __CLIENT_JAVA_COMMAND__ = _getJavaCommand (
System.getProperty ("disl.java.home")
System.getProperty ("runner.disl.java.home")
);
private static final String __SERVER_JAVA_COMMAND__ = _getJavaCommand (
System.getProperty ("disl.server.java.home")
System.getProperty ("runner.disl.server.java.home")
);
//
private Job __client;
private boolean __clientOutEmpty = true;
private boolean __clientErrEmpty = true;
private Job __server;
private boolean clientOutNull;
private boolean clientErrNull;
private boolean serverOutNull;
private boolean serverErrNull;
private boolean __serverOutEmpty = true;
private boolean __serverErrEmpty = true;
//
public ClientServerRunner (final Class <?> testClass) {
super (testClass);
clientOutNull = true;
clientErrNull = true;
serverOutNull = true;
serverErrNull = true;
}
......@@ -116,6 +107,7 @@ public class ClientServerRunner extends Runner {
@Override
protected boolean _waitFor (final Duration duration) {
// FIXME Wait in parallel for the specified duration.
boolean finished = true;
finished = finished & __client.waitFor (duration);
finished = finished & __server.waitFor (duration);
......@@ -152,7 +144,7 @@ public class ClientServerRunner extends Runner {
public void assertClientOut (final String fileName) throws IOException {
clientOutNull = false;
__clientOutEmpty = false;
assertEquals (
"client out does not match",
_loadResource (fileName), __client.getOutput ()
......@@ -160,14 +152,14 @@ public class ClientServerRunner extends Runner {
}
public void assertClientOutNull () throws IOException {
clientOutNull = false;
assertEquals ("client out does not match", "", __client.getOutput ());
public void assertClientOutEmpty () throws IOException {
__clientOutEmpty = false;
assertEquals ("client out is not empty", "", __client.getOutput ());
}
public void assertClientErr (final String fileName) throws IOException {
clientErrNull = false;
__clientErrEmpty = false;
assertEquals (
"client err does not match",
_loadResource (fileName), __client.getError ()
......@@ -175,14 +167,14 @@ public class ClientServerRunner extends Runner {
}
public void assertClientErrNull () throws IOException {
clientErrNull = false;
assertEquals ("client err does not match", "", __client.getError ());
public void assertClientErrEmpty () throws IOException {
__clientErrEmpty = false;
assertEquals ("client err is not empty", "", __client.getError ());
}
public void assertServerOut (final String fileName) throws IOException {
serverOutNull = false;
__serverOutEmpty = false;
assertEquals (
"server out does not match",
_loadResource (fileName), __server.getOutput ()
......@@ -190,14 +182,14 @@ public class ClientServerRunner extends Runner {
}
public void assertServerOutNull () throws IOException {
serverOutNull = false;
assertEquals ("server out does not match", "", __server.getOutput ());
public void assertServerOutEmpty () throws IOException {
__serverOutEmpty = false;
assertEquals ("server out is not empty", "", __server.getOutput ());
}
public void assertServerErr (final String fileName) throws IOException {
serverErrNull = false;
__serverErrEmpty = false;
assertEquals (
"server err does not match",
_loadResource (fileName), __server.getError ()
......@@ -205,25 +197,25 @@ public class ClientServerRunner extends Runner {
}
public void assertServerErrNull () throws IOException {
serverErrNull = false;
assertEquals ("server err does not match", "", __server.getError ());
public void assertServerErrEmpty () throws IOException {
__serverErrEmpty = false;
assertEquals ("server err is not empty", "", __server.getError ());
}
@Override
protected void _assertRestOutErrNull () throws IOException {
if (clientOutNull) {
assertClientOutNull ();
protected void _assertRestOutErrEmpty () throws IOException {
if (__clientOutEmpty) {
assertClientOutEmpty ();
}
if (clientErrNull) {
assertClientErrNull ();
if (__clientErrEmpty) {
assertClientErrEmpty ();
}
if (serverOutNull) {
assertServerOutNull ();
if (__serverOutEmpty) {
assertServerOutEmpty ();
}
if (serverErrNull) {
assertServerErrNull ();
if (__serverErrEmpty) {
assertServerErrEmpty ();
}
}
......
......@@ -24,16 +24,16 @@ public abstract class Runner {
protected static final String _ENV_JAVA_HOME_ = "JAVA_HOME";
protected static final File _DISL_LIB_DIR_ = new File (System.getProperty ("disl.lib.dir", "lib"));
protected static final File _DISL_LIB_DIR_ = new File (System.getProperty ("runner.disl.lib.dir", "lib"));
protected static final File _DISL_AGENT_LIB_ = __libPath ("disl.agent.lib", "libdislagent.so");
protected static final File _DISL_BYPASS_JAR_ = __libPath ("disl.bypass.jar", "disl-bypass.jar");
protected static final File _DISL_SERVER_JAR_ = __libPath ("disl.server.jar", "disl-server.jar");
protected static final File _DISL_AGENT_LIB_ = __libPath ("runner.disl.agent.lib", "libdislagent.so");
protected static final File _DISL_BYPASS_JAR_ = __libPath ("runner.disl.bypass.jar", "disl-bypass.jar");
protected static final File _DISL_SERVER_JAR_ = __libPath ("runner.disl.server.jar", "disl-server.jar");
protected static final Class <?> _DISL_SERVER_CLASS_ = DiSLServer.class;
protected static final File _SHVM_AGENT_LIB_ = __libPath ("shvm.agent.lib", "libdislreagent.so");
protected static final File _SHVM_DISPATCH_JAR_ = __libPath ("shvm.dispatch.jar", "dislre-dispatch.jar");
protected static final File _SHVM_SERVER_JAR_ = __libPath ("shvm.server.jar", "dislre-server.jar");
protected static final File _SHVM_AGENT_LIB_ = __libPath ("runner.shvm.agent.lib", "libdislreagent.so");
protected static final File _SHVM_DISPATCH_JAR_ = __libPath ("runner.shvm.dispatch.jar", "dislre-dispatch.jar");
protected static final File _SHVM_SERVER_JAR_ = __libPath ("runner.shvm.server.jar", "dislre-server.jar");
protected static final Class <?> _SHVM_SERVER_CLASS_ = DiSLREServer.class;
private static File __libPath (final String property, final String defaultValue) {
......@@ -42,8 +42,8 @@ public abstract class Runner {
//
protected static final File _TEST_LIB_DIR_ = new File (System.getProperty ("test.lib.dir", "test-jars"));
static final boolean TEST_DEBUG = Boolean.getBoolean ("disl.test.debug");
protected static final File _TEST_LIB_DIR_ = new File (System.getProperty ("runner.lib.dir", "test-jars"));
static final boolean TEST_DEBUG = Boolean.getBoolean ("runner.debug");
//
......@@ -161,13 +161,13 @@ public abstract class Runner {
}
Strings.storeToFile (
String.format ("tmp.%s.%s.out.txt", __testName, prefix),
String.format ("test.%s.%s.out.txt", __testName, prefix),
job.getOutput ()
);
Strings.storeToFile (
String.format ("tmp.%s.%s.err.txt", __testName, prefix),
String.format ("test.%s.%s.err.txt", __testName, prefix),
job.getError ()
);
}
......@@ -182,11 +182,11 @@ public abstract class Runner {
//
public final void assertRestOutErrNull () throws IOException {
_assertRestOutErrNull ();
public final void assertRestOutErrEmpty () throws IOException {
_assertRestOutErrEmpty ();
}
protected abstract void _assertRestOutErrNull () throws IOException;
protected abstract void _assertRestOutErrEmpty () throws IOException;
//
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment