KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > test > j2ee > refactoring > rename > WebAppTest


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.test.j2ee.refactoring.rename;
21
22 import java.io.File JavaDoc;
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 /**
30  * Find Usages simple tests
31  * @author jungi
32  */

33 public class WebAppTest extends RenameTestCase implements WebAppConstants {
34
35     private static boolean prjOpened = false;
36
37     /** Creates a new instance of Signature1Test */
38     public WebAppTest(String JavaDoc 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         //suite.addTest(new WebAppTest("testRenameWsPackage"));
50
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     /*
74     public void testRenameWsPackage() {
75         renamePackage("org.netbeans.test.examples.logging.ws", "test.logging", "org.netbeans.test.examples.logging.ws.WsSEIRenamed", false);
76     }
77      */

78     
79     /**
80      * Used for running test from inside the IDE by internal execution.
81      *
82      * @param args the command line arguments
83      */

84     public static void main(String JavaDoc[] args) {
85         TestRunner.run(suite());
86     }
87
88     public void prepareProject() {
89         if (prjOpened) {
90             return;
91         }
92         J2eeProjectSupport.openProject(new File JavaDoc(getDataDir(), "projects/LoggingWS"));
93         classPathWorkDir = new File JavaDoc(getDataDir(), "projects.LoggingWS.src.java".replace('.', File.separatorChar));
94         prjOpened = true;
95     }
96     
97 }
98
Popular Tags