Package com.llfix.util

Examples of com.llfix.util.DiskQueue


public class TestDiskQueue {

  @Test
  public void basicTest() throws Exception{
    DiskQueue d = DiskQueue.getInstance("test.fix");
    d.offer("hello world");
    d.offer("hello world");
    d.close();
   
    DiskQueue e = DiskQueue.getInstance("test.fix");
   
    out.println("BEFORE========");
   
    for(String s : e){
      out.println(s);
    }
   
    e.offer("world hello");
    e.offer("world hello");
   
    out.println("AFTER========");
   
    for(String s : e){
      out.println(s);
    }
    e.close();
  }
View Full Code Here


    e.close();
  }
 
  @Test
  public void duplicateTest() throws Exception{
      DiskQueue d = DiskQueue.getInstance("test.fix");
      d.offer("hello world");
      d.offer("hello world");
      d.offer("hello world");
      d.offer("hello world");
      d.offer("hello world");
      d.offer("hello world");
      d.offer("hello world");
      d.offer("hello world");
      //d.close();
     
      DiskQueue e = DiskQueue.getInstance("test.fix");
      e.offer("world hello");
      e.offer("world hello");
      e.offer("world hello");
      e.offer("world hello");
      e.offer("world hello");
      e.offer("world hello");
      e.offer("world hello");
     
      d.offer("world hello");

  }
View Full Code Here

TOP

Related Classes of com.llfix.util.DiskQueue

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.