Last change
on this file was
120,
checked in by (none), 14 years ago
|
Added the mail files for the Hadoop JUNit Project
|
-
Property svn:executable set to
*
|
File size:
653 bytes
|
Line | |
---|
1 | import org.junit.Test; |
---|
2 | import org.junit.runner.RunWith; |
---|
3 | import static org.junit.Assert.*; |
---|
4 | |
---|
5 | class X { |
---|
6 | static int three() { |
---|
7 | return 3; |
---|
8 | } |
---|
9 | }; |
---|
10 | |
---|
11 | @RunWith(HadoopRunner.class) |
---|
12 | public class TestAdd { |
---|
13 | |
---|
14 | @Test |
---|
15 | public void testAdd() { |
---|
16 | assertEquals(1 + 1, 2); |
---|
17 | } |
---|
18 | @Test |
---|
19 | public void testSub() { |
---|
20 | assertEquals(1 - 1, 0); |
---|
21 | } |
---|
22 | @Test |
---|
23 | public void testMul() { |
---|
24 | /* Should fail. */ |
---|
25 | assertEquals(1 * 1, 0); |
---|
26 | } |
---|
27 | |
---|
28 | @Test(timeout=2500) |
---|
29 | public void testTimeout() { |
---|
30 | /* Should fail. */ |
---|
31 | while (true) |
---|
32 | ; |
---|
33 | } |
---|
34 | |
---|
35 | @Test |
---|
36 | public void testX() { |
---|
37 | /* Should fail. */ |
---|
38 | assertEquals(X.three(), 2); |
---|
39 | } |
---|
40 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.