@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();
  }
 /** Test method for {@link org.dspace.servicemanager.DSpaceKernelImpl#start()}. */
 @Test
 public void testKernel() {
   kernelImpl.start();
   assertNotNull(kernelImpl);
   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());
   kernelImpl.stop();
 }
示例#3
0
 /* (non-Javadoc)
  * @see org.dspace.kernel.CommonLifecycle#start()
  */
 public void start() {
   start(null);
 }