KickJava   Java API By Example, From Geeks To Geeks.

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


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 import junit.framework.*;
23
24 /**
25  * @author Radek Matous
26  */

27 public class IDESettingsTest extends BasicTestForImport {
28     public IDESettingsTest(String JavaDoc testName) {
29         super(testName, "org-netbeans-core-IDESettings.settings");
30     }
31     public void testPropertyNames() throws Exception JavaDoc {
32         assertPropertyNames(new String JavaDoc[] {
33             "IgnoredFiles",
34             "UIMode",
35             "WWWBrowser",
36             "confirmDelete",
37             "homePage",
38             "modulesSortMode", // ignored
39
"proxyNonProxyHosts",
40             "proxyType",
41             "showFileExtensions",
42             "showToolTipsInIDE",
43             "useProxy",
44             "proxyHttpHost",
45             "proxyHttpPort"
46         });
47     }
48     
49     public void testPreferencesNodePath() throws Exception JavaDoc {
50         assertPreferencesNodePath("/org/netbeans/core");
51     }
52     
53     public void testIgnoredFiles() throws Exception JavaDoc {
54         //java.lang.String
55
assertProperty("IgnoredFiles","^(CVS|SCCS|vssver\\.scc|#.*#|%.*%|\\.(cvsignore|svn|DS_Store))$|^\\.[#_]|~$");
56     }
57     
58     public void testUIMode() throws Exception JavaDoc {
59         //java.lang.Integer
60
assertProperty("UIMode","2");
61     }
62     
63     public void testWWWBrowser() throws Exception JavaDoc {
64         //java.lang.String
65
assertProperty("WWWBrowser","SL[/Browsers/FirefoxBrowser");
66     }
67     
68     public void testConfirmDelete() throws Exception JavaDoc {
69         //java.lang.Boolean
70
assertProperty("confirmDelete","true");
71     }
72     public void testHomePage() throws Exception JavaDoc {
73         //java.lang.String
74
assertProperty("homePage","http://www.netbeans.org/");
75     }
76     
77     public void testProxyType() throws Exception JavaDoc{
78         //java.lang.Integer
79
assertProperty("proxyType","1");
80     }
81     public void testShowFileExtensions() throws Exception JavaDoc{
82         //java.lang.Boolean
83
assertProperty("showFileExtensions","false");
84     }
85     
86     public void testShowToolTipsInIDE() throws Exception JavaDoc{
87         //java.lang.Boolean
88
assertProperty("showToolTipsInIDE","false");
89     }
90     
91     public void testUseProxy() throws Exception JavaDoc{
92         //java.lang.Boolean
93
assertProperty("useProxy","false");
94     }
95     
96     public void testProxyHttpHost() throws Exception JavaDoc{
97         //java.lang.String
98
assertProperty("proxyHttpHost","");
99     }
100     
101     public void testProxyHttpPort() throws Exception JavaDoc{
102         //java.lang.String
103
assertProperty("proxyHttpPort","");
104     }
105
106     public void testProxyNonProxyHosts() throws Exception JavaDoc{
107         //java.lang.String
108
assertProperty("proxyNonProxyHosts","localhost|127.0.0.1");
109     }
110 }
111
Popular Tags