use of org.pentaho.agilebi.modeler.geo.GeoContextPropertiesProvider in project data-access by pentaho.
the class DataAccessServiceTestBase method setUp.
@Before
public void setUp() throws Exception {
platform = new MicroPlatform();
metadataRepository = mock(IMetadataDomainRepository.class);
platform.defineInstance(IMetadataDomainRepository.class, metadataRepository);
importer = mock(IPlatformImporter.class);
platform.defineInstance(IPlatformImporter.class, importer);
policy = mock(IAuthorizationPolicy.class);
platform.defineInstance(IAuthorizationPolicy.class, policy);
catalogService = mock(IAclAwareMondrianCatalogService.class);
platform.defineInstance(IMondrianCatalogService.class, catalogService);
permissionHandler = mock(IDataAccessPermissionHandler.class);
platform.defineInstance(IDataAccessPermissionHandler.class, permissionHandler);
userRoleListService = mock(IUserRoleListService.class);
platform.defineInstance(IUserRoleListService.class, userRoleListService);
pluginResourceLoader = mock(IPluginResourceLoader.class);
platform.defineInstance(IPluginResourceLoader.class, pluginResourceLoader);
mondrianCatalogService = mock(IMondrianCatalogService.class);
platform.defineInstance(IMondrianCatalogService.class, mondrianCatalogService);
final IUnifiedRepository unifiedRepository = new FileSystemBackedUnifiedRepository("target/test-classes/solution1");
platform.defineInstance(IUnifiedRepository.class, unifiedRepository);
platform.defineInstance(String.class, "admin");
config = new GeoContextPropertiesProvider(getGeoProps());
GeoContext geo = GeoContextFactory.create(config);
platform.start();
acl.setOwner("owner");
acl.setOwnerType(RepositoryFileSid.Type.USER.ordinal());
modelerService = new ModelerService();
datasourceService = mock(DSWDatasourceServiceImpl.class);
when(datasourceService.getGeoContext()).thenReturn(geo);
modelerService.setDatasourceService(datasourceService);
domain = getDomain();
}
use of org.pentaho.agilebi.modeler.geo.GeoContextPropertiesProvider in project data-access by pentaho.
the class InMemoryDSWDatasourceServiceImpl method getGeoContext.
public GeoContext getGeoContext() throws DatasourceServiceException {
try {
Properties props = new Properties();
props.load(new FileInputStream(new File("target/test-classes/geoContextSample.properties")));
GeoContext geo = GeoContextFactory.create(new GeoContextPropertiesProvider(props));
return geo;
} catch (ModelerException e) {
throw new DatasourceServiceException(e);
} catch (FileNotFoundException e) {
throw new DatasourceServiceException(e);
} catch (IOException e) {
// To change body of catch statement use File | Settings | File Templates.
e.printStackTrace();
}
return null;
}
Aggregations