use of org.pentaho.metastore.stores.delegate.DelegatingMetaStore in project pentaho-platform by pentaho.
the class DIServerConfigTest method testGetMetaStoreWithConfig.
@Test
public void testGetMetaStoreWithConfig() throws Exception {
Repository repo = mock(Repository.class);
DelegatingMetaStore delegatingMetaStore = mock(DelegatingMetaStore.class);
DIServerConfig diConfig = new DIServerConfig(logChannel, getConfigNode(), pluginRegistry);
diConfig.setRepository(repo);
diConfig.setMetaStore(delegatingMetaStore);
assertEquals(delegatingMetaStore, diConfig.getMetaStore());
verifyNoMoreInteractions(delegatingMetaStore);
verify(purRepository, never()).init(any(RepositoryMeta.class));
verify(purRepository, never()).connect(anyString(), anyString());
}
use of org.pentaho.metastore.stores.delegate.DelegatingMetaStore in project pentaho-platform by pentaho.
the class DIServerConfig method getMetaStore.
@Override
public DelegatingMetaStore getMetaStore() {
DelegatingMetaStore metaStore = super.getMetaStore();
try {
Repository configuredRepository = super.getRepository();
if (configuredRepository == null && repositoryInProcess()) {
Repository inProcessRepository = connectInProcessRepository();
if (inProcessRepository != null) {
metaStore = new DelegatingMetaStore(inProcessRepository.getMetaStore());
metaStore.setActiveMetaStoreName(inProcessRepository.getMetaStore().getName());
}
}
} catch (Exception e) {
// Something failed, give up and use default
Logger.warn(this, e.getMessage(), e);
metaStore = super.getMetaStore();
}
return metaStore;
}
Aggregations