Package org.gdbms.engine.data

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


public class DriverMetadataTest extends DataSourceTestCase {

    public void testAddField() throws Exception {
        DataSource d = ds.getDataSource("sort");
       
        d.beginTrans();
        int fc = d.getDataSourceMetadata().getFieldCount();
        d.addField("nuevo", "STRING");
        assertTrue(d.getDataSourceMetadata().getFieldType(fc) == Value.STRING);
        assertTrue(d.getDriverMetadata().getFieldType(fc) == "STRING");
        d.commitTrans();
View Full Code Here


        assertTrue(d.getDataSourceMetadata().getFieldType(fc) == Value.STRING);
        d.stop();
       
        d = ds.getDataSource("hsqldbpersona");
       
        d.beginTrans();
        fc = d.getDataSourceMetadata().getFieldCount();
        d.addField("nuevo", "BIT");
        assertTrue(d.getDataSourceMetadata().getFieldType(fc) == Value.BOOLEAN);
        assertTrue(d.getDriverMetadata().getFieldType(fc).equals("BIT"));
        d.commitTrans();
View Full Code Here

        assertTrue(d.getDataSourceMetadata().getFieldType(fc) == Value.BOOLEAN);
        d.stop();

        d = ds.getDataSource("hsqldbpersona");
       
        d.beginTrans();
        fc = d.getDataSourceMetadata().getFieldCount();
        d.addField("nuevo2", "CHAR");
        assertTrue(d.getDataSourceMetadata().getFieldType(fc) == Value.STRING);
        assertTrue(d.getDriverMetadata().getFieldType(fc).equals("CHAR"));
        assertTrue(d.getDriverMetadata().getFieldParam(fc, "LENGTH") == null);
View Full Code Here

  public static void testWrite(DataSourceFactory ds, String pgds)
      throws Exception {
    DataSource d = ds.getDataSource(pgds);

    d.beginTrans();
    long countBefore = d.getRowCount();
    d.insertFilledRow(new Value[] { ValueFactory.createValue(55),
        ValueFactory.createValue(55),
        GeometryFactory.createPoint2D(0, 0) });
    d.commitTrans();
View Full Code Here

    }
   
    public void testDriverMetadataEdition() throws Exception {
        DataSource d = ds.getDataSource("hsqldbpersona");
       
        d.beginTrans();
        int fc = d.getDataSourceMetadata().getFieldCount();
        d.addField("nuevo", "CHAR", new String[]{"LENGTH"}, new String[]{"5"});
        assertTrue(d.getDataSourceMetadata().getFieldType(fc) == Value.STRING);
        assertTrue(d.getDriverMetadata().getFieldType(fc).equals("CHAR"));
        assertTrue(d.getDriverMetadata().getFieldParam(fc, "LENGTH").equals("5"));
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.