Search in sources :

Example 6 with CLITestContextBuilder

use of org.locationtech.geogig.cli.test.functional.general.CLITestContextBuilder in project GeoGig by boundlessgeo.

the class OSMApplyDiffTest method setUp.

@Before
public void setUp() throws Exception {
    ConsoleReader consoleReader = new ConsoleReader(System.in, System.out, new UnsupportedTerminal());
    cli = new GeogigCLI(consoleReader);
    File workingDirectory = tempFolder.getRoot();
    TestPlatform platform = new TestPlatform(workingDirectory);
    GlobalContextBuilder.builder = new CLITestContextBuilder(platform);
    cli.setPlatform(platform);
    cli.execute("init");
    cli.execute("config", "user.name", "Gabriel Roldan");
    cli.execute("config", "user.email", "groldan@boundlessgeo.com");
    assertTrue(new File(workingDirectory, ".geogig").exists());
}
Also used : GeogigCLI(org.locationtech.geogig.cli.GeogigCLI) ConsoleReader(jline.console.ConsoleReader) UnsupportedTerminal(jline.UnsupportedTerminal) TestPlatform(org.locationtech.geogig.api.TestPlatform) File(java.io.File) CLITestContextBuilder(org.locationtech.geogig.cli.test.functional.general.CLITestContextBuilder) Before(org.junit.Before)

Example 7 with CLITestContextBuilder

use of org.locationtech.geogig.cli.test.functional.general.CLITestContextBuilder in project GeoGig by boundlessgeo.

the class OSMExportSLTest method setUp.

@Before
public void setUp() throws Exception {
    ConsoleReader consoleReader = new ConsoleReader(System.in, System.out, new UnsupportedTerminal());
    cli = new GeogigCLI(consoleReader);
    File workingDirectory = tempFolder.getRoot();
    TestPlatform platform = new TestPlatform(workingDirectory);
    GlobalContextBuilder.builder = new CLITestContextBuilder(platform);
    cli.setPlatform(platform);
    cli.execute("init");
    cli.execute("config", "user.name", "Gabriel Roldan");
    cli.execute("config", "user.email", "groldan@boundlessgeo.com");
    assertTrue(new File(workingDirectory, ".geogig").exists());
    // Use in-memory database to test whether we can load Spatialite extension
    Connection connection = null;
    Throwable thrown = null;
    try {
        Class.forName("org.spatialite.JDBC");
        SQLiteConfig config = new SQLiteConfig();
        config.enableSpatiaLite(true);
        connection = DriverManager.getConnection("jdbc:spatialite::memory:", config.toProperties());
        Statement statement = connection.createStatement();
        statement.execute("SELECT InitSpatialMetaData();");
    } catch (SQLException e) {
        thrown = e;
        thrown.printStackTrace();
    } finally {
        if (connection != null) {
            connection.close();
        }
    }
    if (thrown != null) {
        thrown.printStackTrace();
        Assume.assumeNoException(thrown);
    }
}
Also used : GeogigCLI(org.locationtech.geogig.cli.GeogigCLI) ConsoleReader(jline.console.ConsoleReader) UnsupportedTerminal(jline.UnsupportedTerminal) SQLException(java.sql.SQLException) Statement(java.sql.Statement) Connection(java.sql.Connection) SQLiteConfig(org.spatialite.SQLiteConfig) TestPlatform(org.locationtech.geogig.api.TestPlatform) File(java.io.File) CLITestContextBuilder(org.locationtech.geogig.cli.test.functional.general.CLITestContextBuilder) Before(org.junit.Before)

Example 8 with CLITestContextBuilder

use of org.locationtech.geogig.cli.test.functional.general.CLITestContextBuilder in project GeoGig by boundlessgeo.

the class OSMExportShpTest method setUp.

@Before
public void setUp() throws Exception {
    ConsoleReader consoleReader = new ConsoleReader(System.in, System.out, new UnsupportedTerminal());
    cli = new GeogigCLI(consoleReader);
    File workingDirectory = tempFolder.getRoot();
    TestPlatform platform = new TestPlatform(workingDirectory);
    GlobalContextBuilder.builder = new CLITestContextBuilder(platform);
    cli.setPlatform(platform);
    cli.execute("init");
    cli.execute("config", "user.name", "Gabriel Roldan");
    cli.execute("config", "user.email", "groldan@boundlessgeo.com");
    assertTrue(new File(workingDirectory, ".geogig").exists());
}
Also used : GeogigCLI(org.locationtech.geogig.cli.GeogigCLI) ConsoleReader(jline.console.ConsoleReader) UnsupportedTerminal(jline.UnsupportedTerminal) TestPlatform(org.locationtech.geogig.api.TestPlatform) File(java.io.File) CLITestContextBuilder(org.locationtech.geogig.cli.test.functional.general.CLITestContextBuilder) Before(org.junit.Before)

Example 9 with CLITestContextBuilder

use of org.locationtech.geogig.cli.test.functional.general.CLITestContextBuilder in project GeoGig by boundlessgeo.

the class OSMExportTest method setUp.

@Before
public void setUp() throws Exception {
    ConsoleReader consoleReader = new ConsoleReader(System.in, System.out, new UnsupportedTerminal());
    cli = new GeogigCLI(consoleReader);
    File workingDirectory = tempFolder.getRoot();
    TestPlatform platform = new TestPlatform(workingDirectory);
    GlobalContextBuilder.builder = new CLITestContextBuilder(platform);
    cli.setPlatform(platform);
    cli.execute("init");
    cli.execute("config", "user.name", "Gabriel Roldan");
    cli.execute("config", "user.email", "groldan@boundlessgeo.com");
    assertTrue(new File(workingDirectory, ".geogig").exists());
}
Also used : GeogigCLI(org.locationtech.geogig.cli.GeogigCLI) ConsoleReader(jline.console.ConsoleReader) UnsupportedTerminal(jline.UnsupportedTerminal) TestPlatform(org.locationtech.geogig.api.TestPlatform) File(java.io.File) CLITestContextBuilder(org.locationtech.geogig.cli.test.functional.general.CLITestContextBuilder) Before(org.junit.Before)

Aggregations

File (java.io.File)9 Before (org.junit.Before)9 TestPlatform (org.locationtech.geogig.api.TestPlatform)9 CLITestContextBuilder (org.locationtech.geogig.cli.test.functional.general.CLITestContextBuilder)9 UnsupportedTerminal (jline.UnsupportedTerminal)7 ConsoleReader (jline.console.ConsoleReader)7 GeogigCLI (org.locationtech.geogig.cli.GeogigCLI)7 GeoGIG (org.locationtech.geogig.api.GeoGIG)2 ThreadFactoryBuilder (com.google.common.util.concurrent.ThreadFactoryBuilder)1 Connection (java.sql.Connection)1 SQLException (java.sql.SQLException)1 Statement (java.sql.Statement)1 TemporaryFolder (org.junit.rules.TemporaryFolder)1 Context (org.locationtech.geogig.api.Context)1 RevFeature (org.locationtech.geogig.api.RevFeature)1 RevTree (org.locationtech.geogig.api.RevTree)1 InitOp (org.locationtech.geogig.api.porcelain.InitOp)1 GeoGigDataStore (org.locationtech.geogig.geotools.data.GeoGigDataStore)1 OSMImportOp (org.locationtech.geogig.osm.internal.OSMImportOp)1 SQLiteConfig (org.spatialite.SQLiteConfig)1