forked from TesterViera/JavaLibWorld
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWorldTests.java
More file actions
69 lines (56 loc) · 1.95 KB
/
WorldTests.java
File metadata and controls
69 lines (56 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import java.io.*;
import java.lang.reflect.Array;
import tester.Tester;
import funworldtests.*;
import impworldtests.*;
import tunestests.*;
import worldimagestests.ExamplesImageDrawings;
import worldimagestests.ExamplesImageMethods;
import worldimagestests.ExamplesTextImages;
public class WorldTests{
static int n;
static Object blobExamples = BlobWorldFun.examplesInstance;
// static Object tickyTackExamples = TickyTackFun.examplesInstance;
static Object[] examples = new Object[]{
BlobWorldFun.examplesInstance,
// TickyTackFun.examplesInstance,
BlobWorldImp.examplesInstance,
TickyTackImp.examplesInstance,
ExamplesNoteTests.examplesInstance,
ExamplesChordTests.examplesInstance,
ExamplesSoundTests.examplesInstance,
ExamplesTuneBucketTests.examplesInstance,
ExamplesTuneTests.examplesInstance,
ExamplesImageDrawings.examplesInstance,
ExamplesImageMethods.examplesInstance,
ExamplesTextImages.examplesInstance
};
/**
* Run the tests in the given <code>Examples</code> class.
*
* @param obj an instance of the <code>Examples</code> class
*/
public static void runTests(Object obj){
String className = obj.getClass().getName();
try{
System.out.println("\n**********************" +
"\n* Tests for the class: " + className +
"\n**********************" +
"\nPress return to start:\n");
n = System.in.read();
Tester.runReport(obj, false, false);
}
catch(IOException e){
System.out.println("IO error when running tests for " + className +
"\n " + e.getMessage());
}
}
/** main: an alternative way of starting the world and running the tests */
public static void main(String[] argv){
for (int i = 0; i < Array.getLength(examples); i++){
runTests(examples[i]);
}
//runTests(blobExamples);
//runTests(tickyTackExamples);
}
}