JcrFactory { public static NodeStoreFixture getReadOnlyFixture(final File segmentStore, final String... args) throws Exception { return getNodeStoreFixture(true, segmentStore, args); } private  JcrFactory(); static Repository getJcr(final NodeStoreFixture nodeStoreFixture); static Repository getJcr(final NodeStoreFixture nodeStoreFixture,
                                    final NodeStore globalStore); static NodeStoreFixture getNodeStoreFixture(final boolean readOnly, final String... args); static NodeStoreFixture getNodeStoreFixture(final boolean readOnly, final File segmentStore, final String... args); static NodeStoreFixture getReadOnlyFixture(final File segmentStore, final String... args); static NodeStoreFixture getReadWriteFixture(final File segmentStore, final String... args);  }
@Test(expected = UnsupportedOperationException.class) public void testGetReadOnlyFixture() throws Exception { final File seedDir = new File(testBaseDir, "testGetReadOnlyFixture/seedRepo/segmentstore"); TestUtil.prepareRepo(seedDir, session -> { session.getRootNode().addNode("foo", "nt:unstructured"); session.save(); }); final File globalDir = new File(testBaseDir, "testGetReadOnlyFixture/globalRepo/segmentstore"); TestUtil.prepareRepo(globalDir, session -> { }); try (NodeStoreFixture fixture = JcrFactory.getReadOnlyFixture(seedDir); NodeStoreFixture globalFixture = JcrFactory.getReadOnlyFixture(globalDir)) { TestUtil.compositeWithFixtures(fixture, globalFixture, session -> { session.getWorkspace().getNamespaceRegistry() .registerNamespace("foo", "http: }); } }