Commit 5aa62335 authored by Lubomir Bulej's avatar Lubomir Bulej

Fix white space in tests suites to make modifications easier to merge.

parent d2ea1487
......@@ -3,6 +3,7 @@ package ch.usi.dag.disl.scope;
import org.junit.Assert;
import org.junit.Test;
public class TypeMatcherTest {
@Test
......
......@@ -3,6 +3,7 @@ package ch.usi.dag.disl.scope;
import org.junit.Assert;
import org.junit.Test;
public class WildCardMatcherTest {
@Test
......
package ch.usi.dag.disl.test.suite.after2.app;
public class TargetClass {
public static void main(String[] args) {
// NOTE: this test is better to use on large project and not this simple class
System.out.println("app: TargetClass.main(..)");
}
}
......@@ -10,6 +10,7 @@ import ch.usi.dag.disl.staticcontext.uid.UniqueMethodId;
import ch.usi.dag.disl.test.suite.after2.instr.runtime.Analysis;
public class DiSLClass {
@ThreadLocal
static Stack<Integer> stackTL;
......@@ -26,4 +27,5 @@ public class DiSLClass {
public static void onMethodExit(UniqueMethodId id) {
Analysis.onExit(stackTL, id.get());
}
}
......@@ -9,4 +9,5 @@ public class NotInitNorClinit {
public static boolean isApplicable(MethodStaticContext msc) {
return (msc.thisMethodName().endsWith("init>")) ? false : true;
}
}
......@@ -3,6 +3,7 @@ package ch.usi.dag.disl.test.suite.after2.instr.runtime;
import java.util.Stack;
public class Analysis {
public static void onExit(Stack<Integer> stack, int methodUID) {
int topOfTheStack = stack.pop();
if (topOfTheStack != methodUID) {
......@@ -15,4 +16,5 @@ public class Analysis {
System.exit(1);
}
}
}
......@@ -69,4 +69,5 @@ public class TargetClass {
throws Exception {
//throw new Exception();
}
}
......@@ -16,4 +16,5 @@ public class DiSLClass {
public static void returning(MethodStaticContext sc) {
System.out.println("disl: returning from " + sc.thisMethodName());
}
}
......@@ -40,4 +40,5 @@ public class TargetClass {
final TargetSubclass t = new TargetSubclass ();
t.method ();
}
}
......@@ -17,4 +17,5 @@ public class DiSLClass {
public static void afterThrowning () {
System.out.println ("After");
}
}
......@@ -32,4 +32,5 @@ public class TargetClass {
final TargetClass t = new TargetSubclass ();
System.out.println (t.getClass ().getSimpleName ());
}
}
......@@ -18,4 +18,5 @@ public class DiSLClass {
public static void afterThrowning (final MethodStaticContext msc) {
System.out.println (msc.thisClassSimpleName () +"."+ msc.thisMethodName () +" after");
}
}
......@@ -3,7 +3,6 @@ package ch.usi.dag.disl.test.suite.args.app;
public class TargetClass {
public void test_int(int i) {
System.out.println("app: TargetClass.test_int");
}
......
......@@ -128,4 +128,5 @@ public class DiSLClass {
}
}
}
}
......@@ -21,4 +21,5 @@ public class TargetClass {
t.print(true);
System.out.println("app: TargetClass.main(..) - ~print(true)");
}
}
......@@ -27,4 +27,5 @@ public class DiSLClass {
public static void postcondition1() {
System.out.println("disl: b exit bb");
}
}
......@@ -23,4 +23,5 @@ public class TargetClass {
t.print(false);
t.print(true);
}
}
......@@ -42,4 +42,5 @@ public class DiSLClass {
public static void emptypostcondition() {
System.out.println("..");
}
}
......@@ -3,11 +3,11 @@ package ch.usi.dag.disl.test.suite.bytecodemarker.app;
public class TargetClass {
public static void main(String[] args) {
if(args.length == 0) {
System.out.println(args.length);
}
return;
}
}
......@@ -10,4 +10,5 @@ public class DiSLClass {
public static void precondition(BytecodeStaticContext ba) {
System.out.println(ba.getBytecodeNumber());
}
}
......@@ -3,7 +3,6 @@ package ch.usi.dag.disl.test.suite.cflow.app;
public class TargetClass {
public void foo() {
System.out.println("app: TargetClass.foo() - begin");
goo();
......@@ -25,4 +24,5 @@ public class TargetClass {
c.foo();
c.hoo();
}
}
......@@ -16,7 +16,6 @@ public class DiSLClass {
counter++;
}
@After(marker = BodyMarker.class, scope = "TargetClass.foo()", order=5)
public static void postcondition() {
counter--;
......@@ -30,4 +29,5 @@ public class DiSLClass {
System.out.println("disl: NOT IN CFLOW OF foo() " + sc.thisMethodFullName());
}
}
}
package ch.usi.dag.disl.test.suite.classinfo.app;
public class TargetClass {
public void print(boolean branch) {
System.out.println("app: This is the body of TargetClass.print");
if(branch) {
System.out.println("app: branched");
return;
}
......@@ -23,4 +23,5 @@ public class TargetClass {
t.print(false);
t.print(true);
}
}
package ch.usi.dag.disl.test.suite.dispatch.app;
public class TargetClass {
public void empty() {
......@@ -9,4 +11,5 @@ public class TargetClass {
TargetClass t = new TargetClass();
t.empty();
}
}
......@@ -6,6 +6,7 @@ import ch.usi.dag.dislreserver.shadow.ShadowObject;
import ch.usi.dag.dislreserver.shadow.ShadowString;
import ch.usi.dag.dislreserver.shadow.ShadowThread;
// NOTE that this class is not static anymore
public class CodeExecuted extends RemoteAnalysis {
......@@ -51,7 +52,6 @@ public class CodeExecuted extends RemoteAnalysis {
}
public static void testingAdvanced(final ShadowObject s, final ShadowObject o, final ShadowObject c, final ShadowObject t) {
if(! (s instanceof ShadowString)) {
throw new RuntimeException("This string should be transfered as string");
}
......@@ -87,7 +87,6 @@ public class CodeExecuted extends RemoteAnalysis {
}
public static void printClassInfo(final ShadowClass sc) {
if(sc == null) {
System.out.println("null");
return;
......@@ -126,7 +125,6 @@ public class CodeExecuted extends RemoteAnalysis {
}
public static void testingNull(final ShadowString s, final ShadowObject o, final ShadowClass c) {
if(s != null) {
throw new RuntimeException("String is not null");
}
......@@ -149,6 +147,6 @@ public class CodeExecuted extends RemoteAnalysis {
@Override
public void objectFree(final ShadowObject netRef) {
System.out.println("Object free for id " + netRef.getId());
}
}
......@@ -2,6 +2,7 @@ package ch.usi.dag.disl.test.suite.dispatch.instr;
import ch.usi.dag.dislre.REDispatch;
// Optimally, this class is automatically created on analysis machine
// and redefines during loading the CodeExecuted class on the client vm
......@@ -25,7 +26,6 @@ public class CodeExecutedRE {
"ch.usi.dag.disl.test.suite.dispatch.instr.CodeExecuted.testingNull");
public static void bytecodesExecuted(final int count) {
final byte orderingid = 1;
REDispatch.analysisStart(beId, orderingid);
......@@ -91,4 +91,5 @@ public class CodeExecutedRE {
REDispatch.analysisEnd();
}
}
......@@ -4,6 +4,7 @@ import org.objectweb.asm.tree.AbstractInsnNode;
import ch.usi.dag.disl.staticcontext.AbstractStaticContext;
public class CodeLengthSC extends AbstractStaticContext {
public int methodSize() {
......@@ -11,7 +12,6 @@ public class CodeLengthSC extends AbstractStaticContext {
}
public int codeSize() {
AbstractInsnNode ain = staticContextData.getRegionStart();
int size = 0;
......@@ -28,4 +28,5 @@ public class CodeLengthSC extends AbstractStaticContext {
return size;
}
}
......@@ -6,27 +6,32 @@ import ch.usi.dag.disl.annotation.After;
import ch.usi.dag.disl.marker.BasicBlockMarker;
import ch.usi.dag.disl.marker.BodyMarker;
public class DiSLClass {
@After(marker = BasicBlockMarker.class, scope = "TargetClass.*")
public static void invokedInstr(final CodeLengthSC clsc) {
CodeExecutedRE.bytecodesExecuted(clsc.codeSize());
}
@After(marker = BodyMarker.class, scope = "TargetClass.main")
public static void testing() {
CodeExecutedRE.testingBasic(
true, (byte) 125, 's', (short) 50000, 100000, 10000000000L, 1.5F, 2.5
);
CodeExecutedRE.testingBasic(true, (byte) 125, 's', (short) 50000,
100000, 10000000000L, 1.5F, 2.5);
CodeExecutedRE.testingAdvanced(
"Corect transfer of String", "test", Object.class, Thread.currentThread()
);
CodeExecutedRE.testingAdvanced("Corect transfer of String", "test", Object.class, Thread.currentThread());
CodeExecutedRE.testingAdvanced2(new LinkedList<String>(),
CodeExecutedRE.testingAdvanced2(
new LinkedList<String>(),
new LinkedList<Integer>(), new LinkedList[0], new int[0],
int[].class, int.class, LinkedList.class,
LinkedList.class.getClass());
LinkedList.class.getClass()
);
CodeExecutedRE.testingNull(null, null, null);
}
}
......@@ -2,15 +2,11 @@ package ch.usi.dag.disl.test.suite.dispatch2.app;
public class TargetClass {
public static void main(final String[] args) throws InterruptedException {
final long start = System.nanoTime();
final int COUNT = 2000000;
final TargetClass ta[] = new TargetClass[COUNT];
int i;
for(i = 0; i < COUNT; ++i) {
ta[i] = new TargetClass();
}
......@@ -19,4 +15,5 @@ public class TargetClass {
//System.out.println("Allocated " + i + " objects in "
// + (System.nanoTime() - start) / 1000000 + " ms");
}
}
......@@ -3,6 +3,7 @@ package ch.usi.dag.disl.test.suite.dispatch2.instr;
import ch.usi.dag.dislreserver.remoteanalysis.RemoteAnalysis;
import ch.usi.dag.dislreserver.shadow.ShadowObject;
// NOTE that this class is not static anymore
public class CodeExecuted extends RemoteAnalysis {
......@@ -13,7 +14,6 @@ public class CodeExecuted extends RemoteAnalysis {
long totalFreeEvents = 0;
public void intEvent(final int number) {
if(startTime == 0) {
startTime = System.nanoTime();
}
......@@ -32,7 +32,6 @@ public class CodeExecuted extends RemoteAnalysis {
}
public void objectEvent(final ShadowObject o) {
++totalObjEvents;
}
......@@ -43,7 +42,6 @@ public class CodeExecuted extends RemoteAnalysis {
@Override
public void atExit() {
//System.out.println("Total transport time is "
// + ((System.nanoTime() - startTime) / 1000000) + " ms");
......@@ -56,4 +54,5 @@ public class CodeExecuted extends RemoteAnalysis {
System.out.println("Total number of free events: "
+ totalFreeEvents);
}
}
......@@ -2,6 +2,7 @@ package ch.usi.dag.disl.test.suite.dispatch2.instr;
import ch.usi.dag.dislre.REDispatch;
// Optimally, this class is automatically created on analysis machine
// and redefines during loading the CodeExecuted class on the client vm
......@@ -16,7 +17,6 @@ public class CodeExecutedRE {
"ch.usi.dag.disl.test.suite.dispatch2.instr.CodeExecuted.objectEvent");
public static void intEvent(final int num) {
REDispatch.analysisStart(ieId);
REDispatch.sendInt(num);
......@@ -25,11 +25,11 @@ public class CodeExecutedRE {
}
public static void objectEvent(final Object o) {
REDispatch.analysisStart(oeId);
REDispatch.sendObject(o);
REDispatch.analysisEnd();
}
}
......@@ -8,13 +8,12 @@ public class DiSLClass {
@Before(marker = BytecodeMarker.class, args= "aastore", scope = "TargetClass.*")
public static void invokedInstr(DynamicContext dc) {
CodeExecutedRE.intEvent(dc.getStackValue(1, int.class));
}
@Before(marker = BytecodeMarker.class, args= "aastore", scope = "TargetClass.*")
public static void testing(DynamicContext dc) {
CodeExecutedRE.objectEvent(dc.getStackValue(0, Object.class));
}
}
......@@ -8,4 +8,5 @@ import ch.usi.dag.disl.test.suite.ShadowVmOnlyTest;
@RunWith (JUnit4.class)
public class DispatchLambdaTest extends ShadowVmOnlyTest {
}
package ch.usi.dag.disl.test.suite.dispatchmp.app;
public class TargetClass {
protected static int THREAD_COUNT = 3;
......@@ -8,16 +9,12 @@ public class TargetClass {
@Override
public void run() {
final long start = System.nanoTime();
final int COUNT = 2000000;
final TargetClass ta[] = new TargetClass[COUNT];
int i;
for(i = 0; i < COUNT; ++i) {
for (i = 0; i < COUNT; ++i) {
ta[i] = new TargetClass();
}
......@@ -29,11 +26,11 @@ public class TargetClass {
}
public static void main(final String[] args) throws InterruptedException {
final TCTask task = new TCTask();
for(int i = 0; i < THREAD_COUNT; ++i) {
for (int i = 0; i < THREAD_COUNT; ++i) {
new Thread(task).start();
}
}
}
......@@ -5,6 +5,7 @@ import java.util.concurrent.atomic.AtomicLong;
import ch.usi.dag.dislreserver.remoteanalysis.RemoteAnalysis;
import ch.usi.dag.dislreserver.shadow.ShadowObject;
// NOTE that this class is not static anymore
public class CodeExecuted extends RemoteAnalysis {
......@@ -15,7 +16,6 @@ public class CodeExecuted extends RemoteAnalysis {
AtomicLong totalFreeEvents = new AtomicLong();
public void intEvent(final int number) {
if(startTime == 0) {
startTime = System.nanoTime();
}
......@@ -27,7 +27,6 @@ public class CodeExecuted extends RemoteAnalysis {
}
public void objectEvent(final ShadowObject o) {
totalObjEvents.incrementAndGet();
}
......@@ -38,7 +37,6 @@ public class CodeExecuted extends RemoteAnalysis {
@Override
public void atExit() {
//System.out.println("Total transport time is "
// + ((System.nanoTime() - startTime) / 1000000) + " ms");
......@@ -51,4 +49,5 @@ public class CodeExecuted extends RemoteAnalysis {
System.out.println("Total number of free events: "
+ totalFreeEvents);
}
}
......@@ -2,6 +2,7 @@ package ch.usi.dag.disl.test.suite.dispatchmp.instr;
import ch.usi.dag.dislre.REDispatch;
// Optimally, this class is automatically created on analysis machine
// and redefines during loading the CodeExecuted class on the client vm
......@@ -16,7 +17,6 @@ public class CodeExecutedRE {
"ch.usi.dag.disl.test.suite.dispatchmp.instr.CodeExecuted.objectEvent");
public static void intEvent(final int num) {
REDispatch.analysisStart(ieId);
REDispatch.sendInt(num);
......@@ -25,11 +25,11 @@ public class CodeExecutedRE {
}
public static void objectEvent(final Object o) {
REDispatch.analysisStart(oeId);
REDispatch.sendObject(o);
REDispatch.analysisEnd();
}
}
......@@ -4,17 +4,17 @@ import ch.usi.dag.disl.annotation.Before;
import ch.usi.dag.disl.dynamiccontext.DynamicContext;
import ch.usi.dag.disl.marker.BytecodeMarker;
public class DiSLClass {
@Before(marker = BytecodeMarker.class, args= "aastore", scope = "*TCTask.*")
public static void invokedInstr(DynamicContext dc) {
CodeExecutedRE.intEvent(dc.getStackValue(1, int.class));
}
@Before(marker = BytecodeMarker.class, args= "aastore", scope = "*TCTask.*")
public static void testing(DynamicContext dc) {
CodeExecutedRE.objectEvent(dc.getStackValue(0, Object.class));
}
}
......@@ -2,6 +2,7 @@ package ch.usi.dag.disl.test.suite.dynamiccontext.app;
import java.util.Random;
public class TargetClass {
static final Class <?> STATIC_TYPE = TargetClass.class;
......@@ -34,4 +35,5 @@ public class TargetClass {
printStaticFields ();
new TargetClass().printInstanceFields ();
}
}
......@@ -7,6 +7,7 @@ import ch.usi.dag.disl.marker.BytecodeMarker;
import ch.usi.dag.disl.staticcontext.FieldAccessStaticContext;
import ch.usi.dag.disl.test.suite.dynamiccontext.app.TargetClass;
public class DiSLClass {
/**
......
package ch.usi.dag.disl.test.suite.dynamicinfo.app;
public class TargetClass {
public void test1() {
......@@ -31,4 +32,5 @@ public class TargetClass {
System.out.println("app: calling t.test3(1.0, 2)");
t.test3(1.0, 2);
}
}
......@@ -51,4 +51,5 @@ public class DiSLClass {
System.out.println("disl: " + msc.thisMethodName() + " - this: null");
}
}
}
package ch.usi.dag.disl.test.suite.exception.app;
public class TargetClass {
public void foo(int i, int j) {
......@@ -14,4 +15,5 @@ public class TargetClass {
TargetClass t = new TargetClass();
t.bar();
}
}
......@@ -5,6 +5,7 @@ import ch.usi.dag.disl.annotation.Before;
import ch.usi.dag.disl.marker.BodyMarker;
import ch.usi.dag.disl.marker.BytecodeMarker;
public class DiSLClass {
@Before(marker = BytecodeMarker.class, args = "invokevirtual", scope = "TargetClass.bar")
......@@ -24,4 +25,5 @@ public class DiSLClass {
System.out.println(t.getMessage());
}
}
}
package ch.usi.dag.disl.test.suite.exceptionhandler.app;
public class TargetClass {
public void print(boolean branch) {
......@@ -7,7 +8,9 @@ public class TargetClass {
if (branch) {
throw new Exception();
}
Integer.valueOf("1.0");
} catch (NumberFormatException e) {
System.out.println("app: TargetClass.print(..) - catch:NumberFormatException");
} catch (Exception e) {
......@@ -22,4 +25,5 @@ public class TargetClass {
System.out.println("app: TargetClass.main(..) - .print(true)");
t.print(true);
}
}
......@@ -4,6 +4,7 @@ import ch.usi.dag.disl.annotation.AfterReturning;
import ch.usi.dag.disl.annotation.Before