@Test public void testRegisterProviderWhenMarshallingErrors() throws Exception { prepareProviderTargetPath(); expectedException.expectMessage("Unexpected error was produced during provider marshalling/storing, provider: " + provider); doThrow(new Exception("no matter the message here")) .when(registryHelper) .storeEntry(providerTargetPath, provider); runtimeRegistry.registerProvider(provider); }
@Override public void registerProvider(final Provider provider) { checkNotNull("provider", provider); final Path path = buildProviderPath(provider.getId()); try { registryHelper.storeEntry(path, provider); } catch (Exception e) { logger.error("Unexpected error was produced during provider marshalling/storing, provider: " + provider, e); throw new RuntimeException("Unexpected error was produced during provider marshalling/storing, provider: " + provider, e); } super.registerProvider(provider); }
VFSRuntimeRegistry extends InMemoryRuntimeRegistry { @Override public void registerProvider(final Provider provider) { checkNotNull("provider", provider); final Path path = buildProviderPath(provider.getId()); try { registryHelper.storeEntry(path, provider); } catch (Exception e) { logger.error("Unexpected error was produced during provider marshalling/storing, provider: " + provider, e); throw new RuntimeException("Unexpected error was produced during provider marshalling/storing, provider: " + provider, e); } super.registerProvider(provider); } }
VFSRuntimeRegistry extends InMemoryRuntimeRegistry { @Override public void registerProvider(final Provider provider) { checkNotNull("provider", provider); final Path path = buildProviderPath(provider.getId()); try { registryHelper.storeEntry(path, provider); } catch (Exception e) { logger.error("Unexpected error was produced during provider marshalling/storing, provider: " + provider, e); throw new RuntimeException("Unexpected error was produced during provider marshalling/storing, provider: " + provider, e); } super.registerProvider(provider); } VFSRuntimeRegistry(); @Inject  VFSRuntimeRegistry(final VFSRegistryHelper registryHelper); }
VFSRuntimeRegistry extends InMemoryRuntimeRegistry { @Override public void registerProvider(final Provider provider) { checkNotNull("provider", provider); final Path path = buildProviderPath(provider.getId()); try { registryHelper.storeEntry(path, provider); } catch (Exception e) { logger.error("Unexpected error was produced during provider marshalling/storing, provider: " + provider, e); throw new RuntimeException("Unexpected error was produced during provider marshalling/storing, provider: " + provider, e); } super.registerProvider(provider); } 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 registerProvider(final Provider provider) { checkNotNull("provider", provider); final Path path = buildProviderPath(provider.getId()); try { registryHelper.storeEntry(path, provider); } catch (Exception e) { logger.error("Unexpected error was produced during provider marshalling/storing, provider: " + provider, e); throw new RuntimeException("Unexpected error was produced during provider marshalling/storing, provider: " + provider, e); } super.registerProvider(provider); } 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);  }