Package org.apache.excalibur.instrument

Examples of org.apache.excalibur.instrument.CounterInstrument.increment()


        ci.setInstrumentProxy( proxy );
        proxy.activate();

        assertEquals( "The instrument should br active.", ci.isActive(), true );
       
        ci.increment( 1 );
       
        assertEquals( "The expected count was incorrect.", proxy.getValue(), 1 );
    }
}
View Full Code Here


    public void testSimpleIncrementDisconnected() throws Exception
    {
        CounterInstrument ci = new CounterInstrument( "testInstrument" );
        assertEquals( "A disconnected instrument should not be active.", ci.isActive(), false );
       
        ci.increment( 1 );
    }
   
    public void testCount1IncrementDisconnected() throws Exception
    {
        CounterInstrument ci = new CounterInstrument( "testInstrument" );
View Full Code Here

    public void testCount1IncrementDisconnected() throws Exception
    {
        CounterInstrument ci = new CounterInstrument( "testInstrument" );
        assertEquals( "A disconnected instrument should not be active.", ci.isActive(), false );
       
        ci.increment( 1 );
    }
   
    public void testCount0IncrementDisconnected() throws Exception
    {
        CounterInstrument ci = new CounterInstrument( "testInstrument" );
View Full Code Here

    public void testCount0IncrementDisconnected() throws Exception
    {
        CounterInstrument ci = new CounterInstrument( "testInstrument" );
        try
        {
            ci.increment( 0 );
            fail( "calling increment with a count of 0 should fail." );
        }
        catch ( IllegalArgumentException e )
        {
            // Ok
View Full Code Here

    public void testCountNegIncrementDisconnected() throws Exception
    {
        CounterInstrument ci = new CounterInstrument( "testInstrument" );
        try
        {
            ci.increment( -1 );
            fail( "calling increment with a negative count should fail." );
        }
        catch ( IllegalArgumentException e )
        {
            // Ok
View Full Code Here

        TestInstrumentProxy proxy = new TestInstrumentProxy();
        ci.setInstrumentProxy( proxy );
       
        assertEquals( "The instrument should not be active.", ci.isActive(), false );
       
        ci.increment();
       
        assertEquals( "The expected count was incorrect.", proxy.getValue(), 1 );
       
        ci.increment();
        assertEquals( "The expected count was incorrect.", proxy.getValue(), 2 );
View Full Code Here

       
        ci.increment();
       
        assertEquals( "The expected count was incorrect.", proxy.getValue(), 1 );
       
        ci.increment();
        assertEquals( "The expected count was incorrect.", proxy.getValue(), 2 );
    }
   
    public void testCount1IncrementConnectedInactive() throws Exception
    {
View Full Code Here

        TestInstrumentProxy proxy = new TestInstrumentProxy();
        ci.setInstrumentProxy( proxy );
       
        assertEquals( "The instrument should not be active.", ci.isActive(), false );
       
        ci.increment( 1 );
       
        assertEquals( "The expected count was incorrect.", proxy.getValue(), 1 );
       
        ci.increment( 2 );
        assertEquals( "The expected count was incorrect.", proxy.getValue(), 3 );
View Full Code Here

       
        ci.increment( 1 );
       
        assertEquals( "The expected count was incorrect.", proxy.getValue(), 1 );
       
        ci.increment( 2 );
        assertEquals( "The expected count was incorrect.", proxy.getValue(), 3 );
    }
   
    public void testSimpleIncrementConnectedActive() throws Exception
    {
View Full Code Here

        ci.setInstrumentProxy( proxy );
        proxy.activate();
       
        assertEquals( "The instrument should br active.", ci.isActive(), true );
       
        ci.increment();
       
        assertEquals( "The expected count was incorrect.", proxy.getValue(), 1 );
    }
   
    public void testCount1IncrementConnectedActive() throws Exception
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.