1 19 20 package org.netbeans.test.j2ee.refactoring.move; 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 MoveTestCase 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("testMoveWsSei")); 45 suite.addTest(new WebAppTest("testMoveUsedHandler")); 48 suite.addTest(new WebAppTest("testMoveUnusedHandler")); 49 56 return suite; 57 } 58 59 public void testMoveWsSei() { 60 moveClass(IFACE_NAME_1, DESTINATION_PACKAGE_1, false); 61 } 62 63 public void testMoveWsImpl() { 64 moveClass(CLASS_NAME_1, DESTINATION_PACKAGE_2, false); 65 } 66 67 public void testMoveServlet() { 68 moveClass(CLASS_NAME_2, DESTINATION_PACKAGE_1, false); 69 } 70 71 public void testMoveUsedHandler() { 72 moveClass(HANDLER_NAME_1, DESTINATION_PACKAGE_2, false); 73 } 74 75 public void testMoveUnusedHandler() { 76 moveClass(HANDLER_NAME_2, DESTINATION_PACKAGE_1, false); 77 } 78 79 public void testUndoMoveWsSei() { 81 moveClass(IFACE_NAME_1, DESTINATION_PACKAGE_2, true); 82 } 83 84 public void testUndoMoveWsImpl() { 85 moveClass(CLASS_NAME_1, DESTINATION_PACKAGE_1, true); 86 } 87 88 public void testUndoMoveServlet() { 89 moveClass(CLASS_NAME_2, DESTINATION_PACKAGE_2, true); 90 } 91 92 public void testUndoMoveUsedHandler() { 93 assertTrue("See issue 59611.", false); 94 moveClass(HANDLER_NAME_1, DESTINATION_PACKAGE_1, true); 95 } 96 97 public void testUndoMoveUnusedHandler() { 98 moveClass(HANDLER_NAME_2, DESTINATION_PACKAGE_2, true); 99 } 100 101 106 public static void main(String [] args) { 107 TestRunner.run(suite()); 108 } 109 110 public void prepareProject() { 111 if (prjOpened) { 112 return; 113 } 114 J2eeProjectSupport.openProject(new File (getDataDir(), "projects/LoggingWS")); 115 classPathWorkDir = new File (getDataDir(), "projects.LoggingWS.src.java".replace('.', File.separatorChar)); 116 prjOpened = true; 117 } 118 119 } 120 | Popular Tags |