1
package com.clarkware.junitperf;
3
import junit.framework.TestCase;
5
public class MockTest extends TestCase {
7
public MockTest(String name) {
11
public void testSuccess() {
14
public void testFailure() {
18
public void testError() {
19
throw new RuntimeException();
22
public void testOneSecondExecutionTime() throws Exception {
26
public void testOneSecondExecutionTimeWithFailure() throws Exception {
31
public void testInfiniteExecutionTime() {
36
public void testLongExecutionTime() {
39
} catch (InterruptedException ignored) {}
42
public void testAtomic2SecondResponseWithWorkerThread() {
44
Thread t = new Thread(new Runnable() {
48
} catch (InterruptedException ignored) {}
56
// don't wait for worker thread to finish
57
} catch (InterruptedException ignored) {}
60
public void testNonAtomic2SecondResponseWithWorkerThread() {
62
Thread t = new Thread(new Runnable() {
66
} catch (InterruptedException ignored) {}
75
// wait for worker thread to finish
78
} catch (InterruptedException ignored) {}
81
public void testRogueThread() {
83
Thread t = new Thread(new Runnable() {
88
} catch (Exception ignored) {}