use of org.pentaho.platform.plugin.action.mondrian.catalog.MondrianCatalog in project data-access by pentaho.
the class AnalysisServiceTest method testImportingSkipsRemoveWhenNotPresent.
@Test
public void testImportingSkipsRemoveWhenNotPresent() throws Exception {
MondrianCatalog otherCatalog = new MondrianCatalog("other", "", "", null);
when(catalogService.listCatalogs(any(IPentahoSession.class), eq(false))).thenReturn(Collections.singletonList(otherCatalog));
putMondrianSchemaWithSchemaFileName("stubFileName", "overwrite=true");
verify(importer).importFile(argThat(matchBundle(true, acl)));
verify(catalogService, never()).removeCatalog(eq("sales"), any(IPentahoSession.class));
}
use of org.pentaho.platform.plugin.action.mondrian.catalog.MondrianCatalog in project data-access by pentaho.
the class AnalysisServiceTest method testSetAnalysisDatasourceAcl.
@Test
public void testSetAnalysisDatasourceAcl() throws Exception {
allAccess();
final String catalogName = "catalogName";
final RepositoryFileAclDto aclDto = new RepositoryFileAclDto();
aclDto.setOwner("owner");
aclDto.setOwnerType(RepositoryFileSid.Type.USER.ordinal());
final MondrianCatalog mondrianCatalog = mock(MondrianCatalog.class);
when(catalogService.getCatalog(eq(catalogName), any(IPentahoSession.class))).thenReturn(mondrianCatalog);
analysisService.setAnalysisDatasourceAcl(catalogName, aclDto);
verify(catalogService).setAclFor(eq(catalogName), eq(new RepositoryFileAclAdapter().unmarshal(aclDto)));
}
use of org.pentaho.platform.plugin.action.mondrian.catalog.MondrianCatalog in project data-access by pentaho.
the class AnalysisServiceTest method testGetAnalysisDatasourceAcl.
@Test
public void testGetAnalysisDatasourceAcl() throws Exception {
allAccess();
final String catalogName = "SampleData";
final RepositoryFileAcl expectedAcl = new RepositoryFileAcl.Builder("owner").build();
when(catalogService.getAclFor(catalogName)).thenReturn(expectedAcl);
final MondrianCatalog mondrianCatalog = mock(MondrianCatalog.class);
when(catalogService.getCatalog(eq(catalogName), any(IPentahoSession.class))).thenReturn(mondrianCatalog);
final RepositoryFileAclDto actualAcl = analysisService.getAnalysisDatasourceAcl(catalogName);
assertEquals(expectedAcl, new RepositoryFileAclAdapter().unmarshal(actualAcl));
}
Aggregations