Ejemplo n.º 1
0
  @Test
  public void testNoUserHome() {
    final Platform platform = mock(Platform.class);
    when(platform.getUserHome()).thenReturn(null);

    final ConfigDatabase config = createDatabase(platform);

    exception.expect(ConfigException.class);
    config.putGlobal("section.int", 1);
  }
Ejemplo n.º 2
0
  private void setUpGeogig(GeogigCLI cli) throws Exception {
    final File userhome = tempFolder.newFolder("mockUserHomeDir");
    final File workingDir = tempFolder.newFolder("mockWorkingDir");
    tempFolder.newFolder("mockWorkingDir", ".geogig");

    final Platform platform = mock(Platform.class);
    when(platform.pwd()).thenReturn(workingDir);
    when(platform.getUserHome()).thenReturn(userhome);

    cli.setPlatform(platform);
  }
Ejemplo n.º 3
0
  @Before
  public final void setUp() {
    final File userhome = tempFolder.newFolder("mockUserHomeDir");

    final File workingDir = tempFolder.newFolder("mockWorkingDir");
    tempFolder.newFolder("mockWorkingDir", ".geogig");

    final Platform platform = mock(Platform.class);
    when(platform.getUserHome()).thenReturn(userhome);
    when(platform.pwd()).thenReturn(workingDir);

    config = createDatabase(platform);
  }