-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDriver.java
More file actions
40 lines (39 loc) · 1.32 KB
/
Copy pathDriver.java
File metadata and controls
40 lines (39 loc) · 1.32 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
/**
* Tests functionalities of classes by reading from testPool.txt
* @author Jesse Clegg
* @version 1.0
*/
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
public class Driver {
/*
* Runs the testing protolol on startup
*/
public static void main(String[] args) throws IOException {
printTestingPool();
}
/*
* Executes testing from testingPool.txt alongside original data for accurate verification
*/
public static void printTestingPool() throws IOException {
List<String> lines = Files.readAllLines(Paths
.get("/Users/jc/eclipse-workspace/projectOne311/afterOfficeHoursTry/TuesdaysShot/bin/testingPool.txt"));
ArrayList<Node> traversalList = new ArrayList<Node>();
int lineNumber = 1;
for (int i = 0; i < lines.size(); i++) {
ExpressionTree tree = new ExpressionTree(lines.get(i));
System.out.println();
System.out.println("Original infixExpression: "+lines.get(i));
System.out.print(tree);
ExpressionTree tree2 = new ExpressionTree(lines.get(i));
System.out.println();
System.out.println(tree.getRoot().toString());
System.out.println("testing are trees = " + tree.equals(tree2));
System.out.println("testing are roots = "+tree.getRoot().equals(tree2.getRoot()));
}
}
}