Search in sources :

Example 16 with TransientRepository

use of org.apache.jackrabbit.core.TransientRepository in project pentaho-platform by pentaho.

the class AbstractJcrBackedUserRoleDaoTest method beforeAll.

@BeforeClass
public static void beforeAll() throws Exception {
    Path repositoryPath = Files.createTempDirectory(TEST_REPOSITORY_LOCATION);
    InputStream configStream = AbstractJcrBackedUserRoleDaoTest.class.getResourceAsStream(REPO_CONFIG_FILE);
    Path repositoryLocation = repositoryPath.toAbsolutePath();
    RepositoryConfig config = RepositoryConfig.create(configStream, repositoryLocation.toString());
    repository = new TransientRepository(config);
    Credentials creds = new SimpleCredentials(ADMIN_USER, ADMIN_USER_PASS.toCharArray());
    adminSession = repository.login(creds);
    initMocks();
}
Also used : Path(java.nio.file.Path) RepositoryConfig(org.apache.jackrabbit.core.config.RepositoryConfig) SimpleCredentials(javax.jcr.SimpleCredentials) TransientRepository(org.apache.jackrabbit.core.TransientRepository) InputStream(java.io.InputStream) SimpleCredentials(javax.jcr.SimpleCredentials) Credentials(javax.jcr.Credentials) BeforeClass(org.junit.BeforeClass)

Aggregations

TransientRepository (org.apache.jackrabbit.core.TransientRepository)16 File (java.io.File)15 Node (javax.jcr.Node)10 Session (javax.jcr.Session)10 UUID (java.util.UUID)7 SimpleCredentials (javax.jcr.SimpleCredentials)6 ConsistencyReport (org.apache.jackrabbit.core.persistence.check.ConsistencyReport)6 RepositoryException (javax.jcr.RepositoryException)3 Context (javax.naming.Context)3 FileNotFoundException (java.io.FileNotFoundException)2 InputStream (java.io.InputStream)2 SQLException (java.sql.SQLException)2 ItemNotFoundException (javax.jcr.ItemNotFoundException)2 NodeIterator (javax.jcr.NodeIterator)2 ConstraintViolationException (javax.jcr.nodetype.ConstraintViolationException)2 FileOutputStream (java.io.FileOutputStream)1 OutputStream (java.io.OutputStream)1 Path (java.nio.file.Path)1 Credentials (javax.jcr.Credentials)1 AccessControlList (javax.jcr.security.AccessControlList)1