Package org.gdbms.engine.data

Examples of org.gdbms.engine.data.AlphanumericDataSource.beginTrans()


        ds.getDataSource("persona",
                DataSourceFactory.UNDOABLE);
        Value v2 = ValueFactory.createValue(10);
        Value v1 = ValueFactory.createValue(0);
       
        d.beginTrans();
        d.setFieldValue(0, 0, v2);
        d.undo();
        assertTrue(((BooleanValue) d.getFieldValue(0, 0).equals(v1)).getValue());
        d.redo();
        assertTrue(((BooleanValue) d.getFieldValue(0, 0).equals(v2)).getValue());
View Full Code Here


    public void testAlphanumericDeleteUndoRedo() throws Exception {
        AlphanumericDataSource d = (AlphanumericDataSource)
        ds.getDataSource("persona",
                DataSourceFactory.UNDOABLE);
       
        d.beginTrans();
        Value v1 = d.getFieldValue(1, 0);
        Value v2 = d.getFieldValue(2, 0);
        d.deleteRow(1);
        d.undo();
        assertTrue(((BooleanValue) d.getFieldValue(1, 0).equals(v1)).getValue());
View Full Code Here

    public void testAlphanumericInsertUndoRedo() throws Exception {
        AlphanumericDataSource d = (AlphanumericDataSource)
        ds.getDataSource("persona",
                DataSourceFactory.UNDOABLE);
       
        d.beginTrans();
        Value v1 = d.getFieldValue(1, 0);
        d.insertEmptyRowAt(1);
        d.undo();
        assertTrue(((BooleanValue) d.getFieldValue(1, 0).equals(v1)).getValue());
        d.redo();
View Full Code Here

    public void testAlphanumericEditionUndoRedo() throws Exception {
        AlphanumericDataSource d = (AlphanumericDataSource)
        ds.getDataSource("persona",
                DataSourceFactory.UNDOABLE);
       
        d.beginTrans();
        testAlphanumericEditionUndoRedo(d);       
        d.rollBackTrans();
    }
   
    public void testSpatialEditionUndoRedo() throws Exception {
View Full Code Here

    public void testEditionNotification() throws Exception {
        AlphanumericDataSource d = (AlphanumericDataSource) ds
                .getDataSource("persona");

        d.addEditionListener(listener);
        d.beginTrans();
        d.deleteRow(0);
        d.insertEmptyRow();
        d.insertEmptyRowAt(0);
        Value[] row = d.getRow(0);
        d.insertFilledRow(row);
View Full Code Here

    public void testComplexChange() throws Exception {
        AlphanumericDataSource d = (AlphanumericDataSource) ds
                .getDataSource("persona");

        d.addEditionListener(listener);
        d.beginTrans();
        d.setDispatchingMode(DataSource.STORE);
        d.deleteRow(0);
        d.insertEmptyRow();
        d.insertEmptyRowAt(0);
        Value[] row = d.getRow(0);
View Full Code Here

    public void testUndoRedoChanges() throws Exception {
        AlphanumericDataSource d = (AlphanumericDataSource) ds
                .getDataSource("persona", DataSourceFactory.UNDOABLE);

        d.addEditionListener(listener);
        d.beginTrans();
        d.deleteRow(0);
        d.insertEmptyRow();
        d.insertEmptyRowAt(0);
        Value[] row = d.getRow(0);
        d.insertFilledRow(row);
View Full Code Here

    public void testIgnoreChanges() throws Exception {
        AlphanumericDataSource d = (AlphanumericDataSource) ds
                .getDataSource("persona", DataSourceFactory.UNDOABLE);

        d.addEditionListener(listener);
        d.beginTrans();
        d.setDispatchingMode(DataSource.IGNORE);
        d.deleteRow(0);
        d.insertEmptyRow();
        d.insertEmptyRowAt(0);
        Value[] row = d.getRow(0);
View Full Code Here

    public void testIgnoreCommit() throws Exception {
        AlphanumericDataSource d = (AlphanumericDataSource) ds
                .getDataSource("persona", DataSourceFactory.UNDOABLE);

        d.addEditionListener(listener);
        d.beginTrans();
        d.setDispatchingMode(DataSource.DISPATCH);
        d.deleteRow(0);
        d.insertEmptyRow();
        d.insertEmptyRowAt(0);
        Value[] row = d.getRow(0);
View Full Code Here

public class DBFDriverTests extends TestCase {
  public void testOpen() throws Exception {
    DataSourceFactory dsf = new DataSourceFactory();
    DriverUtilities.copy(new File("src/test/resources/puntos.backup.dbf"), new File("src/test/resources/puntos.dbf"));
    AlphanumericDataSource ads = dsf.getAlphanumericDataSource(new File("src/test/resources/puntos.dbf"));
    ads.beginTrans();
    ads.setDouble(0, 0, 3);
    ads.commitTrans();
    ads.start();
    assertTrue(ads.getDouble(0, 0) == 3);
    ads.stop();
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.