protected void startRepositoryWithConfigurationFrom(String pathToConfiguration) throws Exception { startRepositoryWithConfiguration(getClass().getClassLoader().getResourceAsStream(pathToConfiguration)); }
/** * Subclasses can call this method at the beginning of each test to shutdown any currently-running repository and to start up * a new repository with the given JSON configuration content. * * @param configInputStream the input stream containing the JSON content defining the configuration for the repository * @throws Exception if there was a problem starting the repository * @see #startRepositoryWithConfiguration(String) * @see #startRepositoryWithConfiguration(Document) * @see #startRepositoryWithConfiguration(RepositoryConfiguration) * @see #startRepositoryAutomatically */ protected void startRepositoryWithConfiguration( InputStream configInputStream ) throws Exception { assertThat(configInputStream, is(notNullValue())); RepositoryConfiguration config = RepositoryConfiguration.read(configInputStream, REPO_NAME); startRepositoryWithConfiguration(config); }
/** * Subclasses can call this method at the beginning of each test to shutdown any currently-running repository and to start up * a new repository with the given JSON configuration document. * * @param doc the JSON document containing the configuration for the repository * @throws Exception if there was a problem starting the repository * @see #startRepositoryWithConfiguration(String) * @see #startRepositoryWithConfiguration(InputStream) * @see #startRepositoryWithConfiguration(RepositoryConfiguration) * @see #startRepositoryAutomatically */ protected void startRepositoryWithConfiguration( Document doc ) throws Exception { assertThat(doc, is(notNullValue())); RepositoryConfiguration config = new RepositoryConfiguration(doc, REPO_NAME); startRepositoryWithConfiguration(config); }
/** * Subclasses can call this method at the beginning of each test to shutdown any currently-running repository and to start up * a new repository with the given JSON configuration content. * * @param configContent the JSON string containing the configuration for the repository (note that single quotes can be used * in place of double quote, making it easier for to specify a JSON content as a Java string) * @throws Exception if there was a problem starting the repository * @see #startRepositoryWithConfiguration(Document) * @see #startRepositoryWithConfiguration(InputStream) * @see #startRepositoryWithConfiguration(RepositoryConfiguration) * @see #startRepositoryAutomatically */ protected void startRepositoryWithConfiguration( String configContent ) throws Exception { assertThat(configContent, is(notNullValue())); Document doc = Json.read(configContent); startRepositoryWithConfiguration(doc); }