diff -r 000000000000 -r 77b6002451c4 samples/codeinjection/test/org/apidesign/codeinjection/Version10Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/samples/codeinjection/test/org/apidesign/codeinjection/Version10Test.java Sat Jan 10 21:29:22 2009 +0100 @@ -0,0 +1,34 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package org.apidesign.codeinjection; + +import org.junit.Test; +import static org.junit.Assert.*; + +/** Final count down test. + * + * @author Jaroslav Tulach + */ +public class Version10Test { + + public Version10Test() { + } + + /** creates version 1.0 */ + private static CountDown create(int value) { + return new CountDownImplV1(value); + } + + @Test + public void testDecrementFourTimes() { + CountDown counter = create(4); + assertFalse("Not down yet", counter.isDown()); counter.down(); + assertFalse("Not down yet", counter.isDown()); counter.down(); + assertFalse("Not down yet", counter.isDown()); counter.down(); + assertFalse("Not down yet", counter.isDown()); counter.down(); + assertTrue("Down now", counter.isDown()); + } +} \ No newline at end of file