@Given("^the remote repository has changes") public void the_remote_repository_has_changes() throws Throwable { CLIContext remoteRepo = contextProvider.getOrCreateRepositoryContext("remoterepo"); remoteRepo.insertAndAdd(lines3); remoteRepo.runCommand(true, "commit -m Commit10"); }
@Given("^the remote repository has changes") public void the_remote_repository_has_changes() throws Throwable { CLIContext remoteRepo = contextProvider.getOrCreateRepositoryContext("remoterepo"); remoteRepo.insertAndAdd(lines3); remoteRepo.runCommand(true, "commit -m Commit10"); }
@cucumber.api.java.Before public void before() throws Throwable { contextProvider = CLIContextProvider.get(); contextProvider.before(); this.localRepo = contextProvider.getOrCreateRepositoryContext("localrepo"); }
@cucumber.api.java.Before public void before() throws Throwable { contextProvider = CLIContextProvider.get(); contextProvider.before(); this.localRepo = contextProvider.getOrCreateRepositoryContext("localrepo"); }
@Given("^the remote repository has changes") public void the_remote_repository_has_changes() throws Throwable { CLIContext remoteRepo = contextProvider.getOrCreateRepositoryContext("remoterepo"); remoteRepo.insertAndAdd(lines3); remoteRepo.runCommand(true, "commit -m Commit10"); }
@cucumber.api.java.Before public void before() throws Throwable { contextProvider = CLIContextProvider.get(); contextProvider.before(); this.localRepo = contextProvider.getOrCreateRepositoryContext("localrepo"); tempFolder = new TemporaryFolder(); tempFolder.create(); }
@cucumber.api.java.Before public void before() throws Throwable { contextProvider = CLIContextProvider.get(); contextProvider.before(); this.localRepo = contextProvider.getOrCreateRepositoryContext("localrepo"); tempFolder = new TemporaryFolder(); tempFolder.create(); }
@Given("^there is a remote repository with a tag named \"([^\"]*)\"$") public void there_is_a_remote_repository_with_a_tag_named(String tagName) throws Throwable { CLIContext remoteRepo = contextProvider.getOrCreateRepositoryContext("remoterepo"); remoteRepo.configureRepository(); List<String> output = remoteRepo.runAndParseCommand(true, "init"); assertEquals(output.toString(), 1, output.size()); assertNotNull(output.get(0)); assertTrue(output.get(0), output.get(0).startsWith("Initialized")); remoteRepo.runCommand(true, "config", "--global", "user.name", "John Doe"); remoteRepo.runCommand(true, "config", "--global", "user.email", "JohnDoe@example.com"); remoteRepo.insertAndAdd(points1); remoteRepo.runCommand(true, "commit -m Commit1"); remoteRepo.runCommand(true, "branch -c branch1"); remoteRepo.insertAndAdd(points2); remoteRepo.runCommand(true, "commit -m Commit2"); remoteRepo.insertAndAdd(points3); remoteRepo.runCommand(true, "commit -m Commit3"); remoteRepo.runCommand(true, "checkout master"); remoteRepo.insertAndAdd(lines1); remoteRepo.runCommand(true, "commit -m Commit4"); remoteRepo.insertAndAdd(lines2); remoteRepo.runCommand(true, "commit -m Commit5"); remoteRepo.runCommand(true, "tag " + tagName + " -m Created_" + tagName + ""); String actual = remoteRepo.stdOut.toString().replaceAll(LINE_SEPARATOR, "") .replaceAll("\\\\", "/").trim().toLowerCase(); assertTrue(actual, actual.startsWith("created tag " + tagName)); }
@Given("^there is a remote repository with a tag named \"([^\"]*)\"$") public void there_is_a_remote_repository_with_a_tag_named(String tagName) throws Throwable { CLIContext remoteRepo = contextProvider.getOrCreateRepositoryContext("remoterepo"); remoteRepo.configureRepository(); List<String> output = remoteRepo.runAndParseCommand(true, "init"); assertEquals(output.toString(), 1, output.size()); assertNotNull(output.get(0)); assertTrue(output.get(0), output.get(0).startsWith("Initialized")); remoteRepo.runCommand(true, "config", "--global", "user.name", "John Doe"); remoteRepo.runCommand(true, "config", "--global", "user.email", "JohnDoe@example.com"); remoteRepo.insertAndAdd(points1); remoteRepo.runCommand(true, "commit -m Commit1"); remoteRepo.runCommand(true, "branch -c branch1"); remoteRepo.insertAndAdd(points2); remoteRepo.runCommand(true, "commit -m Commit2"); remoteRepo.insertAndAdd(points3); remoteRepo.runCommand(true, "commit -m Commit3"); remoteRepo.runCommand(true, "checkout master"); remoteRepo.insertAndAdd(lines1); remoteRepo.runCommand(true, "commit -m Commit4"); remoteRepo.insertAndAdd(lines2); remoteRepo.runCommand(true, "commit -m Commit5"); remoteRepo.runCommand(true, "tag " + tagName + " -m Created_" + tagName + ""); String actual = remoteRepo.stdOut.toString().replaceAll(LINE_SEPARATOR, "") .replaceAll("\\\\", "/").trim().toLowerCase(); assertTrue(actual, actual.startsWith("created tag " + tagName)); }
@Given("^there is a remote repository with a tag named \"([^\"]*)\"$") public void there_is_a_remote_repository_with_a_tag_named(String tagName) throws Throwable { CLIContext remoteRepo = contextProvider.getOrCreateRepositoryContext("remoterepo"); remoteRepo.configureRepository(); List<String> output = remoteRepo.runAndParseCommand(true, "init"); assertEquals(output.toString(), 1, output.size()); assertNotNull(output.get(0)); assertTrue(output.get(0), output.get(0).startsWith("Initialized")); remoteRepo.runCommand(true, "config", "--global", "user.name", "John Doe"); remoteRepo.runCommand(true, "config", "--global", "user.email", "JohnDoe@example.com"); remoteRepo.insertAndAdd(points1); remoteRepo.runCommand(true, "commit -m Commit1"); remoteRepo.runCommand(true, "branch -c branch1"); remoteRepo.insertAndAdd(points2); remoteRepo.runCommand(true, "commit -m Commit2"); remoteRepo.insertAndAdd(points3); remoteRepo.runCommand(true, "commit -m Commit3"); remoteRepo.runCommand(true, "checkout master"); remoteRepo.insertAndAdd(lines1); remoteRepo.runCommand(true, "commit -m Commit4"); remoteRepo.insertAndAdd(lines2); remoteRepo.runCommand(true, "commit -m Commit5"); remoteRepo.runCommand(true, "tag " + tagName + " -m Created_" + tagName + ""); String actual = remoteRepo.stdOut.toString().replaceAll(LINE_SEPARATOR, "") .replaceAll("\\\\", "/").trim().toLowerCase(); assertTrue(actual, actual.startsWith("created tag " + tagName)); }
private CLIContext createRemote(String name) throws Throwable { CLIContext remoteRepo = contextProvider.getOrCreateRepositoryContext(name); remoteRepo.configureRepository(); List<String> output = remoteRepo.runAndParseCommand(true, "init"); assertEquals(output.toString(), 1, output.size()); assertNotNull(output.get(0)); assertTrue(output.get(0), output.get(0).startsWith("Initialized")); remoteRepo.runCommand(true, "config", "--global", "user.name", "John Doe"); remoteRepo.runCommand(true, "config", "--global", "user.email", "JohnDoe@example.com"); remoteRepo.insertAndAdd(points1); remoteRepo.runCommand(true, "commit -m Commit1"); remoteRepo.runCommand(true, "branch -c branch1"); remoteRepo.insertAndAdd(points2); remoteRepo.runCommand(true, "commit -m Commit2"); remoteRepo.insertAndAdd(points3); remoteRepo.runCommand(true, "commit -m Commit3"); remoteRepo.runCommand(true, "checkout master"); remoteRepo.insertAndAdd(lines1); remoteRepo.runCommand(true, "commit -m Commit4"); remoteRepo.insertAndAdd(lines2); remoteRepo.runCommand(true, "commit -m Commit5"); return remoteRepo; }
private CLIContext createRemote(String name) throws Throwable { CLIContext remoteRepo = contextProvider.getOrCreateRepositoryContext(name); remoteRepo.configureRepository(); List<String> output = remoteRepo.runAndParseCommand(true, "init"); assertEquals(output.toString(), 1, output.size()); assertNotNull(output.get(0)); assertTrue(output.get(0), output.get(0).startsWith("Initialized")); remoteRepo.runCommand(true, "config", "--global", "user.name", "John Doe"); remoteRepo.runCommand(true, "config", "--global", "user.email", "JohnDoe@example.com"); remoteRepo.insertAndAdd(points1); remoteRepo.runCommand(true, "commit -m Commit1"); remoteRepo.runCommand(true, "branch -c branch1"); remoteRepo.insertAndAdd(points2); remoteRepo.runCommand(true, "commit -m Commit2"); remoteRepo.insertAndAdd(points3); remoteRepo.runCommand(true, "commit -m Commit3"); remoteRepo.runCommand(true, "checkout master"); remoteRepo.insertAndAdd(lines1); remoteRepo.runCommand(true, "commit -m Commit4"); remoteRepo.insertAndAdd(lines2); remoteRepo.runCommand(true, "commit -m Commit5"); return remoteRepo; }
private CLIContext createRemote(String name) throws Throwable { CLIContext remoteRepo = contextProvider.getOrCreateRepositoryContext(name); remoteRepo.configureRepository(); List<String> output = remoteRepo.runAndParseCommand(true, "init"); assertEquals(output.toString(), 1, output.size()); assertNotNull(output.get(0)); assertTrue(output.get(0), output.get(0).startsWith("Initialized")); remoteRepo.runCommand(true, "config", "--global", "user.name", "John Doe"); remoteRepo.runCommand(true, "config", "--global", "user.email", "JohnDoe@example.com"); remoteRepo.insertAndAdd(points1); remoteRepo.runCommand(true, "commit -m Commit1"); remoteRepo.runCommand(true, "branch -c branch1"); remoteRepo.insertAndAdd(points2); remoteRepo.runCommand(true, "commit -m Commit2"); remoteRepo.insertAndAdd(points3); remoteRepo.runCommand(true, "commit -m Commit3"); remoteRepo.runCommand(true, "checkout master"); remoteRepo.insertAndAdd(lines1); remoteRepo.runCommand(true, "commit -m Commit4"); remoteRepo.insertAndAdd(lines2); remoteRepo.runCommand(true, "commit -m Commit5"); return remoteRepo; }
@cucumber.api.java.Before(order = 1000) // order = 1000 to make sure it runs the latest if the // @Before annotated methods public void before(Scenario scenario) throws Throwable { contextProvider = CLIContextProvider.get(); if (contextProvider.getURIBuilder() == null) { contextProvider.setURIBuilder(TestRepoURIBuilder.createDefault()); } LOG.info("'{}': Using URIBuilder {}", scenario.getName(), contextProvider.getURIBuilder().getClass().getSimpleName()); contextProvider.before(); this.localRepo = contextProvider.getOrCreateRepositoryContext("localrepo"); RevFeatureType rft = RevFeatureTypeBuilder.build(TestFeatures.pointsType); setVariable("@PointsTypeID", rft.getId().toString()); rft = RevFeatureTypeBuilder.build(TestFeatures.linesType); setVariable("@LinesTypeID", rft.getId().toString()); }
@cucumber.api.java.Before(order = 1000) // order = 1000 to make sure it runs the latest if the // @Before annotated methods public void before(Scenario scenario) throws Throwable { contextProvider = CLIContextProvider.get(); if (contextProvider.getURIBuilder() == null) { contextProvider.setURIBuilder(TestRepoURIBuilder.createDefault()); } LOG.info("'{}': Using URIBuilder {}", scenario.getName(), contextProvider.getURIBuilder().getClass().getSimpleName()); contextProvider.before(); this.localRepo = contextProvider.getOrCreateRepositoryContext("localrepo"); RevFeatureType rft = RevFeatureTypeBuilder.build(TestFeatures.pointsType); setVariable("@PointsTypeID", rft.getId().toString()); rft = RevFeatureTypeBuilder.build(TestFeatures.linesType); setVariable("@LinesTypeID", rft.getId().toString()); }
@cucumber.api.java.Before(order = 1000) // order = 1000 to make sure it runs the latest if the // @Before annotated methods public void before(Scenario scenario) throws Throwable { contextProvider = CLIContextProvider.get(); if (contextProvider.getURIBuilder() == null) { contextProvider.setURIBuilder(TestRepoURIBuilder.createDefault()); } LOG.info("'{}': Using URIBuilder {}", scenario.getName(), contextProvider.getURIBuilder().getClass().getSimpleName()); contextProvider.before(); this.localRepo = contextProvider.getOrCreateRepositoryContext("localrepo"); RevFeatureType rft = RevFeatureType.builder().type(TestFeatures.pointsType).build(); setVariable("@PointsTypeID", rft.getId().toString()); rft = RevFeatureType.builder().type(TestFeatures.linesType).build(); setVariable("@LinesTypeID", rft.getId().toString()); }