assertNotNull(e.getMessage());
}
DSpaceKernelImpl kernelImpl = DSpaceKernelInit.getKernel(null);
kernelImpl.start(); // triggers the init
DSpaceKernel kernel = new DSpaceKernelManager().getKernel();
assertNotNull(kernel);
assertEquals(kernel, kernelImpl);
DSpace dspace = new DSpace();
Object o = dspace.getServiceManager();
assertNotNull(o);
assertEquals(o, kernel.getServiceManager());
// repeat a few times
o = dspace.getServiceManager();
assertNotNull(o);
assertEquals(o, kernel.getServiceManager());
o = dspace.getServiceManager();
assertNotNull(o);
assertEquals(o, kernel.getServiceManager());
DSpace dspace2 = new DSpace();
assertNotNull(dspace2.getServiceManager());
assertEquals(dspace.getServiceManager(), dspace2.getServiceManager());
// REPEAT
kernel = new DSpaceKernelManager().getKernel();
o = dspace.getServiceManager();
assertNotNull(o);
assertEquals(o, kernel.getServiceManager());
// repeat a few times
o = dspace.getServiceManager();
assertNotNull(o);
assertEquals(o, kernel.getServiceManager());
o = dspace.getServiceManager();
assertNotNull(o);
assertEquals(o, kernel.getServiceManager());
//trash the references
kernelImpl.destroy();
kernelImpl = null;
kernel = null;