Package jdbm.recman

Source Code of jdbm.recman.TestLargeData

package jdbm.recman;

import java.io.IOException;

import jdbm.RecordManager;

public class TestLargeData extends TestCaseWithTestFile{

  public void testLargeData() throws IOException{
         
    RecordManager recman = new BaseRecordManager(newTestFile());
   
    byte[] data = UtilTT.makeRecord(1000000, (byte) 12);
    final long id = recman.insert(data);   
    data = (byte[]) recman.fetch(id);
    UtilTT.checkRecord(data, 1000000, (byte) 12);
    recman.commit();

    data = UtilTT.makeRecord(2000000, (byte) 13);
    recman.update(id, data);
    recman.commit();
    data = (byte[]) recman.fetch(id);
    UtilTT.checkRecord(data, 2000000, (byte) 13);
    recman.commit();

    data = UtilTT.makeRecord(1500000, (byte) 14);
    recman.update(id, data);   
    data = (byte[]) recman.fetch(id);
    UtilTT.checkRecord(data, 1500000, (byte) 14);
    recman.commit();
   
    data = UtilTT.makeRecord(2500000, (byte) 15);
    recman.update(id, data)
    recman.rollback();
    data = (byte[]) recman.fetch(id);
    UtilTT.checkRecord(data, 1500000, (byte) 14);
    recman.commit();

    data = UtilTT.makeRecord(1, (byte) 20);
    recman.update(id, data);   
    data = (byte[]) recman.fetch(id);
    UtilTT.checkRecord(data, 1, (byte) 20);
    recman.commit();
       
   
  }
 
}
TOP

Related Classes of jdbm.recman.TestLargeData

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.