Code example for AtomicInteger

Methods: get

0
 */ 
public class CompleteEventTest { 
     
    @Test 
    public void testSuccess(){ 
        AtomicInteger completeNumber = new AtomicInteger(0);
        CompleteEvent event = new CompleteEvent(completeNumber);
        event.success("");
        Assert.assertEquals(1, completeNumber.get());
    } 
     
    @Test 
    public void error(){ 
        AtomicInteger completeNumber = new AtomicInteger(0);
        CompleteEvent event = new CompleteEvent(completeNumber);
        event.error(new TaskException("test exception"));
        Assert.assertEquals(1, completeNumber.get());
    } 
}