@Test public void testRegisterRuntimeWhenMarshallingErrors() throws Exception { prepareRuntimeTargetPath(); expectedException.expectMessage("Unexpected error was produced during runtime marshalling/storing, runtime: " + runtime); doThrow(new Exception("no matter the message here")) .when(registryHelper) .storeEntry(runtimeTargetPath, runtime); runtimeRegistry.registerRuntime(runtime); }
@Override public void registerRuntime(final Runtime runtime) { checkNotNull("runtime", runtime); final Path path = buildRuntimePath(runtime.getId()); try { registryHelper.storeEntry(path, runtime); } catch (Exception e) { logger.error("Unexpected error was produced during runtime marshalling/storing, runtime: " + runtime, e); throw new RuntimeException("Unexpected error was produced during runtime marshalling/storing, runtime: " + runtime, e); } super.registerRuntime(runtime); }
VFSRuntimeRegistry extends InMemoryRuntimeRegistry { @Override public void registerRuntime(final Runtime runtime) { checkNotNull("runtime", runtime); final Path path = buildRuntimePath(runtime.getId()); try { registryHelper.storeEntry(path, runtime); } catch (Exception e) { logger.error("Unexpected error was produced during runtime marshalling/storing, runtime: " + runtime, e); throw new RuntimeException("Unexpected error was produced during runtime marshalling/storing, runtime: " + runtime, e); } super.registerRuntime(runtime); } }
VFSRuntimeRegistry extends InMemoryRuntimeRegistry { @Override public void registerRuntime(final Runtime runtime) { checkNotNull("runtime", runtime); final Path path = buildRuntimePath(runtime.getId()); try { registryHelper.storeEntry(path, runtime); } catch (Exception e) { logger.error("Unexpected error was produced during runtime marshalling/storing, runtime: " + runtime, e); throw new RuntimeException("Unexpected error was produced during runtime marshalling/storing, runtime: " + runtime, e); } super.registerRuntime(runtime); } VFSRuntimeRegistry(); @Inject  VFSRuntimeRegistry(final VFSRegistryHelper registryHelper); }
VFSRuntimeRegistry extends InMemoryRuntimeRegistry { @Override public void registerRuntime(final Runtime runtime) { checkNotNull("runtime", runtime); final Path path = buildRuntimePath(runtime.getId()); try { registryHelper.storeEntry(path, runtime); } catch (Exception e) { logger.error("Unexpected error was produced during runtime marshalling/storing, runtime: " + runtime, e); throw new RuntimeException("Unexpected error was produced during runtime marshalling/storing, runtime: " + runtime, e); } super.registerRuntime(runtime); } VFSRuntimeRegistry(); @Inject  VFSRuntimeRegistry(final VFSRegistryHelper registryHelper); @Override void registerProvider(final Provider provider); @Override void deregisterProvider(final Provider provider); @Override void deregisterProvider(final String providerId); @Override void registerRuntime(final Runtime runtime); @Override void deregisterRuntime(final RuntimeId runtimeId); }
VFSRuntimeRegistry extends InMemoryRuntimeRegistry { @Override public void registerRuntime(final Runtime runtime) { checkNotNull("runtime", runtime); final Path path = buildRuntimePath(runtime.getId()); try { registryHelper.storeEntry(path, runtime); } catch (Exception e) { logger.error("Unexpected error was produced during runtime marshalling/storing, runtime: " + runtime, e); throw new RuntimeException("Unexpected error was produced during runtime marshalling/storing, runtime: " + runtime, e); } super.registerRuntime(runtime); } VFSRuntimeRegistry(); @Inject  VFSRuntimeRegistry(final VFSRegistryHelper registryHelper); @Override void registerProvider(final Provider provider); @Override void deregisterProvider(final Provider provider); @Override void deregisterProvider(final String providerId); @Override void registerRuntime(final Runtime runtime); @Override void deregisterRuntime(final RuntimeId runtimeId);  }