use of org.pentaho.platform.repository.JcrBackedDatasourceMgmtService in project pentaho-platform by pentaho.
the class DefaultDatasourceMgmtWebServiceTest method setUp.
public void setUp() throws Exception {
IUnifiedRepository repository = new MockUnifiedRepository(new MockUnifiedRepository.SpringSecurityCurrentUserProvider());
datasourceMgmtService = new JcrBackedDatasourceMgmtService(repository, new DatabaseDialectService());
datasourceMgmtWebService = new DefaultDatasourceMgmtWebService(datasourceMgmtService);
dbConnectionAdapter = new DatabaseConnectionAdapter();
SecurityContextHolder.getContext().setAuthentication(new UsernamePasswordAuthenticationToken(MockUnifiedRepository.root().getName(), null, new ArrayList<GrantedAuthority>()));
repository.createFolder(repository.getFile("/etc").getId(), new RepositoryFile.Builder(FOLDER_PDI).folder(true).build(), new RepositoryFileAcl.Builder(MockUnifiedRepository.root()).ace(MockUnifiedRepository.everyone(), READ, WRITE).build(), null);
repository.createFolder(repository.getFile("/etc/pdi").getId(), new RepositoryFile.Builder(FOLDER_DATABASES).folder(true).build(), null);
SecurityContextHolder.getContext().setAuthentication(new UsernamePasswordAuthenticationToken(EXP_LOGIN, null, new ArrayList<GrantedAuthority>()));
KettleClientEnvironment.init();
}
use of org.pentaho.platform.repository.JcrBackedDatasourceMgmtService in project pentaho-platform by pentaho.
the class DatasourceMgmtToWebServiceAdapterTest method setUp.
@Override
protected void setUp() throws Exception {
IUnifiedRepository repository = new MockUnifiedRepository(new MockUnifiedRepository.SpringSecurityCurrentUserProvider());
datasourceMgmtService = new JcrBackedDatasourceMgmtService(repository, new DatabaseDialectService());
datasourceMgmtWS = new DefaultDatasourceMgmtWebService(datasourceMgmtService);
adapter = new DatasourceMgmtToWebServiceAdapter(datasourceMgmtWS);
SecurityContextHolder.getContext().setAuthentication(new UsernamePasswordAuthenticationToken(MockUnifiedRepository.root().getName(), null, new ArrayList<GrantedAuthority>()));
repository.createFolder(repository.getFile("/etc").getId(), new RepositoryFile.Builder(FOLDER_PDI).folder(true).build(), new RepositoryFileAcl.Builder(MockUnifiedRepository.root()).ace(MockUnifiedRepository.everyone(), READ, WRITE).build(), null);
repository.createFolder(repository.getFile("/etc/pdi").getId(), new RepositoryFile.Builder(FOLDER_DATABASES).folder(true).build(), null);
SecurityContextHolder.getContext().setAuthentication(new UsernamePasswordAuthenticationToken(EXP_LOGIN, null, new ArrayList<GrantedAuthority>()));
KettleClientEnvironment.init();
}
Aggregations