Commit 41e92afe authored by František Haas's avatar František Haas

fixed scope test

parent 6422e913
......@@ -7,30 +7,31 @@ import org.junit.runners.JUnit4;
import ch.usi.dag.disl.test.utils.ClientServerRunner;
@RunWith(JUnit4.class)
@RunWith (JUnit4.class)
public class AfterTest {
ClientServerRunner r = new ClientServerRunner(this.getClass());
ClientServerRunner r = new ClientServerRunner (this.getClass ());
@Test
public void test()
throws Exception {
r.start();
r.waitFor();
r.assertIsFinished();
if (Boolean.parseBoolean(System.getProperty("disl.test.verbose"))) {
r.destroyIfRunningAndFlushOutputs();
public void test ()
throws Exception {
r.start ();
r.waitFor ();
r.assertIsFinished ();
if (Boolean.parseBoolean (System.getProperty ("disl.test.verbose"))) {
r.destroyIfRunningAndFlushOutputs ();
}
// r.assertIsSuccessfull();
r.assertClientOut("client.out.resource");
// r.assertClientErrNull();
r.assertServerOutNull();
r.assertServerErrNull();
r.assertIsSuccessfull ();
r.assertClientOut ("client.out.resource");
r.assertRestOutErrNull ();
}
@After
public void cleanup() {
r.destroy();
public void cleanup () {
r.destroy ();
}
}
package ch.usi.dag.disl.test.suite.scope.app;
public class TargetClass {
private void complete(String text, boolean b1, boolean b2) {
System.out.println(text + " " + b1 + " " + b2);
private void complete(final String text, final boolean b1, final boolean b2) {
System.out.println("app: " + text + " " + b1 + " " + b2);
}
public static void main(String[] args) {
public static void main(final String[] args) {
new TargetClass().complete("test", true, false);
}
}
package ch.usi.dag.disl.test.suite.scope.instr;
import ch.usi.dag.disl.annotation.AfterReturning;
import ch.usi.dag.disl.annotation.Before;
import ch.usi.dag.disl.marker.BodyMarker;
import ch.usi.dag.disl.staticcontext.MethodStaticContext;
public class DiSLClass {
@AfterReturning(marker = BodyMarker.class)
public static void onMethodExit(MethodStaticContext msc) {
System.out.println("Exiting " + msc.thisMethodFullName());
}
@Before(marker = BodyMarker.class, scope = "ch.usi.dag.disl.test2.suite.scope.app.TargetClass.complete(java.lang.String,boolean,boolean)")
@Before(marker = BodyMarker.class, scope = "ch.usi.dag.disl.test.suite.scope.app.TargetClass.complete(java.lang.String,boolean,boolean)")
public static void beforeComplete() {
System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
System.out.println("disl: before");
}
}
package ch.usi.dag.disl.test.suite.scope.junit;
import static org.junit.Assert.fail;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
......@@ -19,10 +17,6 @@ public class ScopeTest {
@Test
public void test ()
throws Exception {
// FIXME
fail ("FIXME - Java 7 and later");
// jvm crash
r.start ();
r.waitFor ();
r.assertIsFinished ();
......@@ -30,7 +24,7 @@ public class ScopeTest {
r.destroyIfRunningAndFlushOutputs ();
}
r.assertIsSuccessfull ();
// r.assertClientOut("client.out.resource");
r.assertClientOut("client.out.resource");
r.assertRestOutErrNull ();
}
......
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