1 19 20 package org.netbeans.test.j2ee.refactoring.rename; 21 22 import java.io.File ; 23 import junit.framework.TestSuite; 24 import junit.textui.TestRunner; 25 import org.netbeans.junit.NbTestSuite; 26 import org.netbeans.test.j2ee.lib.J2eeProjectSupport; 27 import org.netbeans.test.j2ee.refactoring.WebAppConstants; 28 29 33 public class WebAppTest extends RenameTestCase implements WebAppConstants { 34 35 private static boolean prjOpened = false; 36 37 38 public WebAppTest(String name) { 39 super(name); 40 } 41 42 public static TestSuite suite() { 43 NbTestSuite suite = new NbTestSuite(); 44 suite.addTest(new WebAppTest("testRenameWsInterface")); 45 suite.addTest(new WebAppTest("testRenameWsClass")); 46 suite.addTest(new WebAppTest("testRenameServlet")); 47 suite.addTest(new WebAppTest("testRenameUsedMsgHandler")); 48 suite.addTest(new WebAppTest("testRenameUnusedMsgHandler")); 49 return suite; 51 } 52 53 public void testRenameWsInterface() { 54 renameClass(IFACE_NAME_1, "WsSEIRenamed", false, false); 55 } 56 57 public void testRenameWsClass() { 58 renameClass(CLASS_NAME_1, "WsImplRenamed", false, false); 59 } 60 61 public void testRenameServlet() { 62 renameClass(CLASS_NAME_2, "ServletRenamed", false, false); 63 } 64 65 public void testRenameUsedMsgHandler() { 66 renameClass(HANDLER_NAME_1, "UsedHandlerRenamed", false, false); 67 } 68 69 public void testRenameUnusedMsgHandler() { 70 renameClass(HANDLER_NAME_2, "UnusedHandlerRenamed", false, false); 71 } 72 73 78 79 84 public static void main(String [] args) { 85 TestRunner.run(suite()); 86 } 87 88 public void prepareProject() { 89 if (prjOpened) { 90 return; 91 } 92 J2eeProjectSupport.openProject(new File (getDataDir(), "projects/LoggingWS")); 93 classPathWorkDir = new File (getDataDir(), "projects.LoggingWS.src.java".replace('.', File.separatorChar)); 94 prjOpened = true; 95 } 96 97 } 98 | Popular Tags |