@Before public void prepare() throws Exception { File tempDir = new File("target", "test-jcr2"); if (!tempDir.isDirectory()) { Util.unzip(AbstractOak2OakTest.class.getResourceAsStream("/jcr2.zip"), tempDir); } OakUpgrade.main("--copy-binaries", tempDir.getPath(), destinationContainer.getDescription()); destination = destinationContainer.open(); repository = (RepositoryImpl) new Jcr(destination).with("oak.sling").with(new ReferenceIndexProvider()).createRepository(); session = repository.login(new SimpleCredentials("admin", "admin".toCharArray())); }
.with(new ChangeCollectorProvider()) .with(JcrConflictHandler.createJcrConflictHandler()) .with(new ReferenceIndexProvider()) .with(new PropertyIndexProvider()) .with(new NodeTypeIndexProvider())
protected void createSession() throws RepositoryException, IOException { destination = getDestinationContainer().open(); repository = (RepositoryImpl) new Jcr(destination).with("oak.sling").with(new ReferenceIndexProvider()).createRepository(); session = repository.login(new SimpleCredentials("admin", "admin".toCharArray())); }
@Override protected ContentRepository createRepository() { return new Oak() .with(new InitialContent()) .with(new OpenSecurityProvider()) .with(new ReferenceIndexProvider()) .with(new OrderedPropertyIndexProvider()) .createContentRepository(); }
@Before public void before() throws Exception { Oak oak = new Oak() .with(new InitialContent()) .with(new VersionHook()) .with(JcrConflictHandler.createJcrConflictHandler()) .with(new NamespaceEditorProvider()) .with(new ReferenceEditorProvider()) .with(new ReferenceIndexProvider()) .with(new PropertyIndexEditorProvider()) .with(new PropertyIndexProvider()) .with(new TypeEditorProvider()) .with(new ConflictValidatorProvider()) .with(getQueryEngineSettings()) .with(getSecurityProvider()); withEditors(oak); contentRepository = oak.createContentRepository(); adminSession = createAdminSession(contentRepository); root = adminSession.getLatestRoot(); Configuration.setConfiguration(getConfiguration()); }
.with(new InitialContent()) .with(new ReferenceEditorProvider()) .with(new ReferenceIndexProvider()) .with(new PropertyIndexEditorProvider()) .with(new PropertyIndexProvider()) .with(new InitialContent()) .with(new ReferenceEditorProvider()) .with(new ReferenceIndexProvider()) .with(new PropertyIndexEditorProvider()) .with(new PropertyIndexProvider())