Source Code Cross Referenced for OptionsOperatorTest.java in  » IDE-Netbeans » jellytools » org » netbeans » jellytools » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » jellytools » org.netbeans.jellytools 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


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:        package org.netbeans.jellytools;
042:
043:        import junit.textui.TestRunner;
044:        import org.netbeans.jellytools.nodes.Node;
045:        import org.netbeans.jellytools.properties.PropertySheetOperator;
046:        import org.netbeans.junit.NbTestSuite;
047:
048:        /** Tests org.netbeans.jellytools.OptionsOperator. */
049:        public class OptionsOperatorTest extends JellyTestCase {
050:
051:            // "IDE Configuration"
052:            private static final String ideConfLabel = Bundle.getString(
053:                    "org.netbeans.core.Bundle", "UI/Services/IDEConfiguration");
054:            // "IDE Configuration|System|File Types|HTML and XHTML files"
055:            private static final String path1 = ideConfLabel
056:                    + "|"
057:                    + Bundle.getString("org.netbeans.core.Bundle",
058:                            "UI/Services/IDEConfiguration/System")
059:                    + "|"
060:                    + Bundle.getString("org.netbeans.core.Bundle",
061:                            "Services/MIMEResolver")
062:                    + "|"
063:                    + Bundle.getString("org.netbeans.modules.html.Bundle",
064:                            "Services/MIMEResolver/html.xml");
065:            // "IDE Configuration|System|Print Settings"
066:            private static final String path2 = ideConfLabel
067:                    + "|"
068:                    + Bundle.getString("org.netbeans.core.Bundle",
069:                            "UI/Services/IDEConfiguration/System")
070:                    + "|"
071:                    + Bundle.getString("org.netbeans.core.Bundle",
072:                            "Services/org-openide-text-PrintSettings.settings");
073:            // "IDE Configuration|Look and Feel|Toolbars"
074:            private static final String path3 = ideConfLabel
075:                    + "|"
076:                    + Bundle.getString("org.netbeans.core.Bundle",
077:                            "UI/Services/IDEConfiguration/LookAndFeel") + "|"
078:                    + Bundle.getString("org.netbeans.core.Bundle", "Toolbars");
079:
080:            /** Use for internal test execution inside IDE
081:             * @param args command line arguments
082:             */
083:            public static void main(java.lang.String[] args) {
084:                TestRunner.run(suite());
085:            }
086:
087:            /** Method used for explicit testsuite definition
088:             * @return  created suite
089:             */
090:            public static NbTestSuite suite() {
091:                NbTestSuite suite = new NbTestSuite();
092:                // test classic view
093:                suite.addTest(new OptionsOperatorTest("testTreeTable"));
094:                suite.addTest(new OptionsOperatorTest("testLevelsShowing"));
095:                suite.addTest(new OptionsOperatorTest("testLevelChanging"));
096:                suite.addTest(new OptionsOperatorTest("testPopup"));
097:                suite.addTest(new OptionsOperatorTest("testGetPropertySheet"));
098:                suite.addTest(new OptionsOperatorTest("testSelectOption"));
099:                // test modern view
100:                suite
101:                        .addTest(new OptionsOperatorTest(
102:                                "testSwitchToModernView"));
103:                suite.addTest(new OptionsOperatorTest("testSelectEditor"));
104:                suite
105:                        .addTest(new OptionsOperatorTest(
106:                                "testSelectFontAndColors"));
107:                suite.addTest(new OptionsOperatorTest("testSelectKeymap"));
108:                suite
109:                        .addTest(new OptionsOperatorTest(
110:                                "testSelectMiscellaneous"));
111:                suite.addTest(new OptionsOperatorTest("testSelectGeneral"));
112:                suite.addTest(new OptionsOperatorTest("testClose"));
113:                return suite;
114:            }
115:
116:            /** Constructor required by JUnit.
117:             * @param testName method name to be used as testcase
118:             */
119:            public OptionsOperatorTest(String testName) {
120:                super (testName);
121:            }
122:
123:            private static OptionsOperator optionsOperator = null;
124:
125:            /** Setup */
126:            public void setUp() {
127:                System.out.println("### " + getName() + " ###");
128:                // opens Options window
129:                if (optionsOperator == null) {
130:                    optionsOperator = OptionsOperator.invoke();
131:                }
132:            }
133:
134:            /** Tear down. */
135:            public void tearDown() {
136:            }
137:
138:            public void testTreeTable() {
139:                optionsOperator.switchToClassicView();
140:                optionsOperator.selectOption(path1);
141:                optionsOperator.selectOption(path2);
142:                optionsOperator.selectOption(path1);
143:                optionsOperator.selectOption(path2);
144:            }
145:
146:            public void testLevelsShowing() {
147:                optionsOperator.hideLevels();
148:                optionsOperator.showLevels();
149:                optionsOperator.hideLevels();
150:                optionsOperator.showLevels();
151:            }
152:
153:            public void testLevelChanging() {
154:                optionsOperator.setUserLevel(path1);
155:                optionsOperator.setUserLevel(path2);
156:                optionsOperator.setDefaultLevel(path1);
157:                optionsOperator.setUserLevel(path1);
158:                optionsOperator.setDefaultLevel(path2);
159:                optionsOperator.setUserLevel(path2);
160:            }
161:
162:            public void testPopup() {
163:                // "Refresh Folder"
164:                String refreshFolderLabel = Bundle.getString(
165:                        "org.openide.loaders.Bundle", "LAB_Refresh");
166:                new Node(optionsOperator.treeTable().tree(), path3)
167:                        .performPopupAction(refreshFolderLabel);
168:            }
169:
170:            /** Test getPropertySheet() method. */
171:            public void testGetPropertySheet() {
172:                PropertySheetOperator pso = optionsOperator
173:                        .getPropertySheet(path1);
174:            }
175:
176:            /** Test selectOption() method. */
177:            public void testSelectOption() {
178:                optionsOperator.selectOption(path1);
179:                String nodeName = optionsOperator.treeTable().tree()
180:                        .getSelectionPath().getLastPathComponent().toString();
181:                PropertySheetOperator pso = new PropertySheetOperator(
182:                        optionsOperator);
183:                assertEquals("Wrong node was selected.", nodeName, pso
184:                        .getDescriptionHeader()); // NOI18N
185:            }
186:
187:            /** Test of switchToModernView method. */
188:            public void testSwitchToModernView() {
189:                optionsOperator.switchToModernView();
190:            }
191:
192:            /** Test of selectEditor method. */
193:            public void testSelectEditor() {
194:                optionsOperator.selectEditor();
195:            }
196:
197:            /** Test of selectFontAndColors method. */
198:            public void testSelectFontAndColors() {
199:                optionsOperator.selectFontAndColors();
200:            }
201:
202:            /** Test of selectKeymap method. */
203:            public void testSelectKeymap() {
204:                optionsOperator.selectKeymap();
205:            }
206:
207:            /** Test of selectMiscellaneous method. */
208:            public void testSelectMiscellaneous() {
209:                optionsOperator.selectMiscellaneous();
210:            }
211:
212:            /** Test of selectGeneral method.  */
213:            public void testSelectGeneral() {
214:                optionsOperator.selectGeneral();
215:            }
216:
217:            /** Test of close method.  */
218:            public void testClose() {
219:                optionsOperator.close();
220:            }
221:
222:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.