1 19 package org.netbeans.test.j2ee.refactoring.move; 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 MoveTestCase 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("testMoveWsSei")); 46 suite.addTest(new EjbModTest("testMoveWsImpl")); 47 suite.addTest(new EjbModTest("testMoveSessionBean")); 48 suite.addTest(new EjbModTest("testMoveSessionBeanRemote")); 49 suite.addTest(new EjbModTest("testMoveSessionBeanRemoteHome")); 50 suite.addTest(new EjbModTest("testMoveUsedHandler")); 51 suite.addTest(new EjbModTest("testMoveUnusedHandler")); 52 suite.addTest(new EjbModTest("testMoveCMPEntityBean")); 53 suite.addTest(new EjbModTest("testMoveCMPEntityBeanLocal")); 54 suite.addTest(new EjbModTest("testMoveCMPEntityBeanLocalHome")); 55 suite.addTest(new EjbModTest("testMoveTopicMdb")); 56 64 return suite; 65 } 66 67 72 public static void main(String [] args) { 73 TestRunner.run(suite()); 74 } 75 76 public void prepareProject() { 77 if (prjOpened) { 78 return; 79 } 80 J2eeProjectSupport.openProject(new File (getDataDir(), "projects/League-util")); 81 J2eeProjectSupport.openProject(new File (getDataDir(), "projects/League-ejb")); 82 classPathWorkDir = new File (getDataDir(), "projects.League-ejb.src.java".replace('.', File.separatorChar)); 83 prjOpened = true; 84 } 85 86 public void testMoveWsSei() { 87 moveClass(INTERFACE_WS_1, DESTINATION_PACKAGE_1, false); 88 } 89 90 public void testMoveWsImpl() { 91 moveClass(CLASS_WS_1, DESTINATION_PACKAGE_2, false); 92 } 93 94 public void testMoveSessionBean() { 95 moveClass(CLASS_SESSION_1, DESTINATION_PACKAGE_1, false); 96 } 97 98 public void testMoveSessionBeanRemote() { 99 moveClass(INTERFACE_SESSION_REMOTE_1, DESTINATION_PACKAGE_1, false); 100 } 101 102 public void testMoveSessionBeanRemoteHome() { 103 moveClass(INTERFACE_SESSION_REMOTE_HOME_1, DESTINATION_PACKAGE_1, false); 104 } 105 106 public void testMoveUsedHandler() { 107 moveClass(CLASS_HANDLER_1, DESTINATION_PACKAGE_2, false); 108 } 109 110 public void testMoveUnusedHandler() { 111 moveClass(CLASS_HANDLER_2, DESTINATION_PACKAGE_1, false); 112 } 113 114 public void testMoveCMPEntityBean() { 115 moveClass(CLASS_CMP_ENTITY_1, DESTINATION_PACKAGE_2, false); 116 } 117 118 public void testMoveCMPEntityBeanLocal() { 119 moveClass(INTERFACE_CMP_ENTITY_LOCAL_2, DESTINATION_PACKAGE_1, false); 120 } 121 122 public void testMoveCMPEntityBeanLocalHome() { 123 moveClass(INTERFACE_CMP_ENTITY_LOCAL_HOME_3, DESTINATION_PACKAGE_2, false); 124 } 125 126 public void testMoveTopicMdb() { 127 moveClass(MDB_TOPIC, DESTINATION_PACKAGE_1, false); 128 } 129 130 public void testUndoMoveQueueMdb() { 131 moveClass(MDB_QUEUE, DESTINATION_PACKAGE_2, false); 132 } 133 134 public void testUndoMoveWsSei() { 136 moveClass(INTERFACE_WS_1, DESTINATION_PACKAGE_1, true); 137 } 138 139 public void testUndoMoveWsImpl() { 140 moveClass(CLASS_WS_1, DESTINATION_PACKAGE_2, true); 141 } 142 143 public void testUndoMoveSessionBean() { 144 moveClass(CLASS_SESSION_1, DESTINATION_PACKAGE_1, true); 145 } 146 147 public void testUndoMoveUsedHandler() { 148 assertTrue("See issue 59611.", false); 149 moveClass(CLASS_HANDLER_1, DESTINATION_PACKAGE_2, true); 150 } 151 152 public void testUndoMoveUnusedHandler() { 153 moveClass(CLASS_HANDLER_2, DESTINATION_PACKAGE_1, true); 154 } 155 156 157 } 158 | Popular Tags |