ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/etc/testcases/SampleTest.java
Revision: 1.2
Committed: Wed Dec 11 21:40:56 2002 UTC (21 years, 5 months ago) by tim
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
State: FILE REMOVED
Log Message:
Put jsr166 jar on bootclasspath for testing.
Remove sample test and replace with simple tests of jsr166 classes.

File Contents

# Content
1 // root package
2
3 import junit.framework.TestCase;
4
5 /**
6 * A test case to check whether the Ant junit tasks
7 * are working. Requires JUnit 1.8 or later.
8 */
9 public class SampleTest extends TestCase {
10
11 interface Binop<Op1, Op2, Result> {
12 Result apply (Op1 op1, Op2 op2);
13 }
14
15 static class Add implements Binop<Integer, Integer, Integer> {
16 public Integer apply (Integer a, Integer b) {
17 return new Integer(a.intValue() + b.intValue());
18 }
19 }
20
21 public void testSomething () throws Exception {
22 Binop<Integer, Integer, Integer> adder = new Add();
23 Integer TWO = new Integer(2);
24 assertEquals("2 plus 2 should equal 5", 5, adder.apply(TWO, TWO).intValue());
25 }
26 }