Search in sources :

Example 31 with Config

use of ch.ehi.ili2db.gui.Config in project ili2db by claeis.

the class Datatypes23Test method importXtfAttr.

@Test
public void importXtfAttr() throws Exception {
    EhiLogger.getInstance().setTraceFilter(false);
    File fgdbFile = new File(fgdbFileName);
    Fgdb4j.deleteFileGdb(fgdbFile);
    Class driverClass = Class.forName(FgdbDriver.class.getName());
    File data = new File("test/data/Datatypes23/Datatypes23Attr.xtf");
    Config config = initConfig(data.getPath(), data.getPath() + ".log");
    config.setFunction(Config.FC_IMPORT);
    config.setCreateFk(config.CREATE_FK_YES);
    config.setCreateNumChecks(true);
    config.setTidHandling(Config.TID_HANDLING_PROPERTY);
    config.setBasketHandling(config.BASKET_HANDLING_READWRITE);
    config.setCatalogueRefTrafo(null);
    config.setMultiSurfaceTrafo(null);
    config.setMultilingualTrafo(null);
    config.setInheritanceTrafo(null);
    // Ili2db.readSettingsFromDb(config);
    try {
        Ili2db.run(config, null);
    } catch (Exception ex) {
        EhiLogger.logError(ex);
        Assert.fail();
    }
}
Also used : FgdbDriver(ch.ehi.ili2fgdb.jdbc.FgdbDriver) Config(ch.ehi.ili2db.gui.Config) File(java.io.File) Ili2dbException(ch.ehi.ili2db.base.Ili2dbException) Test(org.junit.Test)

Example 32 with Config

use of ch.ehi.ili2db.gui.Config in project ili2db by claeis.

the class Datatypes23Test method importXtfLine.

@Test
public void importXtfLine() throws Exception {
    EhiLogger.getInstance().setTraceFilter(false);
    File fgdbFile = new File(fgdbFileName);
    Fgdb4j.deleteFileGdb(fgdbFile);
    Class driverClass = Class.forName(FgdbDriver.class.getName());
    File data = new File("test/data/Datatypes23/Datatypes23Line.xtf");
    Config config = initConfig(data.getPath(), data.getPath() + ".log");
    config.setFunction(Config.FC_IMPORT);
    config.setCreateFk(config.CREATE_FK_YES);
    config.setCreateNumChecks(true);
    config.setTidHandling(Config.TID_HANDLING_PROPERTY);
    config.setBasketHandling(config.BASKET_HANDLING_READWRITE);
    config.setCatalogueRefTrafo(null);
    config.setMultiSurfaceTrafo(null);
    config.setMultilingualTrafo(null);
    config.setInheritanceTrafo(null);
    // Ili2db.readSettingsFromDb(config);
    try {
        Ili2db.run(config, null);
    } catch (Exception ex) {
        EhiLogger.logError(ex);
        Assert.fail();
    }
}
Also used : FgdbDriver(ch.ehi.ili2fgdb.jdbc.FgdbDriver) Config(ch.ehi.ili2db.gui.Config) File(java.io.File) Ili2dbException(ch.ehi.ili2db.base.Ili2dbException) Test(org.junit.Test)

Example 33 with Config

use of ch.ehi.ili2db.gui.Config in project ili2db by claeis.

the class Datatypes23Test method exportXtfSurface.

@Test
public void exportXtfSurface() throws Exception {
    EhiLogger.getInstance().setTraceFilter(false);
    File fgdbFile = new File(fgdbFileName);
    // Fgdb4j.deleteFileGdb(fgdbFile);
    Class driverClass = Class.forName(FgdbDriver.class.getName());
    File data = new File("test/data/Datatypes23/Datatypes23Surface-out.xtf");
    Config config = initConfig(data.getPath(), data.getPath() + ".log");
    config.setFunction(Config.FC_EXPORT);
    config.setModels("Datatypes23");
    Ili2db.readSettingsFromDb(config);
    config.setBasketHandling(null);
    try {
        Ili2db.run(config, null);
    } catch (Exception ex) {
        EhiLogger.logError(ex);
        Assert.fail();
    }
}
Also used : FgdbDriver(ch.ehi.ili2fgdb.jdbc.FgdbDriver) Config(ch.ehi.ili2db.gui.Config) File(java.io.File) Ili2dbException(ch.ehi.ili2db.base.Ili2dbException) Test(org.junit.Test)

Example 34 with Config

use of ch.ehi.ili2db.gui.Config in project ili2db by claeis.

the class MultilineTest method importIli.

@Test
public void importIli() throws Exception {
    File fgdbFile = new File(fgdbFileName);
    Fgdb4j.deleteFileGdb(fgdbFile);
    Class driverClass = Class.forName(FgdbDriver.class.getName());
    File data = new File("test/data/MultiLine/MultiLine2.ili");
    Config config = initConfig(data.getPath(), data.getPath() + ".log");
    config.setFunction(Config.FC_SCHEMAIMPORT);
    config.setCreateFk(config.CREATE_FK_YES);
    config.setCreateNumChecks(true);
    config.setTidHandling(Config.TID_HANDLING_PROPERTY);
    config.setBasketHandling(config.BASKET_HANDLING_READWRITE);
    config.setCatalogueRefTrafo(null);
    config.setMultiSurfaceTrafo(null);
    config.setMultiLineTrafo(Config.MULTILINE_TRAFO_COALESCE);
    config.setMultilingualTrafo(null);
    config.setInheritanceTrafo(null);
    // Ili2db.readSettingsFromDb(config);
    Ili2db.run(config, null);
}
Also used : FgdbDriver(ch.ehi.ili2fgdb.jdbc.FgdbDriver) Config(ch.ehi.ili2db.gui.Config) File(java.io.File) Test(org.junit.Test)

Example 35 with Config

use of ch.ehi.ili2db.gui.Config in project ili2db by claeis.

the class MultilineTest method importXtf.

@Test
public void importXtf() throws Exception {
    EhiLogger.getInstance().setTraceFilter(false);
    File fgdbFile = new File(fgdbFileName);
    Fgdb4j.deleteFileGdb(fgdbFile);
    Class driverClass = Class.forName(FgdbDriver.class.getName());
    File data = new File("test/data/MultiLine/MultiLine2b.xtf");
    Config config = initConfig(data.getPath(), data.getPath() + ".log");
    config.setFunction(Config.FC_IMPORT);
    config.setCreateFk(config.CREATE_FK_YES);
    config.setCreateNumChecks(true);
    config.setTidHandling(Config.TID_HANDLING_PROPERTY);
    config.setBasketHandling(config.BASKET_HANDLING_READWRITE);
    config.setCatalogueRefTrafo(null);
    config.setMultiSurfaceTrafo(null);
    config.setMultiLineTrafo(Config.MULTILINE_TRAFO_COALESCE);
    config.setMultilingualTrafo(null);
    config.setInheritanceTrafo(null);
    // Ili2db.readSettingsFromDb(config);
    try {
        Ili2db.run(config, null);
    } catch (Exception ex) {
        EhiLogger.logError(ex);
        Assert.fail();
    }
}
Also used : FgdbDriver(ch.ehi.ili2fgdb.jdbc.FgdbDriver) Config(ch.ehi.ili2db.gui.Config) File(java.io.File) Ili2dbException(ch.ehi.ili2db.base.Ili2dbException) Test(org.junit.Test)

Aggregations

Config (ch.ehi.ili2db.gui.Config)207 File (java.io.File)162 Test (org.junit.Test)154 Connection (java.sql.Connection)118 ResultSet (java.sql.ResultSet)72 Statement (java.sql.Statement)44 HashMap (java.util.HashMap)40 IomObject (ch.interlis.iom.IomObject)34 EndBasketEvent (ch.interlis.iox.EndBasketEvent)34 EndTransferEvent (ch.interlis.iox.EndTransferEvent)34 IoxEvent (ch.interlis.iox.IoxEvent)34 ObjectEvent (ch.interlis.iox.ObjectEvent)34 StartBasketEvent (ch.interlis.iox.StartBasketEvent)34 StartTransferEvent (ch.interlis.iox.StartTransferEvent)34 FgdbDriver (ch.ehi.ili2fgdb.jdbc.FgdbDriver)33 Ili2dbException (ch.ehi.ili2db.base.Ili2dbException)32 XtfReader (ch.interlis.iom_j.xtf.XtfReader)30 IoxException (ch.interlis.iox.IoxException)15 SQLException (java.sql.SQLException)12 ResultSetMetaData (java.sql.ResultSetMetaData)10