use of org.pentaho.platform.plugin.action.olap.impl.OlapServiceImpl in project pentaho-platform by pentaho.
the class OlapServiceImplTest method setUp.
@Before
public void setUp() throws Exception {
// Stub /etc/mondrian
mondrianFolderPath = ClientRepositoryPaths.getEtcFolderPath() + RepositoryFile.SEPARATOR + "mondrian";
stubGetFolder(repository, mondrianFolderPath);
// Stub /etc/olap-servers
olapFolderPath = ClientRepositoryPaths.getEtcFolderPath() + RepositoryFile.SEPARATOR + "olap-servers";
stubGetFolder(repository, olapFolderPath);
// Create a session as admin.
session = new StandaloneSession("admin");
doReturn(aggManager).when(server).getAggregationManager();
doReturn(cacheControl).when(aggManager).getCacheControl(any(RolapConnection.class), any(PrintWriter.class));
// Create the olap service. Make sure to override hasAccess with the
// mock version.
olapService = spy(new OlapServiceImpl(repository, server) {
public boolean hasAccess(String path, EnumSet<RepositoryFilePermission> perms, IPentahoSession session) {
return accessMock.hasAccess(path, perms, session);
}
@Override
protected XmlaHandler.XmlaExtra getXmlaExtra(final OlapConnection connection) throws SQLException {
return mockXmlaExtra;
}
});
}
Aggregations