use of org.apache.ignite.internal.processors.security.NoOpIgniteSecurityProcessor in project ignite by apache.
the class GridManagerStopSelfTest method beforeTest.
/**
* {@inheritDoc}
*/
@Override
protected void beforeTest() throws Exception {
ctx = newContext();
ctx.config().setPeerClassLoadingEnabled(true);
ctx.config().setMBeanServer(ManagementFactory.getPlatformMBeanServer());
ctx.add(new PoolProcessor(ctx));
ctx.add(new NoOpIgniteSecurityProcessor(ctx));
ctx.add(new GridResourceProcessor(ctx));
ctx.add(new GridSystemViewManager(ctx));
ctx.start();
}
use of org.apache.ignite.internal.processors.security.NoOpIgniteSecurityProcessor in project ignite by apache.
the class GridFutureAdapterSelfTest method testListenNotify.
/**
* @throws Exception If failed.
*/
@Test
public void testListenNotify() throws Exception {
GridTestKernalContext ctx = new GridTestKernalContext(log);
ctx.add(new NoOpIgniteSecurityProcessor(ctx));
ctx.add(new PoolProcessor(ctx) {
final ExecutorService execSvc = Executors.newSingleThreadExecutor(new IgniteThreadFactory("testscope", "exec-svc"));
final ExecutorService sysExecSvc = Executors.newSingleThreadExecutor(new IgniteThreadFactory("testscope", "system-exec"));
@Override
public ExecutorService getSystemExecutorService() {
return sysExecSvc;
}
@Override
public ExecutorService getExecutorService() {
return execSvc;
}
});
ctx.add(new GridClosureProcessor(ctx));
ctx.start();
try {
GridFutureAdapter<String> fut = new GridFutureAdapter<>();
int lsnrCnt = 10;
final CountDownLatch latch = new CountDownLatch(lsnrCnt);
final Thread runThread = Thread.currentThread();
for (int i = 0; i < lsnrCnt; i++) {
fut.listen(new CI1<IgniteInternalFuture<String>>() {
@Override
public void apply(IgniteInternalFuture<String> t) {
assert Thread.currentThread() == runThread;
latch.countDown();
}
});
}
fut.onDone();
latch.await();
final CountDownLatch doneLatch = new CountDownLatch(1);
fut.listen(new CI1<IgniteInternalFuture<String>>() {
@Override
public void apply(IgniteInternalFuture<String> t) {
assert Thread.currentThread() == runThread;
doneLatch.countDown();
}
});
assert doneLatch.getCount() == 0;
doneLatch.await();
} finally {
ctx.stop(false);
}
}
Aggregations