blob: 9afc9139ef8bd7bb5a0f0a915f6edaa89a7a727e [file] [log] [blame]
tom931af4e2014-09-13 12:00:57 -07001package org.onlab.junit;
2
3import org.junit.Test;
4
5import static org.junit.Assert.*;
6import static org.onlab.junit.TestTools.assertAfter;
7
8public class TestToolsTest {
9
10 @Test
11 public void testSuccess() {
12 assertAfter(10, 100, new Runnable() {
13 int count = 0;
14 @Override
15 public void run() {
16 if (count++ < 3) {
17 assertTrue(false);
18 }
19 }
20 });
21 }
22
23 @Test(expected = AssertionError.class)
24 public void testFailure() {
25 assertAfter(100, new Runnable() {
26 @Override
27 public void run() {
28 assertTrue(false);
29 }
30 });
31 }
32}