1 17 18 package org.apache.geronimo.kernel; 19 20 import java.io.File ; 21 22 import junit.framework.TestCase; 23 24 27 public class BootstrapTest extends TestCase { 28 private File kernelState; 29 30 public void testCreate() throws Exception { 31 Kernel kernel = KernelFactory.newInstance().createKernel("test.kernel"); 32 assertEquals("No kernel should be registered", null, KernelRegistry.getKernel("test.kernel")); 33 kernel.boot(); 34 assertEquals("test.kernel kernel should be registered", kernel, KernelRegistry.getKernel("test.kernel")); 35 kernel.shutdown(); 36 assertEquals("No kernel should be registered", null, KernelRegistry.getKernel("test.kernel")); 37 } 38 39 protected void setUp() throws Exception { 40 super.setUp(); 41 File tmpDir = new File (System.getProperty("java.io.tmpdir")); 42 kernelState = new File (tmpDir, "kernel.ser"); 43 } 44 45 protected void tearDown() throws Exception { 46 kernelState.delete(); 47 super.tearDown(); 48 } 49 } 50 | Popular Tags |