author | Jaroslav Tulach <jtulach@netbeans.org> |
Sat, 10 Jan 2009 22:34:11 +0100 | |
changeset 305 | e6b3dc7d5795 |
parent 303 | 77b6002451c4 |
permissions | -rw-r--r-- |
jtulach@303 | 1 |
/* |
jtulach@303 | 2 |
* To change this template, choose Tools | Templates |
jtulach@303 | 3 |
* and open the template in the editor. |
jtulach@303 | 4 |
*/ |
jtulach@303 | 5 |
|
jtulach@303 | 6 |
package org.apidesign.codeinjection; |
jtulach@303 | 7 |
|
jtulach@303 | 8 |
import org.junit.Test; |
jtulach@303 | 9 |
import static org.junit.Assert.*; |
jtulach@303 | 10 |
|
jtulach@303 | 11 |
/** Final count down test. |
jtulach@303 | 12 |
* |
jtulach@303 | 13 |
* @author Jaroslav Tulach <jtulach@netbeans.org> |
jtulach@303 | 14 |
*/ |
jtulach@303 | 15 |
public class Version10Test { |
jtulach@303 | 16 |
|
jtulach@303 | 17 |
public Version10Test() { |
jtulach@303 | 18 |
} |
jtulach@303 | 19 |
|
jtulach@303 | 20 |
/** creates version 1.0 */ |
jtulach@303 | 21 |
private static CountDown create(int value) { |
jtulach@303 | 22 |
return new CountDownImplV1(value); |
jtulach@303 | 23 |
} |
jtulach@303 | 24 |
|
jtulach@305 | 25 |
// BEGIN: codeinjection.fourtimes |
jtulach@303 | 26 |
@Test |
jtulach@303 | 27 |
public void testDecrementFourTimes() { |
jtulach@303 | 28 |
CountDown counter = create(4); |
jtulach@303 | 29 |
assertFalse("Not down yet", counter.isDown()); counter.down(); |
jtulach@303 | 30 |
assertFalse("Not down yet", counter.isDown()); counter.down(); |
jtulach@303 | 31 |
assertFalse("Not down yet", counter.isDown()); counter.down(); |
jtulach@303 | 32 |
assertFalse("Not down yet", counter.isDown()); counter.down(); |
jtulach@303 | 33 |
assertTrue("Down now", counter.isDown()); |
jtulach@303 | 34 |
} |
jtulach@305 | 35 |
// END: codeinjection.fourtimes |
jtulach@305 | 36 |
} |