CS311 Homework 6 Tests
Coverage Status
- ✓ IGraph Implementation
- ✓ Topological Sort
- ✓ Parallel Precedence-Constrained Scheduling
- ✓ Maximum Flow
- ✓ Maximum Flow with Vertex Capacities
- ✓ Maximum Cardinality Pairwise Vertex-Disjoint Paths
Requirements/Dependencies
- Java 6 or Java 7
- JUnit 4.11
- Hamcrest 1.3
The jars are included in the repo.
Note:
It's important to use JUnit 4.11 and Hamcrest 1.3. If you don't, there will more than likely be errors. To see what versions are being used, look at this answer on StackOverflow: http://stackoverflow.com/a/10779224/2337627.
Downloading
To use these tests, just use Git and clone them into the directory you have your project.
You can do this using:
git clone https://github.com/jdavis/cs311-f13-hw06-tests.git tests
Running the Tests
From the Command Line
If you compile things from the command line and have ant installed: http://ant.apache.org/, you only have to modify a few lines to make it work.
-
First, open up
build.xml
and modify the property with the namesrc.dir
. It should point to the directory that your package lives in. -
Open up the
TestRunner.java
file and edit all the methods that start withnew[...]
to point to your implementation classes.-
You should change
return new Graph();
such thatGraph
is the class you wrote that implementsIGraph
. -
You should change
return new TopologicalSortAlgorithms();
such thatTopologicalSortAlgorithms
is the class you wrote that implementsITopologicalSortAlgorithms
. -
You should change
return new MaxFlowAlgorithms();
such thatMaxFlowAlgorithms
is the class you wrote that implementsIMaxFlowAlgorithms
.
-
-
Now you should just be able to run
ant test
on the command line.
From an IDE
- Uninstall your IDE.
- Open up a terminal.
- Go to the previous section.
- Done.
For real though, I don't use an IDE so I have no idea how to get them to work in Eclipse/IntelliJ. Let me know if you figure it out, or better yet, fork it and make a pull request.
Additional Things
This ant build.xml
file contains a few targets:
ant init
ant build
ant build-test
ant test
ant clean
More than likely you'll only have to run clean and test.
Tips
To make debugging easier when using these tests, I highly suggest you add this method to your Pair class in your IGraph interface:
public class Pair<X, Y> {
// ...
@Override
public String toString() {
return "" + first + " -> " + second;
}
// ...
}
Contributing
Feel free to Fork this repo and make changes. Just issue a pull request and I'll add in your tests/changes.