KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > upgrade > systemoptions > ProjectUIOptionsTest


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.upgrade.systemoptions;
21
22 /**
23  * @author Milos Kleint
24  */

25 public class ProjectUIOptionsTest extends BasicTestForImport {
26     
27     //properties as of 5.0
28
private static final String JavaDoc LAST_OPEN_PROJECT_DIR = "lastOpenProjectDir"; //NOI18N - String
29
private static final String JavaDoc PROP_PROJECT_CATEGORY = "lastSelectedProjectCategory"; //NOI18N - String
30
private static final String JavaDoc PROP_PROJECT_TYPE = "lastSelectedProjectType"; //NOI18N - String
31
private static final String JavaDoc MAIN_PROJECT_URL = "mainProjectURL"; //NOI18N -URL
32
private static final String JavaDoc OPEN_AS_MAIN = "openAsMain"; //NOI18N - boolean
33
private static final String JavaDoc OPEN_PROJECTS_URLS = "openProjectsURLs"; //NOI18N - List of URLs
34
private static final String JavaDoc OPEN_SUBPROJECTS = "openSubprojects"; //NOI18N - boolean
35
private static final String JavaDoc PROP_PROJECTS_FOLDER = "projectsFolder"; //NOI18N - String
36
private static final String JavaDoc RECENT_PROJECTS_URLS = "recentProjectsURLs"; //NOI18N List of URLs
37
private static final String JavaDoc RECENT_TEMPLATES = "recentTemplates"; // NOI18N -List of Strings
38

39     
40     
41     
42     public ProjectUIOptionsTest(String JavaDoc testName) {
43         super(testName, "org-netbeans-modules-project-ui-OpenProjectList.settings");
44     }
45     public void testPreferencesNodePath() throws Exception JavaDoc {
46         assertPreferencesNodePath("/org/netbeans/modules/projectui");
47     }
48     public void testPropertyNames() throws Exception JavaDoc {
49         assertPropertyNames(new String JavaDoc[] {
50                 LAST_OPEN_PROJECT_DIR,
51                 PROP_PROJECT_CATEGORY,
52                 PROP_PROJECT_TYPE,
53                 MAIN_PROJECT_URL,
54                 OPEN_AS_MAIN,
55                 OPEN_PROJECTS_URLS + ".0",
56                 OPEN_SUBPROJECTS,
57                 PROP_PROJECTS_FOLDER,
58                 RECENT_PROJECTS_URLS + ".0",
59                 RECENT_TEMPLATES + ".0",
60                 RECENT_TEMPLATES + ".1",
61         });
62     }
63     
64     public void testLastOpenProjectDir() throws Exception JavaDoc {
65         assertProperty(LAST_OPEN_PROJECT_DIR, "/Users/mkleint");
66     }
67
68     public void testLastSelectedProjectCategory() throws Exception JavaDoc {
69         assertProperty(PROP_PROJECT_CATEGORY, "Web");
70     }
71
72     public void testLastSelectedProjectType() throws Exception JavaDoc {
73         assertProperty(PROP_PROJECT_TYPE, "emptyWeb");
74     }
75
76     
77     public void testOpenAsMain() throws Exception JavaDoc {
78         assertProperty(OPEN_AS_MAIN, "true");
79     }
80
81
82      public void testOpenSubprojects() throws Exception JavaDoc {
83         assertProperty(OPEN_SUBPROJECTS, "true");
84     }
85
86      public void testProjectsFolder() throws Exception JavaDoc {
87         assertProperty(PROP_PROJECTS_FOLDER, "/Users/mkleint");
88     }
89
90     public void testMainProjectURL() throws Exception JavaDoc {
91         assertProperty(MAIN_PROJECT_URL, "file:/Users/mkleint/WebApplication1/");
92     }
93
94     public void testOpenProjectsURLs() throws Exception JavaDoc {
95         assertProperty(OPEN_PROJECTS_URLS + ".0", "file:/Users/mkleint/WebApplication1/");
96     }
97     
98      public void testRecentProjectsURLs() throws Exception JavaDoc {
99         assertProperty(RECENT_PROJECTS_URLS + ".0", "file:/Users/mkleint/JavaApplication1/");
100     }
101      
102      public void testRecentTemplates() throws Exception JavaDoc {
103         assertProperty(RECENT_TEMPLATES + ".0", "Templates/JSP_Servlet/Servlet.java");
104         assertProperty(RECENT_TEMPLATES + ".1", "Templates/JSP_Servlet/JSP.jsp");
105     }
106     
107     
108 }
109
Popular Tags