samples/codeinjection/test/org/apidesign/codeinjection/Version10Test.java
changeset 303 77b6002451c4
child 305 e6b3dc7d5795
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/samples/codeinjection/test/org/apidesign/codeinjection/Version10Test.java	Sat Jan 10 21:29:22 2009 +0100
     1.3 @@ -0,0 +1,34 @@
     1.4 +/*
     1.5 + * To change this template, choose Tools | Templates
     1.6 + * and open the template in the editor.
     1.7 + */
     1.8 +
     1.9 +package org.apidesign.codeinjection;
    1.10 +
    1.11 +import org.junit.Test;
    1.12 +import static org.junit.Assert.*;
    1.13 +
    1.14 +/** Final count down test.
    1.15 + *
    1.16 + * @author Jaroslav Tulach <jtulach@netbeans.org>
    1.17 + */
    1.18 +public class Version10Test {
    1.19 +
    1.20 +    public Version10Test() {
    1.21 +    }
    1.22 +
    1.23 +    /** creates version 1.0 */
    1.24 +    private static CountDown create(int value) {
    1.25 +        return new CountDownImplV1(value);
    1.26 +    }
    1.27 +
    1.28 +    @Test
    1.29 +    public void testDecrementFourTimes() {
    1.30 +        CountDown counter = create(4);
    1.31 +        assertFalse("Not down yet", counter.isDown()); counter.down();
    1.32 +        assertFalse("Not down yet", counter.isDown()); counter.down();
    1.33 +        assertFalse("Not down yet", counter.isDown()); counter.down();
    1.34 +        assertFalse("Not down yet", counter.isDown()); counter.down();
    1.35 +        assertTrue("Down now", counter.isDown());
    1.36 +    }
    1.37 +}
    1.38 \ No newline at end of file