1 19 20 package org.netbeans.modules.tomcat5; 21 22 import junit.textui.TestRunner; 23 import org.netbeans.junit.NbTestSuite; 24 import org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties; 25 import org.netbeans.modules.tomcat5.util.TestBase; 26 27 31 public class TomcatManagerTest extends TestBase { 32 33 public TomcatManagerTest (String testName) { 34 super(testName); 35 } 36 37 protected void setUp () throws Exception { 38 super.setUp (); 39 } 40 41 public static NbTestSuite suite() { 42 NbTestSuite suite = new NbTestSuite(); 43 suite.addTest(new TomcatManagerTest("testGetPorts")); 44 return suite; 45 } 46 47 public void testGetPorts() throws Exception { 48 clearWorkDir(); 49 50 String home = getDataDir().getAbsolutePath() + "/server/home0"; 51 String base = getWorkDir().getAbsolutePath() + "/base_dir"; 52 53 String url = TomcatFactory.TOMCAT_URI_PREFIX_55; 54 url += "home=" + home + ":base=" + base; 55 56 InstanceProperties ip = InstanceProperties.createInstanceProperties( 58 url, "", "", "Test Tomcat"); 59 60 TomcatManager manager = (TomcatManager) TomcatFactory.create55().getDeploymentManager(url, null, null); 61 62 assertEquals(9999, manager.getServerPort()); 63 assertEquals(7777, manager.getShutdownPort()); 64 65 manager.ensureCatalinaBaseReady(); 66 67 assertEquals(9999, manager.getServerPort()); 68 assertEquals(7777, manager.getShutdownPort()); 69 70 } 71 72 public static void main(java.lang.String [] args) { 73 TestRunner.run(suite()); 74 } 75 76 } 77 | Popular Tags |