@Test public void testMultipleKernels() { assertNotNull(kernelImpl); kernelImpl.start(); DSpaceKernel kernel = kernelImpl.getManagedBean(); assertNotNull(kernel); assertNotNull(kernelImpl.getConfigurationService()); assertNotNull(kernelImpl.getServiceManager()); assertNotNull(kernel.getConfigurationService()); assertNotNull(kernel.getServiceManager()); assertEquals(kernel.getConfigurationService(), kernelImpl.getConfigurationService()); assertEquals(kernel.getServiceManager(), kernelImpl.getServiceManager()); DSpaceKernelImpl kernelImpl2 = DSpaceKernelInit.getKernel("AZ-kernel"); // checks for the existing kernel but does not init kernelImpl2.start(); DSpaceKernel kernel2 = kernelImpl2.getManagedBean(); assertNotNull(kernel2); assertNotNull(kernelImpl2.getConfigurationService()); assertNotNull(kernelImpl2.getServiceManager()); assertNotNull(kernel2.getConfigurationService()); assertNotNull(kernel2.getServiceManager()); assertEquals(kernel2.getConfigurationService(), kernelImpl2.getConfigurationService()); assertEquals(kernel2.getServiceManager(), kernelImpl2.getServiceManager()); assertNotSame(kernel, kernel2); assertNotSame(kernel.getConfigurationService(), kernel2.getConfigurationService()); assertNotSame(kernel.getServiceManager(), kernel2.getServiceManager()); kernelImpl2.stop(); kernelImpl.stop(); }
@Before public void init() { kernelImpl = DSpaceKernelInit.getKernel(null); // checks for the existing kernel but does not init }