Commit c6ed808c authored by Kyle Muldoon's avatar Kyle Muldoon

added sample test suite class

parent ba08399e
import org.junit.Test;
import junit.framework.AssertionFailedError;
import junit.framework.Test;
import junit.framework.TestResult;
import static org.junit.Assert.*;
public class SampleTest {
public class SampleTest extends TestResult {
public synchronized void addError(Test test, Throwable t) {
super.addError((junit.framework.Test) test, t);
}
public synchronized void addFailure(Test test, AssertionFailedError t) {
super.addFailure((junit.framework.Test) test, t);
}
@org.junit.Test
public void testAdd() {
int a = 10;
int b = 20;
@Test
public void testAdd() {
assertEquals( (a + b), 30 );
}
public synchronized void stop() {
// stop test here
}
}
//public class SampleTest {
// int a = 10;
// int b = 20;
//
// @Test
// public void testAdd() {
// assertEquals( (a + b), 30 );
// }
//}
import junit.framework.TestResult;
import junit.framework.TestSuite;
public class SampleTestSuite {
public static void main(String[] arg) {
TestSuite suite = new TestSuite(SampleTest.class, SampleTest.class);
TestResult result = new TestResult();
suite.run(result);
System.out.printf("Number of test cases = %s", result.runCount());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment