javaclass

Changeset

67:a756605544e7
2004-11-20 Paul Boddie raw files shortlog changelog graph Added new tests.
tests/AbstractClassTest.java (file) tests/ArrayTest.java (file) tests/ConcreteClassTest.java (file) tests/FieldSubclassTest.java (file) tests/MultiArrayTest.java (file) tests/StaticTest.java (file)
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tests/AbstractClassTest.java	Sat Nov 20 21:46:46 2004 +0100
     1.3 @@ -0,0 +1,3 @@
     1.4 +public abstract class AbstractClassTest {
     1.5 +    public static ConcreteClassTest member = new ConcreteClassTest();
     1.6 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/tests/ArrayTest.java	Sat Nov 20 21:46:46 2004 +0100
     2.3 @@ -0,0 +1,11 @@
     2.4 +public class ArrayTest {
     2.5 +    public int[] array;
     2.6 +
     2.7 +    public ArrayTest(int size) {
     2.8 +        array = new int[size];
     2.9 +    }
    2.10 +
    2.11 +    public int get(int index) {
    2.12 +        return array[index];
    2.13 +    }
    2.14 +}
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/tests/ConcreteClassTest.java	Sat Nov 20 21:46:46 2004 +0100
     3.3 @@ -0,0 +1,2 @@
     3.4 +public class ConcreteClassTest extends AbstractClassTest {
     3.5 +}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/tests/FieldSubclassTest.java	Sat Nov 20 21:46:46 2004 +0100
     4.3 @@ -0,0 +1,2 @@
     4.4 +public class FieldSubclassTest extends FieldTest {
     4.5 +}
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/tests/MultiArrayTest.java	Sat Nov 20 21:46:46 2004 +0100
     5.3 @@ -0,0 +1,11 @@
     5.4 +public class MultiArrayTest {
     5.5 +    public int[][] multiArray;
     5.6 +
     5.7 +    public MultiArrayTest(int[] multiSizes) {
     5.8 +        multiArray = new int[multiSizes[0]][multiSizes[1]];
     5.9 +    }
    5.10 +
    5.11 +    public int get(int index1, int index2) {
    5.12 +        return multiArray[index1][index2];
    5.13 +    }
    5.14 +}
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/tests/StaticTest.java	Sat Nov 20 21:46:46 2004 +0100
     6.3 @@ -0,0 +1,30 @@
     6.4 +public class StaticTest {
     6.5 +
     6.6 +    public static StaticTestClass staticMember = StaticTestClass.newInstance();
     6.7 +    public static StaticTestClass staticMember2 = StaticTestClass.newInstance(123);
     6.8 +    public static int staticMember3 = StaticTestClass.getNumber();
     6.9 +}
    6.10 +
    6.11 +class StaticTestClass {
    6.12 +    public int x;
    6.13 +
    6.14 +    public StaticTestClass() {
    6.15 +        x = 321;
    6.16 +    }
    6.17 +
    6.18 +    public StaticTestClass(int x) {
    6.19 +        this.x = x;
    6.20 +    }
    6.21 +
    6.22 +    public static StaticTestClass newInstance() {
    6.23 +        return new StaticTestClass();
    6.24 +    }
    6.25 +
    6.26 +    public static StaticTestClass newInstance(int x) {
    6.27 +        return new StaticTestClass(x);
    6.28 +    }
    6.29 +
    6.30 +    public static int getNumber() {
    6.31 +        return 456;
    6.32 +    }
    6.33 +}