protected Platform createPlatform() { Platform testPlatform = new TestPlatform(repositoryDirectory); return testPlatform; }
@Override public TestPlatform clone() { return new TestPlatform(pwd(), getUserHome()); }
public @Before @Override void setUp() throws Exception { File root = folder.getRoot(); folder.newFolder(".geogig"); File home = folder.newFolder("home"); platform = new TestPlatform(root); platform.setUserHome(home); super.setUp(); }
@Given("^I am inside a repository subdirectory \"([^\"]*)\"$") public void I_am_inside_a_repository_subdirectory(String subdirSpec) throws Throwable { String[] subdirs = subdirSpec.split("/"); File dir = localRepo.platform.pwd(); for (String subdir : subdirs) { dir = new File(dir, subdir); } assertTrue(dir.mkdirs()); localRepo.platform.setWorkingDir(dir); }
@Given("^I have an insert file$") public void I_have_an_insert_file() throws Throwable { File file = new File(localRepo.platform.pwd(), "insert"); BufferedWriter writer = Files.newWriter(file, Charsets.UTF_8); writer.write("Points/Points.1\n"); writer.write("sp\tNew_String\n"); writer.write("ip\t1001\n"); writer.write("pp\tPOINT(2 2)\n"); writer.flush(); writer.close(); }
@Override public Context build(Hints hints) { FunctionalTestModule functionalTestModule = new FunctionalTestModule(platform.clone()); Context context = Guice.createInjector(Modules .override(new GeogigModule(), new HintsModule(hints)).with(new PluginsModule(), new CLIContextBuilder.DefaultPlugins(), functionalTestModule)) .getInstance(Context.class); return context; }
@Given("^I have an insert file$") public void I_have_an_insert_file() throws Throwable { File file = new File(localRepo.platform.pwd(), "insert"); BufferedWriter writer = Files.newWriter(file, Charsets.UTF_8); writer.write("Points/Points.1\n"); writer.write("sp\tNew_String\n"); writer.write("ip\t1001\n"); writer.write("pp\tPOINT(2 2)\n"); writer.flush(); writer.close(); }
@Given("^I am inside a repository subdirectory \"([^\"]*)\"$") public void I_am_inside_a_repository_subdirectory(String subdirSpec) throws Throwable { String[] subdirs = subdirSpec.split("/"); File dir = localRepo.platform.pwd(); for (String subdir : subdirs) { dir = new File(dir, subdir); } assertTrue(dir.mkdirs()); localRepo.platform.setWorkingDir(dir); }
@Override public Context build(Hints hints) { FunctionalTestModule functionalTestModule = new FunctionalTestModule(platform.clone()); Context context = Guice.createInjector(Modules .override(new GeogigModule(), new HintsModule(hints)).with(new PluginsModule(), new PluginsContextBuilder.DefaultPlugins(), functionalTestModule)) .getInstance(Context.class); return context; }
protected Platform createPlatform() { Platform testPlatform = new TestPlatform(repositoryDirectory); return testPlatform; }
public @Before @Override void setUp() throws Exception { File root = folder.getRoot(); folder.newFolder(".geogig"); File home = folder.newFolder("home"); platform = new TestPlatform(root); platform.setUserHome(home); super.setUp(); }
@Override public TestPlatform clone() { return new TestPlatform(pwd(), getUserHome()); }
@Given("^I have an insert file$") public void I_have_an_insert_file() throws Throwable { File file = new File(localRepo.platform.pwd(), "insert"); BufferedWriter writer = Files.newWriter(file, Charsets.UTF_8); writer.write("Points/Points.1\n"); writer.write("sp\tNew_String\n"); writer.write("ip\t1001\n"); writer.write("pp\tPOINT(2 2)\n"); writer.flush(); writer.close(); }
@Given("^I am inside a repository subdirectory \"([^\"]*)\"$") public void I_am_inside_a_repository_subdirectory(String subdirSpec) throws Throwable { String[] subdirs = subdirSpec.split("/"); File dir = localRepo.platform.pwd(); for (String subdir : subdirs) { dir = new File(dir, subdir); } assertTrue(dir.mkdirs()); localRepo.platform.setWorkingDir(dir); }
@Override public Context build(Hints hints) { FunctionalTestModule functionalTestModule = new FunctionalTestModule(platform.clone()); Context context = Guice.createInjector(Modules .override(new GeogigModule(), new HintsModule(hints)).with(new PluginsModule(), new PluginsContextBuilder.DefaultPlugins(), functionalTestModule)) .getInstance(Context.class); return context; }
@Override protected TransactionBlobStore createBlobStore(File currentDirectory) { new File(currentDirectory, ".geogig").mkdir();// fake a repo directory FileBlobStore fileBlobStore = new FileBlobStore(new TestPlatform(currentDirectory)); fileBlobStore.open(); return fileBlobStore; }
public @Before @Override void setUp() throws Exception { File root = folder.getRoot(); folder.newFolder(".geogig"); File home = folder.newFolder("home"); platform = new TestPlatform(root); platform.setUserHome(home); super.setUp(); }
@Given("^I am in an empty directory$") public void I_am_in_an_empty_directory() throws Throwable { File wd = localRepo.platform.pwd(); assertEquals(String.format("directory %s is not empty: %s", wd, Arrays.toString(wd.list())), 0, wd.list().length); }
@Then("^if I change to the respository subdirectory \"([^\"]*)\"$") public void if_I_change_to_the_respository_subdirectory(String subdirSpec) throws Throwable { String[] subdirs = subdirSpec.split("/"); File dir = localRepo.platform.pwd(); for (String subdir : subdirs) { dir = new File(dir, subdir); } assertTrue(dir.exists()); localRepo.platform.setWorkingDir(dir); localRepo.geogigCLI.close(); localRepo.geogigCLI.setRepositoryURI(dir.toURI().toString()); }
@Override public Context build(Hints hints) { FunctionalTestModule functionalTestModule = new FunctionalTestModule(platform.clone()); Context context = Guice.createInjector( Modules.override(new GeogigModule(), new HintsModule(hints)) .with(new PluginsModule(), new CLIContextBuilder.DefaultPlugins(), functionalTestModule)) .getInstance(Context.class); return context; }