Ejemplo n.º 1
0
  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();
    }
  }
Ejemplo n.º 2
0
  private void testImplementationType(ImplementationType implementationType) {
    ProtonFactoryLoader<DummyProtonFactory> factoryLoader =
        new ProtonFactoryLoader<DummyProtonFactory>(DummyProtonFactory.class, implementationType);

    assertEquals(implementationType, factoryLoader.loadFactory().getImplementationType());
  }