use of org.locationtech.geogig.cli.GeogigCLI 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());
}
use of org.locationtech.geogig.cli.GeogigCLI in project GeoGig by boundlessgeo.
the class GlobalState method setupGeogig.
public static void setupGeogig() throws Exception {
assertNotNull(platform);
stdIn = new ByteArrayInputStream(new byte[0]);
stdOut = new ByteArrayOutputStream();
if (GlobalState.consoleReader != null) {
GlobalState.consoleReader.shutdown();
}
// GlobalState.consoleReader = new ConsoleReader(stdIn,
// new TeeOutputStream(stdOut, System.err), new UnsupportedTerminal());
GlobalState.consoleReader = new ConsoleReader(stdIn, stdOut, new UnsupportedTerminal());
ContextBuilder injectorBuilder = new CLITestContextBuilder(platform);
Context injector = injectorBuilder.build();
if (geogigCLI != null) {
geogigCLI.close();
}
geogigCLI = new GeogigCLI(GlobalState.consoleReader);
GlobalContextBuilder.builder = injectorBuilder;
Platform platform = injector.platform();
geogigCLI.setPlatform(platform);
geogigCLI.tryConfigureLogging();
}
use of org.locationtech.geogig.cli.GeogigCLI in project GeoGig by boundlessgeo.
the class SQLServerImportTest method testImportException.
@Test
public void testImportException() throws Exception {
ConsoleReader consoleReader = new ConsoleReader(System.in, System.out, new UnsupportedTerminal());
GeogigCLI mockCli = spy(new GeogigCLI(consoleReader));
setUpGeogig(mockCli);
when(mockCli.getConsole()).thenThrow(new MockitoException("Exception"));
SQLServerImport importCommand = new SQLServerImport();
importCommand.all = true;
importCommand.dataStoreFactory = TestHelper.createTestFactory();
exception.expect(MockitoException.class);
importCommand.run(mockCli);
}
use of org.locationtech.geogig.cli.GeogigCLI in project GeoGig by boundlessgeo.
the class SQLServerImportTest method setUp.
@Before
public void setUp() throws Exception {
ConsoleReader consoleReader = new ConsoleReader(System.in, System.out, new UnsupportedTerminal());
cli = new GeogigCLI(consoleReader);
setUpGeogig(cli);
}
use of org.locationtech.geogig.cli.GeogigCLI in project GeoGig by boundlessgeo.
the class SQLServerListTest method testListException.
@Test
public void testListException() throws Exception {
ConsoleReader consoleReader = new ConsoleReader(System.in, System.out, new UnsupportedTerminal());
GeogigCLI mockCli = spy(new GeogigCLI(consoleReader));
setUpGeogig(mockCli);
when(mockCli.getConsole()).thenThrow(new MockitoException("Exception"));
SQLServerList listCommand = new SQLServerList();
listCommand.dataStoreFactory = TestHelper.createTestFactory();
exception.expect(MockitoException.class);
listCommand.run(mockCli);
}
Aggregations