private String replaceKnownVariables(String s) throws IOException { if (s.contains("${currentdir}")) { File pwd = localRepo.platform.pwd(); s = s.replace("${currentdir}", pwd.getCanonicalPath().replace("\\", "/")); s = s.replace("\"", ""); } if (s.contains("${repoURI}")) { URI uri = localRepo.repositoryURI; s = s.replace("${repoURI}", uri.toString()); } if (s.contains("${localrepo}")) { URI uri = localRepo.repositoryURI; s = s.replace("${localrepo}", uri.toString()); } if (s.contains("${remoterepo}")) { CLIContext remote = contextProvider.getRepositoryContext("remoterepo"); URI remoteURI = remote.repositoryURI; s = s.replace("${remoterepo}", remoteURI.toString()); } if (s.contains("${remote repo}")) { CLIContext remote = contextProvider.getRepositoryContext("remote repo"); URI remoteURI = remote.repositoryURI; s = s.replace("${remote repo}", remoteURI.toString()); } if (s.contains("${rootRepoURI}")) { URI rootRepoURI = contextProvider.getURIBuilder().buildRootURI(localRepo.platform); s = s.replace("${rootRepoURI}", rootRepoURI.toString()); } return s; }
private String replaceKnownVariables(String s) throws IOException { if (s.contains("${currentdir}")) { File pwd = localRepo.platform.pwd(); s = s.replace("${currentdir}", pwd.getCanonicalPath().replace("\\", "/")); s = s.replace("\"", ""); } if (s.contains("${repoURI}")) { URI uri = localRepo.repositoryURI; s = s.replace("${repoURI}", uri.toString()); } if (s.contains("${localrepo}")) { URI uri = localRepo.repositoryURI; s = s.replace("${localrepo}", uri.toString()); } if (s.contains("${remoterepo}")) { CLIContext remote = contextProvider.getRepositoryContext("remoterepo"); URI remoteURI = remote.repositoryURI; s = s.replace("${remoterepo}", remoteURI.toString()); } if (s.contains("${remote repo}")) { CLIContext remote = contextProvider.getRepositoryContext("remote repo"); URI remoteURI = remote.repositoryURI; s = s.replace("${remote repo}", remoteURI.toString()); } if (s.contains("${rootRepoURI}")) { URI rootRepoURI = contextProvider.getURIBuilder().buildRootURI(localRepo.platform); s = s.replace("${rootRepoURI}", rootRepoURI.toString()); } return s; }
private String replaceKnownVariables(String s) throws IOException { if (s.contains("${currentdir}")) { File pwd = localRepo.platform.pwd(); s = s.replace("${currentdir}", pwd.getCanonicalPath().replace("\\", "/")); s = s.replace("\"", ""); } if (s.contains("${repoURI}")) { URI uri = localRepo.repositoryURI; s = s.replace("${repoURI}", uri.toString()); } if (s.contains("${localrepo}")) { URI uri = localRepo.repositoryURI; s = s.replace("${localrepo}", uri.toString()); } if (s.contains("${remoterepo}")) { CLIContext remote = contextProvider.getRepositoryContext("remoterepo"); URI remoteURI = remote.repositoryURI; s = s.replace("${remoterepo}", remoteURI.toString()); } if (s.contains("${remote repo}")) { CLIContext remote = contextProvider.getRepositoryContext("remote repo"); URI remoteURI = remote.repositoryURI; s = s.replace("${remote repo}", remoteURI.toString()); } if (s.contains("${rootRepoURI}")) { URI rootRepoURI = contextProvider.getURIBuilder().buildRootURI(localRepo.platform); s = s.replace("${rootRepoURI}", rootRepoURI.toString()); } return s; }
@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()); }