jtulach@303: /* jtulach@303: * To change this template, choose Tools | Templates jtulach@303: * and open the template in the editor. jtulach@303: */ jtulach@303: jtulach@303: package org.apidesign.codeinjection; jtulach@303: jtulach@303: import org.junit.Test; jtulach@303: import static org.junit.Assert.*; jtulach@303: jtulach@303: /** Final count down test. jtulach@303: * jtulach@303: * @author Jaroslav Tulach jtulach@303: */ jtulach@303: public class Version10Test { jtulach@303: jtulach@303: public Version10Test() { jtulach@303: } jtulach@303: jtulach@303: /** creates version 1.0 */ jtulach@303: private static CountDown create(int value) { jtulach@303: return new CountDownImplV1(value); jtulach@303: } jtulach@303: jtulach@303: @Test jtulach@303: public void testDecrementFourTimes() { jtulach@303: CountDown counter = create(4); jtulach@303: assertFalse("Not down yet", counter.isDown()); counter.down(); jtulach@303: assertFalse("Not down yet", counter.isDown()); counter.down(); jtulach@303: assertFalse("Not down yet", counter.isDown()); counter.down(); jtulach@303: assertFalse("Not down yet", counter.isDown()); counter.down(); jtulach@303: assertTrue("Down now", counter.isDown()); jtulach@303: } jtulach@303: }