DIServerConfig extends SlaveServerConfig { @Override public Repository getRepository() throws KettleException { Repository repository = super.getRepository(); if ( repository == null && repositoryInProcess() ) { try { repository = connectInProcessRepository(); } catch ( Exception e ) { Logger.warn( this, e.getMessage(), e ); repository = null; } } return repository; } DIServerConfig( LogChannel logChannel, Node configNode );  DIServerConfig( LogChannel logChannel, Node configNode, PluginRegistry pluginRegistry ); @Override Repository getRepository(); @Override DelegatingMetaStore getMetaStore(); static final String SINGLE_DI_SERVER_INSTANCE; static final String PUR_REPOSITORY_PLUGIN_ID; }
@Test public void testGetRepositoryWithDefault() throws Exception { DIServerConfig diConfig = new DIServerConfig( logChannel, getConfigNode(), pluginRegistry ); assertEquals( purRepository, diConfig.getRepository() ); verifyConnection(); }
@Test public void testGetRepositoryWithConfig() throws Exception { Repository repo = mock( Repository.class ); DIServerConfig diConfig = new DIServerConfig( logChannel, getConfigNode(), pluginRegistry ); diConfig.setRepository( repo ); assertEquals( repo, diConfig.getRepository() ); verify( purRepository, never() ).init( any( RepositoryMeta.class ) ); verify( purRepository, never() ).connect( anyString(), anyString() ); }