package Examples; /** * An example to test how T2 handles obsolete test cases. * * * @author Jeiel Schalkwijk * */ public class ObsoleteTest { //public Integer deletedField = Integer.valueOf(5); public Integer typeModField = Integer.valueOf(30000); //public String typeModField = "5"; private static final long sleepLength = 5; private final void sleep() { try { //while(true) //Uncomment for real non-termination Thread.sleep(sleepLength); //Sleep to simulate non-termination } catch (InterruptedException e) { Thread.currentThread().interrupt(); //rethrow, never swallow InterruptedException! } } /* DELETED METHOD+SPEC, (we can't delete a method without deleting the spec). * public int deletedMethod(int x) { return 5+x; } public int deletedMethod_spec(int x) { int y = deletedMethod(x); assert y == 5+x; return y; } */ public int deletedSpec(int x) { return 5+x; } /* DELETED SPEC * public int deletedSpec_spec(int x) { int y = deletedSpec(x); assert y == 5+x; return y; } */ public int nonterminatingMethod(int x) { // sleep(); return 5+x; } public int nonterminatingMethod_spec(int x) { int y = nonterminatingMethod(x); assert y == 5+x; return y; } public int nonterminatingSpec(int x) { return 5+x; } public int nonterminatingSpec_spec(int x) { int y = nonterminatingSpec(x); // sleep(); assert y == 5+x; return y; } public int filler1(int x) { return 5+x; } public int filler2(int x) { return 5+x; } public int filler3(int x) { return 5+x; } public int filler4(int x) { return 5+x; } }