Examples of used()


Examples of etch.util.core.nio.History.used()

    // newUsed < 0
    History h = new History( 0, 10, 5 );
    checkUsedAlloc( h, 0, 0 );
    h.used( 1 );
    checkUsedAlloc( h, 1, 0 );
    h.used( -2 );
  }
 
  /** @throws Exception */
  @Test
  public void used8() throws Exception
View Full Code Here

Examples of etch.util.core.nio.History.used()

  @Test
  public void used8() throws Exception
  {
    History h = new History( 0, 10, 5 );
    checkUsedAlloc( h, 0, 0 );
    h.used( 1 );
    checkUsedAlloc( h, 1, 0 );
    try
    {
      h.used( -2 );
      fail( "never reached" );
View Full Code Here

Examples of etch.util.core.nio.History.used()

    checkUsedAlloc( h, 0, 0 );
    h.used( 1 );
    checkUsedAlloc( h, 1, 0 );
    try
    {
      h.used( -2 );
      fail( "never reached" );
    }
    catch ( IllegalStateException e )
    {
      // make sure used was not adjusted...
View Full Code Here

Examples of etch.util.core.nio.History.used()

  @Test( expected = IllegalArgumentException.class )
  public void used9() throws Exception
  {
    // k == 0
    History h = new History( 0, 10, 5 );
    h.used( 0 );
  }
 
  /** @throws Exception */
  @Test
  public void alloc1() throws Exception
View Full Code Here

Examples of etch.util.core.nio.History.used()

  public void suggested3() throws Exception
  {
    History h = new History( 0, 10, 5 );
    assertEquals( 0, h.suggested() );
   
    assertTrue( h.used( 10 ) );
    assertEquals( 10, h.getUsed() );
   
    assertEquals( 0, h.suggested() ); // avg(0, 0, 0, 0, 0) == 0
    h.tickle();
    assertEquals( 2, h.suggested() ); // avg(10, 0, 0, 0, 0) == 2
View Full Code Here

Examples of etch.util.core.nio.History.used()

    h.tickle();
    assertEquals( 10, h.suggested() ); // avg(10, 10, 10, 10, 10) == 10
    h.tickle();
    assertEquals( 10, h.suggested() ); // avg(10, 10, 10, 10, 10) == 10
   
    assertTrue( h.used( -10 ) );
    assertEquals( 0, h.getUsed() );
   
    h.tickle();
    assertEquals( 10, h.suggested() ); // avg(10, 10, 10, 10, 10) == 10
    h.tickle();
View Full Code Here

Examples of etch.util.core.nio.History.used()

  public void suggested4() throws Exception
  {
    History h = new History( 2, 10, 5 );
    assertEquals( 2, h.suggested() );
   
    assertTrue( h.used( 10 ) );
    assertEquals( 10, h.getUsed() );
   
    assertEquals( 2, h.suggested() ); // avg(2, 2, 2, 2, 2) == 2
    h.tickle();
    assertEquals( 3, h.suggested() ); // avg(10, 2, 2, 2, 2) == 3
View Full Code Here

Examples of net.sf.sahi.playback.RequestCredentials.used()

  }
 
  public RequestCredentials getMatchingCredentials(String realm, String scheme){
    String key = Utils.isBlankOrNull(realm) ? scheme : realm;
    RequestCredentials cred = requestCredentials.get(key.trim());
    if (cred == null || cred.used()) return null;
    return cred;
  }

  public boolean isRecording() {
    return isRecording;
View Full Code Here

Examples of org.directmemory.memory.OffHeapMemoryBuffer.used()

    logger.info("size=" + size);
   
    Pointer p = mem.store(new byte[size]);
    assertNotNull(p);
    assertEquals(size,p.end);
    assertEquals(size, mem.used());
    mem.free(p);
    assertEquals(0, mem.used());   
  }
 
View Full Code Here

Examples of org.directmemory.memory.OffHeapMemoryBuffer.used()

    Pointer p = mem.store(new byte[size]);
    assertNotNull(p);
    assertEquals(size,p.end);
    assertEquals(size, mem.used());
    mem.free(p);
    assertEquals(0, mem.used());   
  }
 


 
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.