use of org.apache.jackrabbit.oak.spi.whiteboard.DefaultWhiteboard in project jackrabbit-oak by apache.
the class StatisticManagerTest method defaultSetup.
@Test
public void defaultSetup() throws Exception {
Whiteboard wb = new DefaultWhiteboard();
StatisticManager mgr = new StatisticManager(wb, executorService);
MeterStats meterStats = mgr.getMeter(Type.QUERY_COUNT);
meterStats.mark(5);
assertNotNull(WhiteboardUtils.getServices(wb, RepositoryStatsMBean.class));
assertNotNull(WhiteboardUtils.getServices(wb, QueryStatManagerMBean.class));
}
use of org.apache.jackrabbit.oak.spi.whiteboard.DefaultWhiteboard in project jackrabbit-oak by apache.
the class LoginContextProviderImplTest method testGetLoginContextWithInvalidProviderConfig.
@Test
public void testGetLoginContextWithInvalidProviderConfig() throws Exception {
ConfigurationParameters params = ConfigurationParameters.of(AuthenticationConfiguration.PARAM_CONFIG_SPI_NAME, "invalid");
LoginContextProvider provider = new LoginContextProviderImpl(AuthenticationConfiguration.DEFAULT_APP_NAME, params, getContentRepository(), getSecurityProvider(), new DefaultWhiteboard());
// invalid configuration falls back to default configuration
LoginContext ctx = provider.getLoginContext(new SimpleCredentials(getTestUser().getID(), getTestUser().getID().toCharArray()), null);
ctx.login();
}
use of org.apache.jackrabbit.oak.spi.whiteboard.DefaultWhiteboard in project jackrabbit-oak by apache.
the class AbstractLoginModuleTest method testGetWhiteboardFromCallback.
@Test
public void testGetWhiteboardFromCallback() {
AbstractLoginModule loginModule = initLoginModule(TestCredentials.class, new TestCallbackHandler(new DefaultWhiteboard()));
Whiteboard wb = loginModule.getWhiteboard();
assertNotNull(wb);
// whiteboard is stored as field -> second access returns the same object
assertSame(wb, loginModule.getWhiteboard());
}
use of org.apache.jackrabbit.oak.spi.whiteboard.DefaultWhiteboard in project sling by apache.
the class RepositoryTestHelper method createOakRepository.
public static Repository createOakRepository(NodeStore nodeStore) {
DefaultWhiteboard whiteboard = new DefaultWhiteboard();
final Oak oak = new Oak(nodeStore).with(new InitialContent()).with(JcrConflictHandler.createJcrConflictHandler()).with(new EditorHook(new VersionEditorProvider())).with(new OpenSecurityProvider()).with(new NamespaceEditorProvider()).with(new TypeEditorProvider()).with(new ConflictValidatorProvider()).with(//getDefaultWorkspace())
"default").with(whiteboard);
// if (commitRateLimiter != null) {
// oak.with(commitRateLimiter);
// }
final ContentRepository contentRepository = oak.createContentRepository();
return new RepositoryImpl(contentRepository, whiteboard, new OpenSecurityProvider(), 1000, null);
}
use of org.apache.jackrabbit.oak.spi.whiteboard.DefaultWhiteboard in project jackrabbit-oak by apache.
the class OakTest method checkMissingStrategySetting.
@Test(expected = CommitFailedException.class)
public void checkMissingStrategySetting() throws Exception {
Whiteboard wb = new DefaultWhiteboard();
WhiteboardIndexEditorProvider wbProvider = new WhiteboardIndexEditorProvider();
wbProvider.start(wb);
Registration r1 = wb.register(IndexEditorProvider.class, new PropertyIndexEditorProvider(), null);
Registration r2 = wb.register(IndexEditorProvider.class, new ReferenceEditorProvider(), null);
Oak oak = new Oak().with(new OpenSecurityProvider()).with(new InitialContent()).with(wb).with(wbProvider).withFailOnMissingIndexProvider();
ContentRepository repo = oak.createContentRepository();
ContentSession cs = repo.login(null, null);
Root root = cs.getLatestRoot();
Tree t = root.getTree("/");
t.setProperty("foo", "u1", Type.REFERENCE);
r1.unregister();
root.commit();
cs.close();
((Closeable) repo).close();
}
Aggregations