001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997/2006 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.upgrade.systemoptions;
043:
044: /**
045: * @author Milos Kleint
046: */
047: public class ProjectUIOptionsTest extends BasicTestForImport {
048:
049: //properties as of 5.0
050: private static final String LAST_OPEN_PROJECT_DIR = "lastOpenProjectDir"; //NOI18N - String
051: private static final String PROP_PROJECT_CATEGORY = "lastSelectedProjectCategory"; //NOI18N - String
052: private static final String PROP_PROJECT_TYPE = "lastSelectedProjectType"; //NOI18N - String
053: private static final String MAIN_PROJECT_URL = "mainProjectURL"; //NOI18N -URL
054: private static final String OPEN_AS_MAIN = "openAsMain"; //NOI18N - boolean
055: private static final String OPEN_PROJECTS_URLS = "openProjectsURLs"; //NOI18N - List of URLs
056: private static final String OPEN_SUBPROJECTS = "openSubprojects"; //NOI18N - boolean
057: private static final String PROP_PROJECTS_FOLDER = "projectsFolder"; //NOI18N - String
058: private static final String RECENT_PROJECTS_URLS = "recentProjectsURLs"; //NOI18N List of URLs
059: private static final String RECENT_TEMPLATES = "recentTemplates"; // NOI18N -List of Strings
060:
061: public ProjectUIOptionsTest(String testName) {
062: super (testName,
063: "org-netbeans-modules-project-ui-OpenProjectList.settings");
064: }
065:
066: public void testPreferencesNodePath() throws Exception {
067: assertPreferencesNodePath("/org/netbeans/modules/projectui");
068: }
069:
070: public void testPropertyNames() throws Exception {
071: assertPropertyNames(new String[] { LAST_OPEN_PROJECT_DIR,
072: PROP_PROJECT_CATEGORY, PROP_PROJECT_TYPE,
073: MAIN_PROJECT_URL, OPEN_AS_MAIN,
074: OPEN_PROJECTS_URLS + ".0", OPEN_SUBPROJECTS,
075: PROP_PROJECTS_FOLDER, RECENT_PROJECTS_URLS + ".0",
076: RECENT_TEMPLATES + ".0", RECENT_TEMPLATES + ".1", });
077: }
078:
079: public void testLastOpenProjectDir() throws Exception {
080: assertProperty(LAST_OPEN_PROJECT_DIR, "/Users/mkleint");
081: }
082:
083: public void testLastSelectedProjectCategory() throws Exception {
084: assertProperty(PROP_PROJECT_CATEGORY, "Web");
085: }
086:
087: public void testLastSelectedProjectType() throws Exception {
088: assertProperty(PROP_PROJECT_TYPE, "emptyWeb");
089: }
090:
091: public void testOpenAsMain() throws Exception {
092: assertProperty(OPEN_AS_MAIN, "true");
093: }
094:
095: public void testOpenSubprojects() throws Exception {
096: assertProperty(OPEN_SUBPROJECTS, "true");
097: }
098:
099: public void testProjectsFolder() throws Exception {
100: assertProperty(PROP_PROJECTS_FOLDER, "/Users/mkleint");
101: }
102:
103: public void testMainProjectURL() throws Exception {
104: assertProperty(MAIN_PROJECT_URL,
105: "file:/Users/mkleint/WebApplication1/");
106: }
107:
108: public void testOpenProjectsURLs() throws Exception {
109: assertProperty(OPEN_PROJECTS_URLS + ".0",
110: "file:/Users/mkleint/WebApplication1/");
111: }
112:
113: public void testRecentProjectsURLs() throws Exception {
114: assertProperty(RECENT_PROJECTS_URLS + ".0",
115: "file:/Users/mkleint/JavaApplication1/");
116: }
117:
118: public void testRecentTemplates() throws Exception {
119: assertProperty(RECENT_TEMPLATES + ".0",
120: "Templates/JSP_Servlet/Servlet.java");
121: assertProperty(RECENT_TEMPLATES + ".1",
122: "Templates/JSP_Servlet/JSP.jsp");
123: }
124:
125: }
|