Commit eb3ad0c7 authored by Kyle Muldoon's avatar Kyle Muldoon

added tests that throw exceptions

parent c6ed808c
...@@ -22,6 +22,24 @@ public class SampleTest extends TestResult { ...@@ -22,6 +22,24 @@ public class SampleTest extends TestResult {
assertEquals( (a + b), 30 ); assertEquals( (a + b), 30 );
} }
@org.junit.Test(timeout = 500)
public void WithDelay() throws InterruptedException {
int a = 10;
int b = 20;
Thread.sleep(1000);
assertEquals( (a + b), 30 );
}
@org.junit.Test(expected = ArithmeticException.class)
public void withException() {
int a = 10;
int b = 20;
int res = a + b;
throw new ArithmeticException("some error happened");
}
public synchronized void stop() { public synchronized void stop() {
// stop test here // stop test here
} }
......
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