Package org.codehaus.activemq.journal

Examples of org.codehaus.activemq.journal.RecordLocation


          deleteDir(logDirectory);
        assertTrue( !logDirectory.exists() );
    }
   
    public void testLogFileCreation() throws IOException {
      RecordLocation mark = journal.getMark();
      assertNull(mark);
    }
View Full Code Here


      assertNull(mark);
    }
   
    public void testAppendAndRead() throws InvalidRecordLocationException, InterruptedException, IOException {
      byte data1[] = "Hello World 1".getBytes();
      RecordLocation location1 = journal.write( data1, false);
      byte data2[] = "Hello World 2".getBytes();
      RecordLocation location2 = journal.write( data2, false);
      byte data3[] = "Hello World 3".getBytes();
      RecordLocation location3 = journal.write( data3, false);
     
      // Now see if we can read that data.
      byte[] data;
      data = journal.read(location2);
      assertEquals( data2, data);
      data = journal.read(location1);
      assertEquals( data1, data);
      data = journal.read(location3);
      assertEquals( data3, data);
     
      // Can we cursor the data?
      RecordLocation l=journal.getNextRecordLocation(null);
      assertEquals(0, l.compareTo(location1));
      data = journal.read(l);
      assertEquals( data1, data);

      l=journal.getNextRecordLocation(l);
      assertEquals(0, l.compareTo(location2));
      data = journal.read(l);
      assertEquals( data2, data);

      l=journal.getNextRecordLocation(l);
      assertEquals(0, l.compareTo(location3));
      data = journal.read(l);
      assertEquals( data3, data);
     
      l=journal.getNextRecordLocation(l);
      assertNull(l);
View Full Code Here

TOP

Related Classes of org.codehaus.activemq.journal.RecordLocation

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.