1 64 package com.jcorporate.expresso.kernel.test; 65 66 import com.jcorporate.expresso.kernel.RootContainerInterface; 67 import com.jcorporate.expresso.kernel.SystemFactory; 68 import com.jcorporate.expresso.kernel.exception.ConfigurationException; 69 import junit.framework.TestCase; 70 71 74 public class TestRuntimeInitServlet extends TestCase { 75 76 static RootContainerInterface globalContainer = null; 77 78 public TestRuntimeInitServlet(String _name) { 79 super(_name); 80 } 81 82 85 protected void setUp() { 86 } 87 88 91 protected void tearDown() { 92 } 93 94 97 public void testInit() { 98 try { 99 try { 100 globalContainer = SystemFactory.buildExpressoComponentSystem( 101 "D:/Expresso/devConfig/expresso-services.xml", null, "D:/Expresso/log"); 102 fail("Call should have thrown IllegalArgumentException"); 103 } catch (IllegalArgumentException iae) { 104 105 } 106 107 globalContainer = SystemFactory.buildExpressoComponentSystem("D:/Expresso/devConfig/expresso-services.xml", 108 "D:/expresso/devConfig/expressoLogging.xml", 109 "D:/Expresso/log"); 110 111 assertTrue(globalContainer != null); 112 } catch (ConfigurationException ex) { 113 ex.printStackTrace(); 114 fail("Error configing root container"); 115 } 116 } 117 118 121 public void testDestroy() { 122 if (globalContainer != null) { 123 globalContainer.destroy(); 124 globalContainer = null; 125 } 126 } 127 128 131 public static void main(String [] argv) { 132 String [] testCaseList = {TestRuntimeInitServlet.class.getName()}; 133 junit.textui.TestRunner.main(testCaseList); 134 } 135 } 136 | Popular Tags |