1 19 package org.netbeans.test.j2ee.refactoring.rename; 20 21 import java.io.File ; 22 import junit.framework.TestSuite; 23 import junit.textui.TestRunner; 24 import org.netbeans.junit.NbTestSuite; 25 import org.netbeans.test.j2ee.lib.J2eeProjectSupport; 26 import org.netbeans.test.j2ee.refactoring.EjbModConstants; 27 28 32 public class EjbModTest extends RenameTestCase implements EjbModConstants { 33 34 private static boolean prjOpened = false; 35 36 38 39 public EjbModTest(String name) { 40 super(name); 41 } 42 43 public static TestSuite suite() { 44 NbTestSuite suite = new NbTestSuite(); 45 suite.addTest(new EjbModTest("testRenameCMPBean")); 46 suite.addTest(new EjbModTest("testRenameCMPLocal")); 47 suite.addTest(new EjbModTest("testRenameCMPLocalHome")); 48 suite.addTest(new EjbModTest("testRenameSessionRemote")); 49 suite.addTest(new EjbModTest("testRenameSessionRemoteHome")); 50 suite.addTest(new EjbModTest("testRenameSessionBean")); 51 suite.addTest(new EjbModTest("testRenameTopicMDB")); 52 suite.addTest(new EjbModTest("testRenameQueueMDB")); 53 suite.addTest(new EjbModTest("testRenameWsInterface")); 54 suite.addTest(new EjbModTest("testRenameWsClass")); 55 suite.addTest(new EjbModTest("testRenameUsedMsgHandler")); 56 suite.addTest(new EjbModTest("testRenameUnusedMsgHandler")); 57 suite.addTest(new EjbModTest("testRenameClass")); 58 return suite; 61 } 62 63 public void testRenameCMPBean() { 64 renameClass(CLASS_CMP_ENTITY_1, "TeamRenamedBean", false, false); 65 } 66 67 public void testRenameCMPLocal() { 68 renameClass(INTERFACE_CMP_ENTITY_LOCAL_3, "ResultRenamedLocal", false, false); 69 } 70 71 public void testRenameCMPLocalHome() { 72 renameClass(INTERFACE_CMP_ENTITY_LOCAL_HOME_4, "MatchRenamedLocalHome", false, false); 73 } 74 75 public void testRenameSessionBean() { 76 renameClass(CLASS_SESSION_1, "SessionRenamedBean", false, false); 77 } 78 79 public void testRenameSessionRemote() { 80 renameClass(INTERFACE_SESSION_REMOTE_1, "SessionRenamed1Remote", false, false); 81 } 82 83 public void testRenameSessionRemoteHome() { 84 renameClass(INTERFACE_SESSION_REMOTE_HOME_1, "SessionRenamed1RemoteHome", false, false); 85 } 86 87 public void testRenameClass() { 88 renameClass(CLASS_JAVA_1, "CSLocatorRenamed", false, false); 89 } 90 91 public void testRenameWsInterface() { 92 renameClass(INTERFACE_WS_1, "WsSEIRenamed", false, false); 93 } 94 95 public void testRenameWsClass() { 96 renameClass(CLASS_WS_1, "LeagueWebServiceRenamedBean", false, false); 97 } 98 99 public void testRenameTopicMDB() { 100 renameClass(MDB_TOPIC, "TopicMessageRenamedBean", false, false); 101 } 102 103 public void testRenameQueueMDB() { 104 renameClass(MDB_QUEUE, "QueueMessageRenamedBean", false, false); 105 } 106 107 public void testRenameUsedMsgHandler() { 108 renameClass(CLASS_HANDLER_1, "UsedHandlerRenamed", false, false); 109 } 110 111 public void testRenameUnusedMsgHandler() { 112 renameClass(CLASS_HANDLER_2, "UnusedHandlerRenamed", false, false); 113 } 114 115 124 125 126 131 public static void main(String [] args) { 132 TestRunner.run(suite()); 133 } 134 135 public void prepareProject() { 136 if (prjOpened) { 137 return; 138 } 139 J2eeProjectSupport.openProject(new File (getDataDir(), "projects/League-util")); 140 J2eeProjectSupport.openProject(new File (getDataDir(), "projects/League-ejb")); 141 classPathWorkDir = new File (getDataDir(), "projects.League-ejb.src.java".replace('.', File.separatorChar)); 142 prjOpened = true; 143 } 144 145 } 146 | Popular Tags |