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(5); @SuppressWarnings("unused") private final void sleep() { try { //while(true) //Uncomment for real non-termination Thread.sleep(5000); //Sleep to simulate non-termination } catch (InterruptedException e) { Thread.currentThread().interrupt(); //rethrow, never swallow InterruptedException! } } 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; } public int deletedSpec_spec(int x) { int y = deletedSpec(x); assert y == 5+x; return y; } public int nonterminatingMethod(int x) { 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); 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; } }