2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
6 package org.apidesign.codeinjection;
9 import static org.junit.Assert.*;
11 /** Final count down test.
13 * @author Jaroslav Tulach <jtulach@netbeans.org>
15 public class Version10Test {
17 public Version10Test() {
20 /** creates version 1.0 */
21 private static CountDown create(int value) {
22 return new CountDownImplV1(value);
25 // BEGIN: codeinjection.fourtimes
27 public void testDecrementFourTimes() {
28 CountDown counter = create(4);
29 assertFalse("Not down yet", counter.isDown()); counter.down();
30 assertFalse("Not down yet", counter.isDown()); counter.down();
31 assertFalse("Not down yet", counter.isDown()); counter.down();
32 assertFalse("Not down yet", counter.isDown()); counter.down();
33 assertTrue("Down now", counter.isDown());
35 // END: codeinjection.fourtimes