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 Radek Matous
046: */
047: public class JUnitSettingsTest extends BasicTestForImport {
048: public JUnitSettingsTest(String testName) {
049: super (testName,
050: "org-netbeans-modules-junit-JUnitSettings.settings");
051: }
052:
053: public void testPreferencesNodePath() throws Exception {
054: assertPreferencesNodePath("/org/netbeans/modules/junit");
055: }
056:
057: public void testPropertyNames() throws Exception {
058: assertPropertyNames(new String[] { "fileSystem", "version",
059: "membersPackage", "generateMainMethod",
060: "membersProtected", "bodyComments", "bodyContent",
061: "javaDoc", "generateTearDown", "generateSuiteClasses",
062: "membersPublic", "includePackagePrivateClasses",
063: "rootSuiteClassName", "generateSetUp",
064: "generateAbstractImpl", "generateMainMethodBody",
065: "generateExceptionClasses" });
066: }
067:
068: public void testVersion() throws Exception {
069: assertPropertyType("version", "java.lang.Integer");
070: assertProperty("version", "41");
071: }
072:
073: public void testFileSystem() throws Exception {
074: assertPropertyType("fileSystem", "java.lang.String");
075: assertProperty("fileSystem", "");
076: }
077:
078: public void testMembersPublic() throws Exception {
079: assertPropertyType("membersPublic", "java.lang.Boolean");
080: assertProperty("membersPublic", "true");
081: }
082:
083: public void testMembersProtected() throws Exception {
084: assertPropertyType("membersProtected", "java.lang.Boolean");
085: assertProperty("membersProtected", "true");
086: }
087:
088: public void testMembersPackage() throws Exception {
089: assertPropertyType("membersPackage", "java.lang.Boolean");
090: assertProperty("membersPackage", "true");
091: }
092:
093: public void testBodyComments() throws Exception {
094: assertPropertyType("bodyComments", "java.lang.Boolean");
095: assertProperty("bodyComments", "true");
096: }
097:
098: public void testBodyContent() throws Exception {
099: assertPropertyType("bodyContent", "java.lang.Boolean");
100: assertProperty("bodyContent", "true");
101: }
102:
103: public void testJavaDoc() throws Exception {
104: assertPropertyType("javaDoc", "java.lang.Boolean");
105: assertProperty("javaDoc", "true");
106: }
107:
108: public void testGenerateTearDown() throws Exception {
109: assertPropertyType("generateTearDown", "java.lang.Boolean");
110: assertProperty("generateTearDown", "true");
111: }
112:
113: public void testGenerateSuiteClasses() throws Exception {
114: assertPropertyType("generateSuiteClasses", "java.lang.Boolean");
115: assertProperty("generateSuiteClasses", "true");
116: }
117:
118: public void testIncludePackagePrivateClasses() throws Exception {
119: assertPropertyType("includePackagePrivateClasses",
120: "java.lang.Boolean");
121: assertProperty("includePackagePrivateClasses", "false");
122: }
123:
124: public void testRootSuiteClassName() throws Exception {
125: assertPropertyType("rootSuiteClassName", "java.lang.String");
126: assertProperty("rootSuiteClassName", "RootSuite");
127: }
128:
129: public void testGenerateSetUp() throws Exception {
130: assertPropertyType("generateSetUp", "java.lang.Boolean");
131: assertProperty("generateSetUp", "true");
132: }
133:
134: public void testGenerateAbstractImpl() throws Exception {
135: assertPropertyType("generateAbstractImpl", "java.lang.Boolean");
136: assertProperty("generateAbstractImpl", "true");
137: }
138:
139: public void testGenerateMainMethodBody() throws Exception {
140: assertPropertyType("generateMainMethodBody", "java.lang.String");
141: assertProperty("generateMainMethodBody",
142: "junit.textui.TestRunner.run(suite());");
143: }
144:
145: public void testGenerateExceptionClasses() throws Exception {
146: assertPropertyType("generateExceptionClasses",
147: "java.lang.Boolean");
148: assertProperty("generateExceptionClasses", "false");
149: }
150: }
|