KickJava   Java API By Example, From Geeks To Geeks.

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


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 Radek Matous, Jesse Glick
24  */

25 public class AntSettingsTest extends BasicTestForImport {
26     public AntSettingsTest(String JavaDoc testName) {
27         super(testName, "org-apache-tools-ant-module-AntSettings.settings");
28     }
29     
30     public void testPreferencesNodePath() throws Exception JavaDoc {
31         assertPreferencesNodePath("/org/apache/tools/ant/module");
32     }
33     
34     public void testPropertyNames() throws Exception JavaDoc {
35         assertPropertyNames(new String JavaDoc[] {
36             "saveAll",
37             "alwaysShowOutput",
38             "extraClasspath",
39             "antHome",
40             "verbosity",
41             "autoCloseTabs",
42             "properties",
43             // "customDefs" not imported
44
});
45     }
46     public void testSaveAll() throws Exception JavaDoc {
47         assertPropertyType("saveAll","java.lang.Boolean");
48         assertProperty("saveAll","true");
49     }
50     public void testAlwaysShowOutput() throws Exception JavaDoc {
51         assertPropertyType("alwaysShowOutput","java.lang.Boolean");
52         assertProperty("alwaysShowOutput","false");
53     }
54     public void testExtraClasspath() throws Exception JavaDoc {
55         assertPropertyType("extraClasspath","org.openide.execution.NbClassPath");
56         assertProperty("extraClasspath","/home/jglick/NetBeansProjects:/home/jglick/NetBeansProjects/foo/dist/foo.jar");
57     }
58     public void testAntHome() throws Exception JavaDoc {
59         assertPropertyType("antHome","java.io.File");
60         assertProperty("antHome","/space/src/ant/dist");
61     }
62     public void testVerbosity() throws Exception JavaDoc {
63         assertPropertyType("verbosity","java.lang.Integer");
64         assertProperty("verbosity","4");
65     }
66     public void testAutoCloseTabs() throws Exception JavaDoc {
67         assertPropertyType("autoCloseTabs","java.lang.Boolean");
68         assertProperty("autoCloseTabs","true");
69     }
70     public void testProperties() throws Exception JavaDoc {
71         assertPropertyType("properties", "java.util.HashMap");
72         assertProperty("properties", "hello=kitty\nmuscular=midget");
73     }
74 }
75
Popular Tags