private void testLoadFactoryUsingImplementationTypeFromSystemProperty( String implementationTypeName) { try { setImplementationTypeSystemProperty(implementationTypeName); ProtonFactoryLoader<DummyProtonFactory> factoryLoader = new ProtonFactoryLoader<DummyProtonFactory>(DummyProtonFactory.class); DummyProtonFactory factory = factoryLoader.loadFactory(); assertNotNull(factory); if (implementationTypeName != null) { assertEquals( ImplementationType.valueOf(implementationTypeName), factory.getImplementationType()); } } finally { resetImplementationTypeSystemProperty(); } }
private void testImplementationType(ImplementationType implementationType) { ProtonFactoryLoader<DummyProtonFactory> factoryLoader = new ProtonFactoryLoader<DummyProtonFactory>(DummyProtonFactory.class, implementationType); assertEquals(implementationType, factoryLoader.loadFactory().getImplementationType()); }