Package com.bluesoft.util.metrics.core

Examples of com.bluesoft.util.metrics.core.Clock


    assertSame( mm.getChild( "child2" ), child2 );
  }

  @Test
  public void testMetering() throws Exception {
    Clock clock = createMock( Clock.class );
    expect( clock.getUnit() ).andStubReturn( TimeUnit.MILLISECONDS );
    expect( clock.getTime() ).andReturn( 0L ).once();
    expect( clock.getTime() ).andReturn( 10L ).once();
    expect( clock.getTime() ).andReturn( 100L ).once();
    expect( clock.getTime() ).andReturn( 1000L ).times( 2 );
    expect( clock.getTime() ).andReturn( 2000L ).times( 2 );
    expect( clock.getTime() ).andReturn( 4000L ).times( 2 );
    expect( clock.getTime() ).andReturn( 5000L ).times( 2 );
    expect( clock.getTime() ).andReturn( 6000L ).times( 2 );
    expect( clock.getTime() ).andReturn( 6500L ).times( 3 );

    replay( clock );
    BasicMeteringMetric mm = new BasicMeteringMetric( "foo" );
    mm.setClock( clock );
View Full Code Here

TOP

Related Classes of com.bluesoft.util.metrics.core.Clock

Copyright © 2018 www.massapicom. 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.