use of org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider in project jackrabbit-oak by apache.
the class SecurityProviderCallbackTest method testCallback.
@Test
public void testCallback() {
SecurityProviderCallback cb = new SecurityProviderCallback();
SecurityProvider sp = new OpenSecurityProvider();
cb.setSecurityProvider(sp);
assertSame(sp, cb.getSecurityProvider());
}
use of org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider in project jackrabbit-oak by apache.
the class AbstractLoginModuleTest method testGetSecurityProvider.
@Test
public void testGetSecurityProvider() {
AbstractLoginModule loginModule = initLoginModule(TestCredentials.class, new TestCallbackHandler(null, new OpenSecurityProvider(), null));
SecurityProvider securityProvider = loginModule.getSecurityProvider();
assertNotNull(securityProvider);
// securityProvider is stored as field -> second access returns the same object
assertSame(securityProvider, loginModule.getSecurityProvider());
}
use of org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider in project jackrabbit-oak by apache.
the class MountsNodeCounterTest method createRepository.
protected ContentRepository createRepository() {
Mounts.Builder builder = Mounts.newBuilder();
builder.mount("libs", false, Arrays.asList("/var/fragments"), Arrays.asList("/apps", "/libs", "/nested/mount"));
mip = builder.build();
nodeStore = new MemoryNodeStore();
Oak oak = new Oak(nodeStore).with(new InitialContent()).with(new OpenSecurityProvider()).with(new PropertyIndexEditorProvider().with(mip)).with(new NodeCounterEditorProvider().with(mip)).withAsyncIndexing("async", TimeUnit.DAYS.toSeconds(1));
wb = oak.getWhiteboard();
return oak.createContentRepository();
}
use of org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider in project jackrabbit-oak by apache.
the class DefaultThreeWayConflictHandlerOursTest method setUp.
@Before
public void setUp() throws CommitFailedException {
ContentSession session = new Oak().with(new OpenSecurityProvider()).with(DefaultThreeWayConflictHandler.OURS).createContentSession();
// Add test content
Root root = session.getLatestRoot();
Tree tree = root.getTree("/");
tree.setProperty("a", 1);
tree.setProperty("b", 2);
tree.setProperty("c", 3);
tree.addChild("x");
tree.addChild("y");
tree.addChild("z");
root.commit();
ourRoot = session.getLatestRoot();
theirRoot = session.getLatestRoot();
}
use of org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider in project jackrabbit-oak by apache.
the class OakTest method checkExecutorShutdown.
@Test
public void checkExecutorShutdown() throws Exception {
Runnable runnable = new Runnable() {
@Override
public void run() {
}
};
Oak oak = new Oak().with(new OpenSecurityProvider());
ContentRepository repo = oak.createContentRepository();
WhiteboardUtils.scheduleWithFixedDelay(oak.getWhiteboard(), runnable, 1);
((Closeable) repo).close();
try {
WhiteboardUtils.scheduleWithFixedDelay(oak.getWhiteboard(), runnable, 1);
fail("Executor should have rejected the task");
} catch (RejectedExecutionException ignore) {
}
// Externally passed executor should not be shutdown upon repository close
ScheduledExecutorService externalExecutor = Executors.newSingleThreadScheduledExecutor();
Oak oak2 = new Oak().with(new OpenSecurityProvider()).with(externalExecutor);
ContentRepository repo2 = oak2.createContentRepository();
WhiteboardUtils.scheduleWithFixedDelay(oak2.getWhiteboard(), runnable, 1);
((Closeable) repo2).close();
WhiteboardUtils.scheduleWithFixedDelay(oak2.getWhiteboard(), runnable, 1);
externalExecutor.shutdown();
}
Aggregations