@Test public void shouldNotAutomaticallyStartDeployedRepositories() throws Exception { engine.start(); JcrRepository repository = engine.deploy(config); String name = repository.getName(); assertThat(engine.getRepositoryState(name), is(State.NOT_RUNNING)); engine.startRepository(name).get(); // blocks assertThat(engine.getRepositoryState(name), is(State.RUNNING)); engine.shutdownRepository(name).get(); // blocks assertThat(engine.getRepositoryState(name), is(State.NOT_RUNNING)); }
engine.startRepository(repository.getName()).get();
JcrRepository repository = ENGINE.deploy(config); try { ENGINE.startRepository(repository.getName()).get(); } catch (InterruptedException e) { Thread.interrupted();
JcrRepository repository = ENGINE.deploy(config); try { ENGINE.startRepository(repository.getName()).get(); } catch (InterruptedException e) { Thread.interrupted();
assertThat(engine.getRepositoryState(name), is(State.NOT_RUNNING)); assertThat(repository.getState(), is(State.NOT_RUNNING)); engine.startRepository(name).get(); // blocks assertThat(repository.getState(), is(State.RUNNING));
@Test public void shouldAllowUpdatingRepositoryConfigurationWhileRunning() throws Exception { engine.start(); JcrRepository repository = engine.deploy(config); String name = repository.getName(); assertThat(engine.getRepositoryState(name), is(State.NOT_RUNNING)); engine.startRepository(name).get(); // blocks assertThat(engine.getRepositoryState(name), is(State.RUNNING)); long defaultLargeValueSize = Default.MINIMUM_BINARY_SIZE_IN_BYTES; assertThat(config.getBinaryStorage().getMinimumBinarySizeInBytes(), is(defaultLargeValueSize)); assertThat(repository.repositoryCache().largeValueSizeInBytes(), is(defaultLargeValueSize)); // Change the configuration. We'll do something simple, like changing the large value size ... long newLargeValueSizeInBytes = defaultLargeValueSize * 2L; Editor editor = repository.getConfiguration().edit(); EditableDocument binaryStorage = editor.getOrCreateDocument(FieldName.STORAGE) .getOrCreateDocument(FieldName.BINARY_STORAGE); binaryStorage.setNumber(FieldName.MINIMUM_BINARY_SIZE_IN_BYTES, newLargeValueSizeInBytes); Changes changes = editor.getChanges(); // Apply the changes to the deployed repository ... engine.update(name, changes).get(); // blocks assertThat(engine.getRepositoryState(name), is(State.RUNNING)); // Verify the running repository and its configuraiton are using the new value ... RepositoryConfiguration newConfig = engine.getRepository(name).getConfiguration(); assertThat(newConfig.getBinaryStorage().getMinimumBinarySizeInBytes(), is(newLargeValueSizeInBytes)); assertThat(repository.repositoryCache().largeValueSizeInBytes(), is(newLargeValueSizeInBytes)); }