1 19 20 package org.netbeans.modules.j2ee.sun.test; 21 22 import javax.enterprise.deploy.shared.ModuleType ; 23 import javax.enterprise.deploy.spi.TargetModuleID ; 24 import org.netbeans.junit.NbTestCase; 25 import org.netbeans.junit.NbTestSuite; 26 import org.netbeans.modules.j2ee.deployment.impl.ServerInstance; 27 import org.netbeans.modules.j2ee.deployment.impl.ServerRegistry; 28 29 33 public class EjbModuleTest extends NbTestCase { 34 35 private final int SLEEP = 10000; 36 37 public EjbModuleTest(String testName) { 38 super(testName); 39 } 40 41 public void deployEjbModule() { 42 try { 43 Util.deployModule(ModuleType.EJB, Util.EJB_PROJECT_PATH, Util.EJB_PROJECT_NAME); 44 } catch(Exception e) { 45 fail(e.getMessage()); 46 } 47 } 48 49 public void undeployEjbModule() { 50 try { 51 ServerInstance si = ServerRegistry.getInstance().getServerInstance(Util._URL); 52 TargetModuleID moduleID = Util.getModuleID(ModuleType.EJB, Util.EJB_PROJECT_NAME, si,false); 53 54 if(moduleID == null) 55 return; 56 57 Util.undeployModule(ModuleType.EJB, Util.EJB_PROJECT_PATH, Util.EJB_PROJECT_NAME, moduleID); 58 } catch(Exception e) { 59 fail(e.getMessage()); 60 } 61 } 62 63 public static NbTestSuite suite() { 64 NbTestSuite suite = new NbTestSuite("EjbModuleTest"); 65 suite.addTest(new AddRemoveSjsasInstanceTest("addSjsasInstance")); 67 suite.addTest(new EjbModuleTest("deployEjbModule")); 68 suite.addTest(new EjbModuleTest("undeployEjbModule")); 69 suite.addTest(new StartStopServerTest("stopServer")); 70 suite.addTest(new AddRemoveSjsasInstanceTest("removeSjsasInstance")); 71 return suite; 72 } 73 } 74 | Popular Tags |