1 19 20 package org.netbeans.modules.j2ee.sun.test; 21 22 import java.io.File ; 23 import javax.enterprise.deploy.shared.ModuleType ; 24 import javax.enterprise.deploy.spi.TargetModuleID ; 25 import org.netbeans.api.project.Project; 26 import org.netbeans.junit.NbTestCase; 27 import org.netbeans.junit.NbTestSuite; 28 import org.netbeans.modules.j2ee.deployment.impl.ServerInstance; 29 import org.netbeans.modules.j2ee.deployment.impl.ServerRegistry; 30 31 35 public class WebModuleTest extends NbTestCase { 36 37 private final int SLEEP = 10000; 38 static private Project p = null; 39 40 public WebModuleTest(String testName) { 41 super(testName); 42 } 43 44 public void deployWebModule() { 45 try { 46 Util.deployModule(ModuleType.WAR, p, Util.WEB_PROJECT_NAME); 51 } catch(Exception e) { 52 e.printStackTrace(); 53 fail(e.getMessage()); 54 } 55 } 56 57 public void undeployWebModule() { 58 try { 59 ServerInstance si = ServerRegistry.getInstance().getServerInstance(Util._URL); 60 TargetModuleID moduleID = Util.getModuleID(ModuleType.WAR, Util.WEB_PROJECT_NAME, si,false); 61 62 if(moduleID == null) 63 fail("isn't the web module supposed to be here???"); 64 65 Util.undeployModule(ModuleType.WAR, Util.WEB_PROJECT_PATH, Util.WEB_PROJECT_NAME, moduleID); 66 } catch(Exception e) { 67 e.printStackTrace(); 68 fail(e.getMessage()); 69 } 70 } 71 72 public void openProject() { 73 p = (Project) Util.openProject(new java.io.File (Util.WEB_PROJECT_PATH)); 74 } 75 76 public void closeProject() { 77 Util.closeProject(Util.WEB_PROJECT_NAME); 78 } 79 80 public static NbTestSuite suite() { 81 NbTestSuite suite = new NbTestSuite("WebModuleTest"); 82 suite.addTest(new AddRemoveSjsasInstanceTest("addSjsasInstance")); 83 suite.addTest(new WebModuleTest("openProject")); 84 85 suite.addTest(new WebModuleTest("deployWebModule")); 87 suite.addTest(new WebModuleTest("deployWebModule")); 88 suite.addTest(new WebModuleTest("deployWebModule")); 89 suite.addTest(new WebModuleTest("deployWebModule")); 90 suite.addTest(new WebModuleTest("deployWebModule")); 91 suite.addTest(new WebModuleTest("deployWebModule")); 92 suite.addTest(new WebModuleTest("deployWebModule")); 93 suite.addTest(new WebModuleTest("deployWebModule")); 94 suite.addTest(new WebModuleTest("deployWebModule")); 95 suite.addTest(new WebModuleTest("deployWebModule")); 96 suite.addTest(new WebModuleTest("deployWebModule")); 97 suite.addTest(new WebModuleTest("deployWebModule")); 98 suite.addTest(new WebModuleTest("deployWebModule")); 99 suite.addTest(new WebModuleTest("deployWebModule")); 100 suite.addTest(new WebModuleTest("deployWebModule")); 101 suite.addTest(new WebModuleTest("deployWebModule")); 102 suite.addTest(new WebModuleTest("deployWebModule")); 103 suite.addTest(new WebModuleTest("deployWebModule")); 104 suite.addTest(new WebModuleTest("deployWebModule")); 105 suite.addTest(new WebModuleTest("deployWebModule")); 106 suite.addTest(new WebModuleTest("undeployWebModule")); 107 108 suite.addTest(new WebModuleTest("deployWebModule")); 110 suite.addTest(new WebModuleTest("undeployWebModule")); 111 suite.addTest(new WebModuleTest("deployWebModule")); 112 suite.addTest(new WebModuleTest("undeployWebModule")); 113 suite.addTest(new WebModuleTest("deployWebModule")); 114 suite.addTest(new WebModuleTest("undeployWebModule")); 115 suite.addTest(new WebModuleTest("deployWebModule")); 116 suite.addTest(new WebModuleTest("undeployWebModule")); 117 suite.addTest(new WebModuleTest("deployWebModule")); 118 suite.addTest(new WebModuleTest("undeployWebModule")); 119 suite.addTest(new WebModuleTest("deployWebModule")); 120 suite.addTest(new WebModuleTest("undeployWebModule")); 121 suite.addTest(new WebModuleTest("deployWebModule")); 122 suite.addTest(new WebModuleTest("undeployWebModule")); 123 suite.addTest(new WebModuleTest("deployWebModule")); 124 suite.addTest(new WebModuleTest("undeployWebModule")); 125 suite.addTest(new WebModuleTest("deployWebModule")); 126 suite.addTest(new WebModuleTest("undeployWebModule")); 127 suite.addTest(new WebModuleTest("deployWebModule")); 128 suite.addTest(new WebModuleTest("undeployWebModule")); 129 suite.addTest(new WebModuleTest("deployWebModule")); 130 suite.addTest(new WebModuleTest("undeployWebModule")); 131 suite.addTest(new WebModuleTest("deployWebModule")); 132 suite.addTest(new WebModuleTest("undeployWebModule")); 133 suite.addTest(new WebModuleTest("deployWebModule")); 134 suite.addTest(new WebModuleTest("undeployWebModule")); 135 suite.addTest(new WebModuleTest("deployWebModule")); 136 suite.addTest(new WebModuleTest("undeployWebModule")); 137 suite.addTest(new WebModuleTest("deployWebModule")); 138 suite.addTest(new WebModuleTest("undeployWebModule")); 139 suite.addTest(new WebModuleTest("deployWebModule")); 140 suite.addTest(new WebModuleTest("undeployWebModule")); 141 suite.addTest(new WebModuleTest("deployWebModule")); 142 suite.addTest(new WebModuleTest("undeployWebModule")); 143 suite.addTest(new WebModuleTest("deployWebModule")); 144 suite.addTest(new WebModuleTest("undeployWebModule")); 145 suite.addTest(new WebModuleTest("deployWebModule")); 146 suite.addTest(new WebModuleTest("undeployWebModule")); 147 suite.addTest(new WebModuleTest("deployWebModule")); 148 suite.addTest(new WebModuleTest("undeployWebModule")); 149 suite.addTest(new WebModuleTest("closeProject")); 150 suite.addTest(new StartStopServerTest("stopServer")); 151 suite.addTest(new AddRemoveSjsasInstanceTest("removeSjsasInstance")); 152 return suite; 153 } 154 } | Popular Tags |