Try multiple instances of the same class and make sure they don't influence their variables
1.1 --- a/src/test/java/org/apidesign/java4browser/Instance.java Wed Sep 19 19:57:45 2012 +0200
1.2 +++ b/src/test/java/org/apidesign/java4browser/Instance.java Wed Sep 19 20:22:12 2012 +0200
1.3 @@ -42,9 +42,11 @@
1.4 i.b = (byte)0x09;
1.5 return (i.i - i.b) * i.d;
1.6 }
1.7 - public static byte virtualBytes() {
1.8 + public static int virtualBytes() {
1.9 Instance i = new InstanceSub(7, 2.2d);
1.10 i.setByte((byte)0x0a);
1.11 - return i.getByte();
1.12 + Instance i2 = new Instance(3, 333.0d);
1.13 + i2.setByte((byte)44);
1.14 + return i.getByte() + i2.getByte();
1.15 }
1.16 }
2.1 --- a/src/test/java/org/apidesign/java4browser/InstanceTest.java Wed Sep 19 19:57:45 2012 +0200
2.2 +++ b/src/test/java/org/apidesign/java4browser/InstanceTest.java Wed Sep 19 20:22:12 2012 +0200
2.3 @@ -37,9 +37,9 @@
2.4 }
2.5 @Test public void verifyInstanceMethods() throws Exception {
2.6 assertExec(
2.7 - "Should be eleven as we invoke overwritten method",
2.8 - "org_apidesign_java4browser_Instance_virtualBytesB",
2.9 - Double.valueOf(11)
2.10 + "Should be eleven as we invoke overwritten method, plus 44",
2.11 + "org_apidesign_java4browser_Instance_virtualBytesI",
2.12 + Double.valueOf(55)
2.13 );
2.14 }
2.15