LmRuntimeBuilder { public LmRuntime build() throws IllegalStateException { if (targetRuntime == null) { throw new IllegalStateException("Required Cayenne 'targetRuntime' is not set"); } if (tokenManager == null) { tokenManager = new InMemoryTokenManager(); } Injector injector = DIBootstrap.createInjector(new LmRuntimeModule()); return new DefaultLmRuntime(injector); } LmRuntimeBuilder(); LmRuntimeBuilder adapter(LinkEtlAdapter adapter); LmRuntimeBuilder withTargetRuntime(ServerRuntime targetRuntime); LmRuntimeBuilder withTokenManager(ITokenManager tokenManager); LmRuntimeBuilder withConnector(String id, Connector connector); LmRuntimeBuilder withConnectorFactory(Class<C> connectorType,
                                                                       IConnectorFactory<C> factory); LmRuntimeBuilder withConnectorFactory(Class<C> connectorType,
                                                                       Class<? extends IConnectorFactory<C>> factoryType); LmRuntimeBuilder withConnectorFromTarget(); LmRuntimeBuilder withExtractorFactory(String extractorType, Class<? extends IExtractorFactory<?>> factoryType); LmRuntimeBuilder withExtractorFactory(String extractorType, IExtractorFactory<?> factory); LmRuntimeBuilder valueConverter(Class<?> javaType, ValueConverter converter); LmRuntimeBuilder extractorResolver(ResourceResolver loader); LmRuntimeBuilder extractorModelsRoot(File rootDir); LmRuntimeBuilder extractorModelsRoot(URL baseUrl); LmRuntime build(); static final String START_TOKEN_VAR; static final String END_TOKEN_VAR; }
@Test public void testBuild() { LmRuntimeBuilder builder = new LmRuntimeBuilder() .extractorResolver(mock(ResourceResolver.class)) .withTargetRuntime(cayenneRuntime); LmRuntime runtime = builder.build(); assertNotNull(runtime); ITaskService taskService = runtime.service(ITaskService.class); assertNotNull(taskService); assertNotNull(taskService.createOrUpdate(CayenneDataObject.class)); }