use of jline.UnsupportedTerminal in project GeoGig by boundlessgeo.
the class SQLServerDescribeTest method testDescribeException.
@Test
public void testDescribeException() 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"));
SQLServerDescribe describeCommand = new SQLServerDescribe();
describeCommand.table = "table1";
describeCommand.dataStoreFactory = TestHelper.createTestFactory();
exception.expect(MockitoException.class);
describeCommand.run(mockCli);
}
use of jline.UnsupportedTerminal in project GeoGig by boundlessgeo.
the class PGListTest 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"));
PGList listCommand = new PGList();
listCommand.dataStoreFactory = TestHelper.createTestFactory();
exception.expect(MockitoException.class);
listCommand.run(mockCli);
}
use of jline.UnsupportedTerminal 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 jline.UnsupportedTerminal in project GeoGig by boundlessgeo.
the class OSMHistoryImportTest method setUp.
@Before
public void setUp() throws Exception {
ConsoleReader consoleReader = new ConsoleReader(System.in, System.out, new UnsupportedTerminal());
cli = new GeogigCLI(consoleReader);
fakeOsmApiUrl = getClass().getResource("../../internal/history/01_10").toExternalForm();
File workingDirectory = tempFolder.getRoot();
TestPlatform platform = new TestPlatform(workingDirectory);
GlobalContextBuilder.builder = new CLITestContextBuilder(platform);
cli.setPlatform(platform);
cli.execute("init");
assertTrue(new File(workingDirectory, ".geogig").exists());
}
use of jline.UnsupportedTerminal 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());
}
Aggregations