Source Code Cross Referenced for BeanInfoGeneration.java in  » IDE-Netbeans » beans » gui » 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 » beans » gui 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        /*
0002:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
0003:         *
0004:         * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
0005:         *
0006:         * The contents of this file are subject to the terms of either the GNU
0007:         * General Public License Version 2 only ("GPL") or the Common
0008:         * Development and Distribution License("CDDL") (collectively, the
0009:         * "License"). You may not use this file except in compliance with the
0010:         * License. You can obtain a copy of the License at
0011:         * http://www.netbeans.org/cddl-gplv2.html
0012:         * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
0013:         * specific language governing permissions and limitations under the
0014:         * License.  When distributing the software, include this License Header
0015:         * Notice in each file and include the License file at
0016:         * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
0017:         * particular file as subject to the "Classpath" exception as provided
0018:         * by Sun in the GPL Version 2 section of the License file that
0019:         * accompanied this code. If applicable, add the following below the
0020:         * License Header, with the fields enclosed by brackets [] replaced by
0021:         * your own identifying information:
0022:         * "Portions Copyrighted [year] [name of copyright owner]"
0023:         *
0024:         * Contributor(s):
0025:         *
0026:         * The Original Software is NetBeans. The Initial Developer of the Original
0027:         * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
0028:         * Microsystems, Inc. All Rights Reserved.
0029:         *
0030:         * If you wish your version of this file to be governed by only the CDDL
0031:         * or only the GPL Version 2, indicate your decision by adding
0032:         * "[Contributor] elects to include this software in this distribution
0033:         * under the [CDDL or GPL Version 2] license." If you do not indicate a
0034:         * single choice of license, a recipient has the option to distribute
0035:         * your version of this file under either the CDDL, the GPL Version 2 or
0036:         * to extend the choice of license to its licensees as provided above.
0037:         * However, if you add GPL Version 2 code and therefore, elected the GPL
0038:         * Version 2 license, then the option applies only if the new code is
0039:         * made subject to such option by the copyright holder.
0040:         */
0041:
0042:        package gui;
0043:
0044:        import java.io.*;
0045:        import junit.textui.TestRunner;
0046:        import org.netbeans.jellytools.Bundle;
0047:        import org.netbeans.jellytools.EditorOperator;
0048:        import org.netbeans.jellytools.JellyTestCase;
0049:        import org.netbeans.jellytools.MainWindowOperator;
0050:        import org.netbeans.jellytools.NbDialogOperator;
0051:        import org.netbeans.jellytools.RepositoryTabOperator;
0052:        import org.netbeans.jellytools.actions.PropertiesAction;
0053:        import org.netbeans.jellytools.nodes.JavaNode;
0054:        import org.netbeans.jellytools.nodes.Node;
0055:        import org.netbeans.jellytools.properties.Property;
0056:        import org.netbeans.jellytools.properties.PropertySheetOperator;
0057:        import org.netbeans.jemmy.EventTool;
0058:        import org.netbeans.jemmy.operators.*;
0059:        import org.netbeans.jemmy.operators.Operator.DefaultStringComparator;
0060:        import org.netbeans.junit.NbTestSuite;
0061:
0062:        import org.openide.actions.SaveAllAction;
0063:        import org.openide.filesystems.FileObject;
0064:
0065:        import org.openide.filesystems.Repository;
0066:        import org.openide.loaders.DataFolder;
0067:        import org.openide.loaders.DataObject;
0068:
0069:        public class BeanInfoGeneration extends JellyTestCase {
0070:
0071:            private static final String NAME_TEST_FILE = "TestFile";
0072:            private static final String NAME_INDEX_PROPERTY = "indexProperty";
0073:            private static final String NAME_NON_INDEX_PROPERTY = "nonIndexProperty";
0074:
0075:            private static final int DELAY = 2000;
0076:
0077:            private static final String sampleDir = Utilities.findFileSystem(
0078:                    "src").getDisplayName();
0079:
0080:            /** Need to be defined because of JUnit */
0081:            public BeanInfoGeneration(String name) {
0082:                super (name);
0083:            }
0084:
0085:            public static NbTestSuite suite() {
0086:                NbTestSuite suite = new NbTestSuite();
0087:                suite.addTest(new BeanInfoGeneration("testCheckNodes"));
0088:                suite.addTest(new BeanInfoGeneration("testIncludeExclude"));
0089:                suite.addTest(new BeanInfoGeneration("testBeanInfoNode"));
0090:                suite.addTest(new BeanInfoGeneration("testPropertiesNode"));
0091:                suite.addTest(new BeanInfoGeneration("testNodesDescription"));
0092:                suite
0093:                        .addTest(new BeanInfoGeneration(
0094:                                "testGenerateNewBeanInfo"));
0095:                suite.addTest(new BeanInfoGeneration("testRegenerateBeanInfo"));
0096:                suite.addTest(new BeanInfoGeneration(
0097:                        "testCheckBeanInfoCompilability"));
0098:
0099:                return suite;
0100:            }
0101:
0102:            /** Use for execution inside IDE */
0103:            public static void main(java.lang.String[] args) {
0104:                // run whole suite
0105:                TestRunner.run(suite());
0106:                // run only selected test case
0107:                //junit.textui.TestRunner.run(new BeanInfoGeneration("testGenerateNewBeanInfo"));
0108:            }
0109:
0110:            /** setUp method  */
0111:            public void setUp() {
0112:                System.out.println("########  " + getName() + "  #######");
0113:
0114:                new EventTool().waitNoEvent(DELAY);
0115:                new PropertiesAction().perform();
0116:
0117:                FileObject testFile = Repository.getDefault().findResource(
0118:                        "gui/data/" + NAME_TEST_FILE + ".java");
0119:                FileObject destination = Repository.getDefault()
0120:                        .findFileSystem(sampleDir.replace('\\', '/')).getRoot();
0121:
0122:                try {
0123:                    DataObject.find(testFile).copy(
0124:                            DataFolder.findFolder(destination));
0125:                } catch (IOException e) {
0126:                    fail(e);
0127:                }
0128:            }
0129:
0130:            /** tearDown method */
0131:            public void tearDown() {
0132:
0133:                ((SaveAllAction) SaveAllAction.findObject(SaveAllAction.class,
0134:                        true)).performAction();
0135:
0136:                Utilities.delete(NAME_TEST_FILE + ".java");
0137:                Utilities.delete(NAME_TEST_FILE + "BeanInfo.java");
0138:                new RepositoryTabOperator().getRootNode().select();
0139:                /*
0140:                FilesystemNode fsNode = new FilesystemNode(repositoryRootNode, sampleDir);
0141:                fsNode.unmount();
0142:                 */
0143:            }
0144:
0145:            private void createContent() {
0146:                // Start - NonIndexProperty
0147:                RepositoryTabOperator explorerOperator = new RepositoryTabOperator();
0148:
0149:                Node repositoryRootNode = explorerOperator.getRootNode();
0150:                Node patternsNode = new Node(repositoryRootNode, sampleDir
0151:                        + "|"
0152:                        + NAME_TEST_FILE
0153:                        + "|"
0154:                        + "class "
0155:                        + NAME_TEST_FILE
0156:                        + "|"
0157:                        + Bundle.getString("org.netbeans.modules.beans.Bundle",
0158:                                "Patterns"));
0159:                patternsNode.select();
0160:                patternsNode.performPopupActionNoBlock(Bundle.getString(
0161:                        "org.openide.src.nodes.Bundle", "LAB_Add")
0162:                        + "|"
0163:                        + Bundle.getString("org.netbeans.modules.beans.Bundle",
0164:                                "MENU_CREATE_PROPERTY"));
0165:                String dialogTitle = Bundle.getString(
0166:                        "org.netbeans.modules.beans.Bundle",
0167:                        "CTL_TITLE_NewProperty");
0168:                NbDialogOperator nbDialogOperator = new NbDialogOperator(
0169:                        dialogTitle);
0170:
0171:                JTextFieldOperator jTextFieldOperator = new JTextFieldOperator(
0172:                        nbDialogOperator, 0);
0173:                jTextFieldOperator.typeText(NAME_NON_INDEX_PROPERTY);
0174:                JComboBoxOperator jComboBoxOperator = new JComboBoxOperator(
0175:                        nbDialogOperator, 0);
0176:                jComboBoxOperator.typeText("String");
0177:                jComboBoxOperator = new JComboBoxOperator(nbDialogOperator, 1);
0178:                jComboBoxOperator.setSelectedItem(Bundle.getString(
0179:                        "org.netbeans.modules.beans.Bundle",
0180:                        "LAB_ReadWriteMODE"));
0181:                JCheckBoxOperator jCheckBoxOperator = new JCheckBoxOperator(
0182:                        nbDialogOperator, Bundle.getString(
0183:                                "org.netbeans.modules.beans.Bundle",
0184:                                "CTL_PropertyPanel_fieldCheckBox"));
0185:                jCheckBoxOperator.push();
0186:                jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator,
0187:                        Bundle.getString("org.netbeans.modules.beans.Bundle",
0188:                                "CTL_PropertyPanel_setCheckBox"));
0189:                jCheckBoxOperator.push();
0190:                jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator,
0191:                        Bundle.getString("org.netbeans.modules.beans.Bundle",
0192:                                "CTL_PropertyPanel_returnCheckBox"));
0193:                jCheckBoxOperator.push();
0194:                jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator,
0195:                        Bundle.getString("org.netbeans.modules.beans.Bundle",
0196:                                "CTL_PropertyPanel_constrainedCheckBox"));
0197:                jCheckBoxOperator.push();
0198:                jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator,
0199:                        Bundle.getString("org.netbeans.modules.beans.Bundle",
0200:                                "CTL_PropertyPanel_boundCheckBox"));
0201:                jCheckBoxOperator.push();
0202:                jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator,
0203:                        Bundle.getString("org.netbeans.modules.beans.Bundle",
0204:                                "CTL_PropertyPanel_supportCheckBox"));
0205:                jCheckBoxOperator.push();
0206:                //new EventTool().waitNoEvent(1500);
0207:                nbDialogOperator.ok();
0208:                // End - NonIndexProperty
0209:                // Start - IndexProperty
0210:                explorerOperator = new RepositoryTabOperator();
0211:
0212:                repositoryRootNode = explorerOperator.getRootNode();
0213:                patternsNode = new Node(repositoryRootNode, sampleDir
0214:                        + "|"
0215:                        + NAME_TEST_FILE
0216:                        + "|"
0217:                        + "class "
0218:                        + NAME_TEST_FILE
0219:                        + "|"
0220:                        + Bundle.getString("org.netbeans.modules.beans.Bundle",
0221:                                "Patterns"));
0222:                patternsNode.select();
0223:                patternsNode.performPopupActionNoBlock(Bundle.getString(
0224:                        "org.openide.src.nodes.Bundle", "LAB_Add")
0225:                        + "|"
0226:                        + Bundle.getString("org.netbeans.modules.beans.Bundle",
0227:                                "MENU_CREATE_IDXPROPERTY"));
0228:                dialogTitle = Bundle.getString(
0229:                        "org.netbeans.modules.beans.Bundle",
0230:                        "CTL_TITLE_NewIdxProperty");
0231:                nbDialogOperator = new NbDialogOperator(dialogTitle);
0232:
0233:                jTextFieldOperator = new JTextFieldOperator(nbDialogOperator, 0);
0234:                jTextFieldOperator.typeText(NAME_INDEX_PROPERTY);
0235:                jComboBoxOperator = new JComboBoxOperator(nbDialogOperator, 0);
0236:                jComboBoxOperator.setSelectedItem("String");
0237:                jComboBoxOperator = new JComboBoxOperator(nbDialogOperator, 1);
0238:                jComboBoxOperator.setSelectedItem(Bundle.getString(
0239:                        "org.netbeans.modules.beans.Bundle",
0240:                        "LAB_ReadWriteMODE"));
0241:                jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator,
0242:                        Bundle.getString("org.netbeans.modules.beans.Bundle",
0243:                                "CTL_IdxPropertyPanel_fieldCheckBox"));
0244:                jCheckBoxOperator.push();
0245:                jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator,
0246:                        Bundle.getString("org.netbeans.modules.beans.Bundle",
0247:                                "CTL_IdxPropertyPanel_setCheckBox"));
0248:                jCheckBoxOperator.push();
0249:                jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator,
0250:                        Bundle.getString("org.netbeans.modules.beans.Bundle",
0251:                                "CTL_IdxPropertyPanel_returnCheckBox"));
0252:                jCheckBoxOperator.push();
0253:                jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator,
0254:                        Bundle.getString("org.netbeans.modules.beans.Bundle",
0255:                                "CTL_IdxPropertyPanel_niSetterCheckBox"));
0256:                jCheckBoxOperator.push();
0257:                jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator,
0258:                        Bundle.getString("org.netbeans.modules.beans.Bundle",
0259:                                "CTL_IdxPropertyPanel_niGetterCheckBox"));
0260:                jCheckBoxOperator.push();
0261:                jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator,
0262:                        Bundle.getString("org.netbeans.modules.beans.Bundle",
0263:                                "CTL_IdxPropertyPanel_niSetCheckBox"));
0264:                jCheckBoxOperator.push();
0265:                jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator,
0266:                        Bundle.getString("org.netbeans.modules.beans.Bundle",
0267:                                "CTL_IdxPropertyPanel_niReturnCheckBox"));
0268:                jCheckBoxOperator.push();
0269:                jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator,
0270:                        Bundle.getString("org.netbeans.modules.beans.Bundle",
0271:                                "CTL_IdxPropertyPanel_constrainedCheckBox"));
0272:                jCheckBoxOperator.push();
0273:                jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator,
0274:                        Bundle.getString("org.netbeans.modules.beans.Bundle",
0275:                                "CTL_IdxPropertyPanel_boundCheckBox"));
0276:                jCheckBoxOperator.push();
0277:                jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator,
0278:                        Bundle.getString("org.netbeans.modules.beans.Bundle",
0279:                                "CTL_IdxPropertyPanel_supportCheckBox"));
0280:                jCheckBoxOperator.push();
0281:                //new EventTool().waitNoEvent(1500);
0282:                nbDialogOperator.ok();
0283:                // End - IndexProperty
0284:                // Start - UnicastEventSource
0285:                explorerOperator = new RepositoryTabOperator();
0286:
0287:                repositoryRootNode = explorerOperator.getRootNode();
0288:                patternsNode = new Node(repositoryRootNode, sampleDir
0289:                        + "|"
0290:                        + NAME_TEST_FILE
0291:                        + "|"
0292:                        + "class "
0293:                        + NAME_TEST_FILE
0294:                        + "|"
0295:                        + Bundle.getString("org.netbeans.modules.beans.Bundle",
0296:                                "Patterns"));
0297:                patternsNode.select();
0298:                patternsNode.performPopupActionNoBlock(Bundle.getString(
0299:                        "org.openide.src.nodes.Bundle", "LAB_Add")
0300:                        + "|"
0301:                        + Bundle.getString("org.netbeans.modules.beans.Bundle",
0302:                                "MENU_CREATE_UNICASTSE"));
0303:                dialogTitle = Bundle.getString(
0304:                        "org.netbeans.modules.beans.Bundle",
0305:                        "CTL_TITLE_NewUniCastES");
0306:                nbDialogOperator = new NbDialogOperator(dialogTitle);
0307:
0308:                jComboBoxOperator = new JComboBoxOperator(nbDialogOperator, 0);
0309:                jComboBoxOperator
0310:                        .setSelectedItem("java.awt.event.ActionListener");
0311:                JRadioButtonOperator jRadioButtonOperator = new JRadioButtonOperator(
0312:                        nbDialogOperator, Bundle.getString(
0313:                                "org.netbeans.modules.beans.Bundle",
0314:                                "CTL_UEventSetPanel_implRadioButton"));
0315:                jRadioButtonOperator.push();
0316:                jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator,
0317:                        Bundle.getString("org.netbeans.modules.beans.Bundle",
0318:                                "CTL_UEventSetPanel_fireCheckBox"));
0319:                jCheckBoxOperator.push();
0320:                jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator,
0321:                        Bundle.getString("org.netbeans.modules.beans.Bundle",
0322:                                "CTL_UEventSetPanel_passEventCheckBox"));
0323:                jCheckBoxOperator.push();
0324:
0325:                //new EventTool().waitNoEvent(1500);
0326:
0327:                nbDialogOperator.ok();
0328:                // End - UnicastEventSource
0329:                // Start - MulticastEventSourceArrayListImpl
0330:                explorerOperator = new RepositoryTabOperator();
0331:
0332:                repositoryRootNode = explorerOperator.getRootNode();
0333:                patternsNode = new Node(repositoryRootNode, sampleDir
0334:                        + "|"
0335:                        + NAME_TEST_FILE
0336:                        + "|"
0337:                        + "class "
0338:                        + NAME_TEST_FILE
0339:                        + "|"
0340:                        + Bundle.getString("org.netbeans.modules.beans.Bundle",
0341:                                "Patterns"));
0342:                patternsNode.select();
0343:                patternsNode.performPopupActionNoBlock(Bundle.getString(
0344:                        "org.openide.src.nodes.Bundle", "LAB_Add")
0345:                        + "|"
0346:                        + Bundle.getString("org.netbeans.modules.beans.Bundle",
0347:                                "MENU_CREATE_MULTICASTSE"));
0348:                dialogTitle = Bundle.getString(
0349:                        "org.netbeans.modules.beans.Bundle",
0350:                        "CTL_TITLE_NewMultiCastES");
0351:                nbDialogOperator = new NbDialogOperator(dialogTitle);
0352:
0353:                jComboBoxOperator = new JComboBoxOperator(nbDialogOperator, 0);
0354:                jComboBoxOperator
0355:                        .setSelectedItem("java.awt.event.ItemListener");
0356:
0357:                jRadioButtonOperator = new JRadioButtonOperator(
0358:                        nbDialogOperator, Bundle.getString(
0359:                                "org.netbeans.modules.beans.Bundle",
0360:                                "CTL_EventSetPanel_alRadioButton"));
0361:                jRadioButtonOperator.push();
0362:                jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator,
0363:                        Bundle.getString("org.netbeans.modules.beans.Bundle",
0364:                                "CTL_EventSetPanel_fireCheckBox"));
0365:                jCheckBoxOperator.push();
0366:                jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator,
0367:                        Bundle.getString("org.netbeans.modules.beans.Bundle",
0368:                                "CTL_EventSetPanel_passEventCheckBox"));
0369:                jCheckBoxOperator.push();
0370:
0371:                //new EventTool().waitNoEvent(1500);
0372:
0373:                nbDialogOperator.ok();
0374:                // End - MulticastEventSourceArrayListImpl
0375:                // Start - MulticastEventSourceEventListenerListImpl
0376:                explorerOperator = new RepositoryTabOperator();
0377:
0378:                repositoryRootNode = explorerOperator.getRootNode();
0379:                patternsNode = new Node(repositoryRootNode, sampleDir
0380:                        + "|"
0381:                        + NAME_TEST_FILE
0382:                        + "|"
0383:                        + "class "
0384:                        + NAME_TEST_FILE
0385:                        + "|"
0386:                        + Bundle.getString("org.netbeans.modules.beans.Bundle",
0387:                                "Patterns"));
0388:                patternsNode.select();
0389:                patternsNode.performPopupActionNoBlock(Bundle.getString(
0390:                        "org.openide.src.nodes.Bundle", "LAB_Add")
0391:                        + "|"
0392:                        + Bundle.getString("org.netbeans.modules.beans.Bundle",
0393:                                "MENU_CREATE_MULTICASTSE"));
0394:                dialogTitle = Bundle.getString(
0395:                        "org.netbeans.modules.beans.Bundle",
0396:                        "CTL_TITLE_NewMultiCastES");
0397:                nbDialogOperator = new NbDialogOperator(dialogTitle);
0398:
0399:                jComboBoxOperator = new JComboBoxOperator(nbDialogOperator, 0);
0400:                jComboBoxOperator
0401:                        .setSelectedItem("java.awt.event.FocusListener");
0402:
0403:                jRadioButtonOperator = new JRadioButtonOperator(
0404:                        nbDialogOperator, Bundle.getString(
0405:                                "org.netbeans.modules.beans.Bundle",
0406:                                "CTL_EventSetPanel_ellRadioButton"));
0407:                jRadioButtonOperator.push();
0408:                jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator,
0409:                        Bundle.getString("org.netbeans.modules.beans.Bundle",
0410:                                "CTL_EventSetPanel_fireCheckBox"));
0411:                jCheckBoxOperator.push();
0412:                new EventTool().waitNoEvent(400);
0413:                jCheckBoxOperator = new JCheckBoxOperator(nbDialogOperator,
0414:                        Bundle.getString("org.netbeans.modules.beans.Bundle",
0415:                                "CTL_EventSetPanel_passEventCheckBox"));
0416:                jCheckBoxOperator.push();
0417:                //new EventTool().waitNoEvent(1500);
0418:                nbDialogOperator.ok();
0419:
0420:            }
0421:
0422:            public void testGenerateNewBeanInfo() {
0423:                createContent();
0424:                RepositoryTabOperator explorerOperator = new RepositoryTabOperator();
0425:                Node repositoryRootNode = explorerOperator.getRootNode();
0426:                Node patternsNode = new Node(repositoryRootNode, sampleDir
0427:                        + "|"
0428:                        + NAME_TEST_FILE
0429:                        + "|"
0430:                        + "class "
0431:                        + NAME_TEST_FILE
0432:                        + "|"
0433:                        + Bundle.getString("org.netbeans.modules.beans.Bundle",
0434:                                "Patterns"));
0435:                patternsNode.select();
0436:                patternsNode.performPopupActionNoBlock(Bundle.getString(
0437:                        "org.netbeans.modules.beans.Bundle",
0438:                        "CTL_TITLE_GenerateBeanInfo"));
0439:                new EventTool().waitNoEvent(DELAY);
0440:                String dialogTitle = Bundle.getString(
0441:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0442:                        "CTL_TITLE_GenerateBeanInfo");
0443:                NbDialogOperator nbDialogOperator = new NbDialogOperator(
0444:                        dialogTitle);
0445:                //new EventTool().waitNoEvent(1500);
0446:                nbDialogOperator.ok();
0447:                //new EventTool().waitNoEvent(1500);
0448:                //        EditorOperator eo = new EditorOperator(NAME_TEST_FILE+"BeanInfo");
0449:                //        ref(eo.getText());
0450:                writeResult(NAME_TEST_FILE + "BeanInfo");
0451:                compareReferenceFiles();
0452:            }
0453:
0454:            public void testIncludeExclude() {
0455:                createContent();
0456:                RepositoryTabOperator explorerOperator = new RepositoryTabOperator();
0457:                Node repositoryRootNode = explorerOperator.getRootNode();
0458:                Node patternsNode = new Node(repositoryRootNode, sampleDir
0459:                        + "|"
0460:                        + NAME_TEST_FILE
0461:                        + "|"
0462:                        + "class "
0463:                        + NAME_TEST_FILE
0464:                        + "|"
0465:                        + Bundle.getString("org.netbeans.modules.beans.Bundle",
0466:                                "Patterns"));
0467:                patternsNode.select();
0468:                patternsNode.performPopupActionNoBlock(Bundle.getString(
0469:                        "org.netbeans.modules.beans.Bundle",
0470:                        "CTL_TITLE_GenerateBeanInfo"));
0471:                new EventTool().waitNoEvent(DELAY);
0472:                String dialogTitle = Bundle.getString(
0473:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0474:                        "CTL_TITLE_GenerateBeanInfo");
0475:                NbDialogOperator nbDialogOperator = new NbDialogOperator(
0476:                        dialogTitle);
0477:                JTreeOperator jTreeOperator = new JTreeOperator(
0478:                        nbDialogOperator);
0479:                Node node = new Node(jTreeOperator, Bundle.getString(
0480:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0481:                        "CTL_NODE_EventSets"));
0482:                node.select();
0483:                for (int i = 0; i < (new Node(jTreeOperator, Bundle.getString(
0484:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0485:                        "CTL_NODE_EventSets")).getChildren().length); i++) {
0486:                    new Node(node, i).select();
0487:                    PropertySheetOperator propertySheetOperator = new PropertySheetOperator(
0488:                            nbDialogOperator);
0489:                    new Property(propertySheetOperator, Bundle.getString(
0490:                            "org.netbeans.modules.beans.beaninfo.Bundle",
0491:                            "PROP_Bi_included")).setValue("False");
0492:                    //new EventTool().waitNoEvent(1000);
0493:                }
0494:
0495:                new Node(jTreeOperator, Bundle.getString(
0496:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0497:                        "CTL_NODE_Descriptor")).select();
0498:                PropertySheetOperator propertySheetOperator = new PropertySheetOperator(
0499:                        nbDialogOperator);
0500:                new Property(propertySheetOperator, Bundle.getString(
0501:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0502:                        "PROP_Bi_nullDescriptor")).setValue("False");
0503:
0504:                nbDialogOperator.ok();
0505:
0506:                //new EventTool().waitNoEvent(1500);
0507:                explorerOperator = new RepositoryTabOperator();
0508:
0509:                repositoryRootNode = explorerOperator.getRootNode();
0510:                JavaNode javaNode = new JavaNode(repositoryRootNode, sampleDir
0511:                        + "|" + NAME_TEST_FILE + "BeanInfo");
0512:                javaNode.select();
0513:                javaNode.performPopupActionNoBlock(Bundle.getString(
0514:                        "org.openide.actions.Bundle", "Open"));
0515:
0516:                new EventTool().waitNoEvent(500);
0517:
0518:                //        EditorOperator eo = new EditorOperator(NAME_TEST_FILE+"BeanInfo");
0519:                //        ref(eo.getText());
0520:                writeResult(NAME_TEST_FILE + "BeanInfo");
0521:                compareReferenceFiles();
0522:            }
0523:
0524:            private void writeResult(String name) {
0525:                new EventTool().waitNoEvent(1000);
0526:                new EditorOperator(name);
0527:                ref(Utilities.unify(Utilities.getAsString(name + ".java")));
0528:                new EventTool().waitNoEvent(500);
0529:            }
0530:
0531:            public void testRegenerateBeanInfo() {
0532:                createContent();
0533:                RepositoryTabOperator explorerOperator = new RepositoryTabOperator();
0534:                Node repositoryRootNode = explorerOperator.getRootNode();
0535:                Node patternsNode = new Node(repositoryRootNode, sampleDir
0536:                        + "|"
0537:                        + NAME_TEST_FILE
0538:                        + "|"
0539:                        + "class "
0540:                        + NAME_TEST_FILE
0541:                        + "|"
0542:                        + Bundle.getString("org.netbeans.modules.beans.Bundle",
0543:                                "Patterns"));
0544:                patternsNode.select();
0545:                patternsNode.performPopupActionNoBlock(Bundle.getString(
0546:                        "org.netbeans.modules.beans.Bundle",
0547:                        "CTL_TITLE_GenerateBeanInfo"));
0548:                new EventTool().waitNoEvent(DELAY);
0549:                String dialogTitle = Bundle.getString(
0550:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0551:                        "CTL_TITLE_GenerateBeanInfo");
0552:                NbDialogOperator nbDialogOperator = new NbDialogOperator(
0553:                        dialogTitle);
0554:                JTreeOperator jTreeOperator = new JTreeOperator(
0555:                        nbDialogOperator);
0556:
0557:                new Node(jTreeOperator, Bundle.getString(
0558:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0559:                        "CTL_NODE_Descriptor")).select();
0560:                PropertySheetOperator propertySheetOperator = new PropertySheetOperator(
0561:                        nbDialogOperator);
0562:                new Property(propertySheetOperator, Bundle.getString(
0563:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0564:                        "PROP_Bi_nullDescriptor")).setValue("False");
0565:
0566:                nbDialogOperator.ok();
0567:                //new EventTool().waitNoEvent(750);
0568:                explorerOperator = new RepositoryTabOperator();
0569:                repositoryRootNode = explorerOperator.getRootNode();
0570:                JavaNode javaNode = new JavaNode(repositoryRootNode, sampleDir
0571:                        + "|" + NAME_TEST_FILE + "BeanInfo");
0572:                javaNode.select();
0573:                javaNode.open();
0574:                new EventTool().waitNoEvent(100);
0575:                try {
0576:                    EditorOperator eo = new EditorOperator(NAME_TEST_FILE
0577:                            + "BeanInfo");
0578:                    File workDir = getWorkDir();
0579:                    (new File(workDir, "testRegenerateBeanInfoInitial.ref"))
0580:                            .createNewFile();
0581:                    PrintWriter out = new PrintWriter(new BufferedWriter(
0582:                            new FileWriter(workDir + File.separator
0583:                                    + "testRegenerateBeanInfoInitial.ref")));
0584:                    out.print(Utilities.unify(eo.getText()));
0585:                    out.close();
0586:                } catch (IOException exc) {
0587:                    exc.printStackTrace();
0588:                }
0589:                compareReferenceFiles("testRegenerateBeanInfoInitial.ref",
0590:                        "testRegenerateBeanInfoInitial.pass",
0591:                        "testRegenerateBeanInfoInitial.diff");
0592:                Thread thread = new Thread(new java.lang.Runnable() {
0593:                    public void run() {
0594:                        System.out.println("T H R E A D");
0595:                        //new EventTool().waitNoEvent(1000);
0596:                        RepositoryTabOperator explorerOperator = new RepositoryTabOperator();
0597:                        Node repositoryRootNode = explorerOperator
0598:                                .getRootNode();
0599:                        Node patternsNode = new Node(
0600:                                repositoryRootNode,
0601:                                sampleDir
0602:                                        + "|"
0603:                                        + NAME_TEST_FILE
0604:                                        + "|"
0605:                                        + "class "
0606:                                        + NAME_TEST_FILE
0607:                                        + "|"
0608:                                        + Bundle
0609:                                                .getString(
0610:                                                        "org.netbeans.modules.beans.Bundle",
0611:                                                        "Patterns") + "|"
0612:                                        + NAME_NON_INDEX_PROPERTY);
0613:                        patternsNode.select();
0614:                        patternsNode.performPopupActionNoBlock(Bundle
0615:                                .getStringTrimmed("org.openide.actions.Bundle",
0616:                                        "Delete"));
0617:                    }
0618:                });
0619:                thread.start();
0620:                String confirmTitle = Bundle.getString(
0621:                        "org.openide.explorer.Bundle",
0622:                        "MSG_ConfirmDeleteObjectTitle");
0623:                new NbDialogOperator(confirmTitle).yes();
0624:                //new EventTool().waitNoEvent(1500);
0625:                String questionTitle = Bundle.getString("org.openide.Bundle",
0626:                        "NTF_QuestionTitle");
0627:                nbDialogOperator = new NbDialogOperator(questionTitle);
0628:                nbDialogOperator.yes();
0629:                //new EventTool().waitNoEvent(2500);
0630:                //
0631:                explorerOperator = new RepositoryTabOperator();
0632:                repositoryRootNode = explorerOperator.getRootNode();
0633:                patternsNode = new Node(repositoryRootNode, sampleDir
0634:                        + "|"
0635:                        + NAME_TEST_FILE
0636:                        + "|"
0637:                        + "class "
0638:                        + NAME_TEST_FILE
0639:                        + "|"
0640:                        + Bundle.getString("org.netbeans.modules.beans.Bundle",
0641:                                "Patterns"));
0642:                patternsNode.select();
0643:                patternsNode.performPopupActionNoBlock(Bundle.getString(
0644:                        "org.netbeans.modules.beans.Bundle",
0645:                        "CTL_TITLE_GenerateBeanInfo"));
0646:                new EventTool().waitNoEvent(DELAY);
0647:                dialogTitle = Bundle.getString(
0648:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0649:                        "CTL_TITLE_GenerateBeanInfo");
0650:                nbDialogOperator = new NbDialogOperator(dialogTitle);
0651:                jTreeOperator = new JTreeOperator(nbDialogOperator);
0652:
0653:                new Node(jTreeOperator, Bundle.getString(
0654:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0655:                        "CTL_NODE_Descriptor")).select();
0656:                propertySheetOperator = new PropertySheetOperator(
0657:                        nbDialogOperator);
0658:                new Property(propertySheetOperator, Bundle.getString(
0659:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0660:                        "PROP_Bi_nullDescriptor")).setValue("False");
0661:
0662:                nbDialogOperator.ok();
0663:                //new EventTool().waitNoEvent(1500);
0664:                explorerOperator = new RepositoryTabOperator();
0665:                repositoryRootNode = explorerOperator.getRootNode();
0666:                javaNode = new JavaNode(repositoryRootNode, sampleDir + "|"
0667:                        + NAME_TEST_FILE + "BeanInfo");
0668:                javaNode.select();
0669:                javaNode.performPopupActionNoBlock(Bundle.getString(
0670:                        "org.openide.actions.Bundle", "Open"));
0671:                try {
0672:                    EditorOperator eo = new EditorOperator(NAME_TEST_FILE
0673:                            + "BeanInfo");
0674:                    File workDir = getWorkDir();
0675:                    (new File(workDir, "testRegenerateBeanInfoModified.ref"))
0676:                            .createNewFile();
0677:                    PrintWriter out = new PrintWriter(new BufferedWriter(
0678:                            new FileWriter(workDir + File.separator
0679:                                    + "testRegenerateBeanInfoModified.ref")));
0680:                    out.print(Utilities.unify(eo.getText()));
0681:                    out.close();
0682:                } catch (IOException exc) {
0683:                    exc.printStackTrace();
0684:                }
0685:                compareReferenceFiles("testRegenerateBeanInfoModified.ref",
0686:                        "testRegenerateBeanInfoModified.pass",
0687:                        "testRegenerateBeanInfoModified.diff");
0688:            }
0689:
0690:            public void testCheckNodes() {
0691:                createContent();
0692:                RepositoryTabOperator explorerOperator = new RepositoryTabOperator();
0693:                Node repositoryRootNode = explorerOperator.getRootNode();
0694:                Node patternsNode = new Node(repositoryRootNode, sampleDir
0695:                        + "|"
0696:                        + NAME_TEST_FILE
0697:                        + "|"
0698:                        + "class "
0699:                        + NAME_TEST_FILE
0700:                        + "|"
0701:                        + Bundle.getString("org.netbeans.modules.beans.Bundle",
0702:                                "Patterns"));
0703:                patternsNode.select();
0704:                patternsNode.performPopupActionNoBlock(Bundle.getString(
0705:                        "org.netbeans.modules.beans.Bundle",
0706:                        "CTL_TITLE_GenerateBeanInfo"));
0707:                new EventTool().waitNoEvent(DELAY);
0708:                String dialogTitle = Bundle.getString(
0709:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0710:                        "CTL_TITLE_GenerateBeanInfo");
0711:                NbDialogOperator nbDialogOperator = new NbDialogOperator(
0712:                        dialogTitle);
0713:                System.err.println(nbDialogOperator);
0714:
0715:                JTreeOperator jTreeOperator = new JTreeOperator(
0716:                        nbDialogOperator);
0717:                System.err.println(jTreeOperator);
0718:                Node node = new Node(jTreeOperator, Bundle.getString(
0719:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0720:                        "CTL_NODE_Descriptor")
0721:                        + '|' + "TestFile");
0722:                node.select();
0723:                //new EventTool().waitNoEvent(1000);
0724:                node = new Node(jTreeOperator, Bundle.getString(
0725:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0726:                        "CTL_NODE_Properties")
0727:                        + '|' + "nonIndexProperty");
0728:                node.select();
0729:                //new EventTool().waitNoEvent(1000);
0730:                node = new Node(jTreeOperator, Bundle.getString(
0731:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0732:                        "CTL_NODE_Properties")
0733:                        + '|' + "indexProperty");
0734:                node.select();
0735:                //new EventTool().waitNoEvent(1000);
0736:                node = new Node(jTreeOperator, Bundle.getString(
0737:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0738:                        "CTL_NODE_EventSets")
0739:                        + '|' + "itemListener");
0740:                node.select();
0741:                new EventTool().waitNoEvent(100);
0742:                node = new Node(jTreeOperator, Bundle.getString(
0743:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0744:                        "CTL_NODE_EventSets")
0745:                        + '|' + "focusListener");
0746:                node.select();
0747:                //new EventTool().waitNoEvent(1000);
0748:                node = new Node(jTreeOperator, Bundle.getString(
0749:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0750:                        "CTL_NODE_EventSets")
0751:                        + '|' + "vetoableChangeListener");
0752:                node.select();
0753:                //new EventTool().waitNoEvent(1000);
0754:                node = new Node(jTreeOperator, Bundle.getString(
0755:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0756:                        "CTL_NODE_EventSets")
0757:                        + '|' + "propertyChangeListener");
0758:                node.select();
0759:                //new EventTool().waitNoEvent(1000);
0760:                node = new Node(jTreeOperator, Bundle.getString(
0761:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0762:                        "CTL_NODE_EventSets")
0763:                        + '|' + "actionListener");
0764:                node.select();
0765:                //new EventTool().waitNoEvent(1000);
0766:                node = new Node(jTreeOperator, Bundle.getString(
0767:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0768:                        "CTL_NODE_Methods"));
0769:                node.select();
0770:                //new EventTool().waitNoEvent(1000);
0771:                nbDialogOperator.close();
0772:
0773:            }
0774:
0775:            public void testBeanInfoNode() {
0776:                createContent();
0777:                RepositoryTabOperator explorerOperator = new RepositoryTabOperator();
0778:                Node repositoryRootNode = explorerOperator.getRootNode();
0779:                Node patternsNode = new Node(repositoryRootNode, sampleDir
0780:                        + "|"
0781:                        + NAME_TEST_FILE
0782:                        + "|"
0783:                        + "class "
0784:                        + NAME_TEST_FILE
0785:                        + "|"
0786:                        + Bundle.getString("org.netbeans.modules.beans.Bundle",
0787:                                "Patterns"));
0788:                patternsNode.select();
0789:                patternsNode.performPopupActionNoBlock(Bundle.getString(
0790:                        "org.netbeans.modules.beans.Bundle",
0791:                        "CTL_TITLE_GenerateBeanInfo"));
0792:                new EventTool().waitNoEvent(DELAY);
0793:                String dialogTitle = Bundle.getString(
0794:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0795:                        "CTL_TITLE_GenerateBeanInfo");
0796:                NbDialogOperator nbDialogOperator = new NbDialogOperator(
0797:                        dialogTitle);
0798:
0799:                JTreeOperator jTreeOperator = new JTreeOperator(
0800:                        nbDialogOperator);
0801:                //Node node = new Node(jTreeOperator, getTreePathHack(jTreeOperator,new TreePath(new Object[] {"BeanInfo"})));
0802:                //node.select();
0803:                jTreeOperator.setSelectionRow(0);
0804:                //new EventTool().waitNoEvent(1000);
0805:                PropertySheetOperator propertySheetOperator = new PropertySheetOperator(
0806:                        nbDialogOperator);
0807:                new Property(propertySheetOperator, Bundle.getString(
0808:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0809:                        "PROP_Bi_defaultPropertyIndex")).setValue("123");
0810:                //new EventTool().waitNoEvent(1000);
0811:                new Property(propertySheetOperator, Bundle.getString(
0812:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0813:                        "PROP_Bi_defaultEventIndex")).setValue("456");
0814:                //new EventTool().waitNoEvent(1000);
0815:
0816:                new Node(jTreeOperator, Bundle.getString(
0817:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0818:                        "CTL_NODE_Descriptor")).select();
0819:                propertySheetOperator = new PropertySheetOperator(
0820:                        nbDialogOperator);
0821:                new Property(propertySheetOperator, Bundle.getString(
0822:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0823:                        "PROP_Bi_nullDescriptor")).setValue("False");
0824:                nbDialogOperator.ok();
0825:                explorerOperator = new RepositoryTabOperator();
0826:                repositoryRootNode = explorerOperator.getRootNode();
0827:                JavaNode javaNode = new JavaNode(repositoryRootNode, sampleDir
0828:                        + "|" + NAME_TEST_FILE + "BeanInfo");
0829:                javaNode.select();
0830:                javaNode.performPopupActionNoBlock(Bundle.getString(
0831:                        "org.openide.actions.Bundle", "Open"));
0832:                //        EditorOperator eo = new EditorOperator(NAME_TEST_FILE+"BeanInfo");
0833:                //        ref(eo.getText());
0834:                writeResult(NAME_TEST_FILE + "BeanInfo");
0835:                compareReferenceFiles();
0836:            }
0837:
0838:            public void testPropertiesNode() {
0839:                createContent();
0840:                RepositoryTabOperator explorerOperator = new RepositoryTabOperator();
0841:                Node repositoryRootNode = explorerOperator.getRootNode();
0842:                Node patternsNode = new Node(repositoryRootNode, sampleDir
0843:                        + "|"
0844:                        + NAME_TEST_FILE
0845:                        + "|"
0846:                        + "class "
0847:                        + NAME_TEST_FILE
0848:                        + "|"
0849:                        + Bundle.getString("org.netbeans.modules.beans.Bundle",
0850:                                "Patterns"));
0851:                patternsNode.select();
0852:                patternsNode.performPopupActionNoBlock(Bundle.getString(
0853:                        "org.netbeans.modules.beans.Bundle",
0854:                        "CTL_TITLE_GenerateBeanInfo"));
0855:                new EventTool().waitNoEvent(DELAY);
0856:                String dialogTitle = Bundle.getString(
0857:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0858:                        "CTL_TITLE_GenerateBeanInfo");
0859:                NbDialogOperator nbDialogOperator = new NbDialogOperator(
0860:                        dialogTitle);
0861:
0862:                JTreeOperator jTreeOperator = new JTreeOperator(
0863:                        nbDialogOperator);
0864:                new Node(jTreeOperator, Bundle.getString(
0865:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0866:                        "CTL_NODE_Descriptor")).select();
0867:                //new EventTool().waitNoEvent(1000);
0868:                PropertySheetOperator propertySheetOperator = new PropertySheetOperator(
0869:                        nbDialogOperator);
0870:                new Property(propertySheetOperator, Bundle.getString(
0871:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0872:                        "PROP_Bi_nullDescriptor")).setValue("True");
0873:
0874:                new Node(jTreeOperator, Bundle.getString(
0875:                        "org.openide.explorer.propertysheet.Bundle",
0876:                        "CTL_Properties")).select();
0877:                //new EventTool().waitNoEvent(1000);
0878:                propertySheetOperator = new PropertySheetOperator(
0879:                        nbDialogOperator);
0880:                new Property(propertySheetOperator, Bundle.getString(
0881:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0882:                        "PROP_Bi_nullProperties")).setValue("True");
0883:
0884:                new Node(jTreeOperator, Bundle.getString(
0885:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0886:                        "CTL_NODE_EventSets")).select();
0887:                //new EventTool().waitNoEvent(1000);
0888:                propertySheetOperator = new PropertySheetOperator(
0889:                        nbDialogOperator);
0890:                new Property(propertySheetOperator, Bundle.getString(
0891:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0892:                        "PROP_Bi_nullEvents")).setValue("True");
0893:
0894:                new Node(jTreeOperator, Bundle.getString(
0895:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0896:                        "CTL_NODE_Methods")).select();
0897:                //new EventTool().waitNoEvent(1000);
0898:                propertySheetOperator = new PropertySheetOperator(
0899:                        nbDialogOperator);
0900:                new Property(propertySheetOperator, Bundle.getString(
0901:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0902:                        "PROP_Bi_nullProperties")).setValue("True");
0903:                //new EventTool().waitNoEvent(1000);
0904:
0905:                nbDialogOperator.ok();
0906:                explorerOperator = new RepositoryTabOperator();
0907:                repositoryRootNode = explorerOperator.getRootNode();
0908:                JavaNode javaNode = new JavaNode(repositoryRootNode, sampleDir
0909:                        + "|" + NAME_TEST_FILE + "BeanInfo");
0910:                javaNode.select();
0911:                javaNode.performPopupActionNoBlock(Bundle.getString(
0912:                        "org.openide.actions.Bundle", "Open"));
0913:                //        EditorOperator eo = new EditorOperator(NAME_TEST_FILE+"BeanInfo");
0914:                //        ref(eo.getText());
0915:                writeResult(NAME_TEST_FILE + "BeanInfo");
0916:                compareReferenceFiles();
0917:            }
0918:
0919:            public void testNodesDescription() {
0920:                createContent();
0921:                RepositoryTabOperator explorerOperator = new RepositoryTabOperator();
0922:                Node repositoryRootNode = explorerOperator.getRootNode();
0923:                Node patternsNode = new Node(repositoryRootNode, sampleDir
0924:                        + "|"
0925:                        + NAME_TEST_FILE
0926:                        + "|"
0927:                        + "class "
0928:                        + NAME_TEST_FILE
0929:                        + "|"
0930:                        + Bundle.getString("org.netbeans.modules.beans.Bundle",
0931:                                "Patterns"));
0932:                patternsNode.select();
0933:                patternsNode.performPopupActionNoBlock(Bundle.getString(
0934:                        "org.netbeans.modules.beans.Bundle",
0935:                        "CTL_TITLE_GenerateBeanInfo"));
0936:                new EventTool().waitNoEvent(DELAY);
0937:                String dialogTitle = Bundle.getString(
0938:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0939:                        "CTL_TITLE_GenerateBeanInfo");
0940:                NbDialogOperator nbDialogOperator = new NbDialogOperator(
0941:                        dialogTitle);
0942:
0943:                JTreeOperator jTreeOperator = new JTreeOperator(
0944:                        nbDialogOperator);
0945:                new Node(jTreeOperator, Bundle.getString(
0946:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0947:                        "CTL_NODE_Descriptor")
0948:                        + "|TestFile").select();
0949:                //new EventTool().waitNoEvent(1000);
0950:                PropertySheetOperator propertySheetOperator = new PropertySheetOperator(
0951:                        nbDialogOperator);
0952:                new Property(propertySheetOperator, Bundle.getString(
0953:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0954:                        "PROP_Bi_name")).getValue();
0955:                //new EventTool().waitNoEvent(750);
0956:                new Property(propertySheetOperator, Bundle.getString(
0957:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0958:                        "PROP_Bi_expert")).setValue(new Property(
0959:                        propertySheetOperator, Bundle.getString(
0960:                                "org.netbeans.modules.beans.beaninfo.Bundle",
0961:                                "PROP_Bi_expert")).getValue());
0962:                //new EventTool().waitNoEvent(750);
0963:                new Property(propertySheetOperator, Bundle.getString(
0964:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0965:                        "PROP_Bi_hidden")).setValue(new Property(
0966:                        propertySheetOperator, Bundle.getString(
0967:                                "org.netbeans.modules.beans.beaninfo.Bundle",
0968:                                "PROP_Bi_hidden")).getValue());
0969:                //new EventTool().waitNoEvent(750);
0970:                new Property(propertySheetOperator, Bundle.getString(
0971:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0972:                        "PROP_Bi_preferred")).setValue(new Property(
0973:                        propertySheetOperator, Bundle.getString(
0974:                                "org.netbeans.modules.beans.beaninfo.Bundle",
0975:                                "PROP_Bi_preferred")).getValue());
0976:                //new EventTool().waitNoEvent(750);
0977:                //IT ISN'T POSSIBLE TO READ AND WRITE AGAIN THE SAME VALUE//        new TextFieldProperty(propertySheetTabOperator, Bundle.getString("org.netbeans.modules.beans.beaninfo.Bundle", "PROP_Bi_displayName")).setValue(new TextFieldProperty(propertySheetTabOperator, Bundle.getString("org.netbeans.modules.beans.beaninfo.Bundle", "PROP_Bi_displayName")).getValue());
0978:                //new EventTool().waitNoEvent(750);
0979:                ////        new TextFieldProperty(propertySheetTabOperator, Bundle.getString("org.netbeans.modules.beans.beaninfo.Bundle", "PROP_Bi_shortDescription")).setValue(new TextFieldProperty(propertySheetTabOperator, Bundle.getString("org.netbeans.modules.beans.beaninfo.Bundle", "PROP_Bi_shortDescription")).getValue());
0980:                //new EventTool().waitNoEvent(750);
0981:                new Property(propertySheetOperator, Bundle.getString(
0982:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0983:                        "PROP_Bi_customizer")).getValue();
0984:                new EventTool().waitNoEvent(400);
0985:
0986:                jTreeOperator.setComparator(new DefaultStringComparator(true,
0987:                        true));
0988:                new Node(jTreeOperator, Bundle.getString(
0989:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0990:                        "CTL_NODE_Properties")
0991:                        + "|indexProperty").select();
0992:
0993:                //new EventTool().waitNoEvent(1000);
0994:                propertySheetOperator = new PropertySheetOperator(
0995:                        nbDialogOperator);
0996:                new Property(propertySheetOperator, Bundle.getString(
0997:                        "org.netbeans.modules.beans.beaninfo.Bundle",
0998:                        "PROP_Bi_name")).getValue();
0999:                //new EventTool().waitNoEvent(750);
1000:                new Property(propertySheetOperator, Bundle.getString(
1001:                        "org.netbeans.modules.beans.beaninfo.Bundle",
1002:                        "PROP_Bi_expert")).setValue(new Property(
1003:                        propertySheetOperator, Bundle.getString(
1004:                                "org.netbeans.modules.beans.beaninfo.Bundle",
1005:                                "PROP_Bi_expert")).getValue());
1006:                //new EventTool().waitNoEvent(750);
1007:                new Property(propertySheetOperator, Bundle.getString(
1008:                        "org.netbeans.modules.beans.beaninfo.Bundle",
1009:                        "PROP_Bi_hidden")).setValue(new Property(
1010:                        propertySheetOperator, Bundle.getString(
1011:                                "org.netbeans.modules.beans.beaninfo.Bundle",
1012:                                "PROP_Bi_hidden")).getValue());
1013:                //new EventTool().waitNoEvent(750);
1014:                new Property(propertySheetOperator, Bundle.getString(
1015:                        "org.netbeans.modules.beans.beaninfo.Bundle",
1016:                        "PROP_Bi_preferred")).setValue(new Property(
1017:                        propertySheetOperator, Bundle.getString(
1018:                                "org.netbeans.modules.beans.beaninfo.Bundle",
1019:                                "PROP_Bi_preferred")).getValue());
1020:                //new EventTool().waitNoEvent(750);
1021:                ////        new TextFieldProperty(propertySheetTabOperator, Bundle.getString("org.netbeans.modules.beans.beaninfo.Bundle", "PROP_Bi_shortDescription")).setValue(new TextFieldProperty(propertySheetTabOperator, Bundle.getString("org.netbeans.modules.beans.beaninfo.Bundle", "PROP_Bi_shortDescription")).getValue());
1022:                //new EventTool().waitNoEvent(750);
1023:                new Property(propertySheetOperator, Bundle.getString(
1024:                        "org.netbeans.modules.beans.beaninfo.Bundle",
1025:                        "PROP_Bi_included")).setValue(new Property(
1026:                        propertySheetOperator, Bundle.getString(
1027:                                "org.netbeans.modules.beans.beaninfo.Bundle",
1028:                                "PROP_Bi_included")).getValue());
1029:                //new EventTool().waitNoEvent(750);
1030:
1031:                new Property(propertySheetOperator, Bundle.getString(
1032:                        "org.netbeans.modules.beans.beaninfo.Bundle",
1033:                        "PROP_Bi_bound")).setValue(new Property(
1034:                        propertySheetOperator, Bundle.getString(
1035:                                "org.netbeans.modules.beans.beaninfo.Bundle",
1036:                                "PROP_Bi_bound")).getValue());
1037:                //new EventTool().waitNoEvent(750);
1038:                new Property(propertySheetOperator, Bundle.getString(
1039:                        "org.netbeans.modules.beans.beaninfo.Bundle",
1040:                        "PROP_Bi_bound")).setValue(new Property(
1041:                        propertySheetOperator, Bundle.getString(
1042:                                "org.netbeans.modules.beans.beaninfo.Bundle",
1043:                                "PROP_Bi_bound")).getValue());
1044:                //new EventTool().waitNoEvent(750);
1045:                new Property(propertySheetOperator, Bundle.getString(
1046:                        "org.netbeans.modules.beans.beaninfo.Bundle",
1047:                        "PROP_Bi_mode")).setValue(new Property(
1048:                        propertySheetOperator, Bundle.getString(
1049:                                "org.netbeans.modules.beans.beaninfo.Bundle",
1050:                                "PROP_Bi_mode")).getValue());
1051:                //new EventTool().waitNoEvent(750);
1052:                ////        new TextFieldProperty(propertySheetTabOperator, Bundle.getString("org.netbeans.modules.beans.beaninfo.Bundle", "PROP_Bi_propertyEditorClass")).setValue(new TextFieldProperty(propertySheetTabOperator, Bundle.getString("org.netbeans.modules.beans.beaninfo.Bundle", "PROP_Bi_propertyEditorClass")).getValue());
1053:                //new EventTool().waitNoEvent(750);
1054:                new Property(propertySheetOperator, Bundle.getString(
1055:                        "org.netbeans.modules.beans.beaninfo.Bundle",
1056:                        "PROP_Bi_niGetter")).setValue(new Property(
1057:                        propertySheetOperator, Bundle.getString(
1058:                                "org.netbeans.modules.beans.beaninfo.Bundle",
1059:                                "PROP_Bi_niGetter")).getValue());
1060:                //new EventTool().waitNoEvent(750);
1061:                new Property(propertySheetOperator, Bundle.getString(
1062:                        "org.netbeans.modules.beans.beaninfo.Bundle",
1063:                        "PROP_Bi_niSetter")).setValue(new Property(
1064:                        propertySheetOperator, Bundle.getString(
1065:                                "org.netbeans.modules.beans.beaninfo.Bundle",
1066:                                "PROP_Bi_niSetter")).getValue());
1067:                //new EventTool().waitNoEvent(750);
1068:
1069:                new Node(jTreeOperator, Bundle.getString(
1070:                        "org.netbeans.modules.beans.beaninfo.Bundle",
1071:                        "CTL_NODE_EventSets")
1072:                        + "|focusListener").select();
1073:                //new EventTool().waitNoEvent(1000);
1074:                propertySheetOperator = new PropertySheetOperator(
1075:                        nbDialogOperator);
1076:
1077:                new Property(propertySheetOperator, Bundle.getString(
1078:                        "org.netbeans.modules.beans.beaninfo.Bundle",
1079:                        "PROP_Bi_name")).getValue();
1080:                //new EventTool().waitNoEvent(750);
1081:                new Property(propertySheetOperator, Bundle.getString(
1082:                        "org.netbeans.modules.beans.beaninfo.Bundle",
1083:                        "PROP_Bi_expert")).setValue(new Property(
1084:                        propertySheetOperator, Bundle.getString(
1085:                                "org.netbeans.modules.beans.beaninfo.Bundle",
1086:                                "PROP_Bi_expert")).getValue());
1087:                //new EventTool().waitNoEvent(750);
1088:                new Property(propertySheetOperator, Bundle.getString(
1089:                        "org.netbeans.modules.beans.beaninfo.Bundle",
1090:                        "PROP_Bi_hidden")).setValue(new Property(
1091:                        propertySheetOperator, Bundle.getString(
1092:                                "org.netbeans.modules.beans.beaninfo.Bundle",
1093:                                "PROP_Bi_hidden")).getValue());
1094:                //new EventTool().waitNoEvent(750);
1095:                new Property(propertySheetOperator, Bundle.getString(
1096:                        "org.netbeans.modules.beans.beaninfo.Bundle",
1097:                        "PROP_Bi_preferred")).setValue(new Property(
1098:                        propertySheetOperator, Bundle.getString(
1099:                                "org.netbeans.modules.beans.beaninfo.Bundle",
1100:                                "PROP_Bi_preferred")).getValue());
1101:                //new EventTool().waitNoEvent(750);
1102:                ////        new TextFieldProperty(propertySheetTabOperator, Bundle.getString("org.netbeans.modules.beans.beaninfo.Bundle", "PROP_Bi_displayName")).setValue(new TextFieldProperty(propertySheetTabOperator, Bundle.getString("org.netbeans.modules.beans.beaninfo.Bundle", "PROP_Bi_displayName")).getValue());
1103:                //new EventTool().waitNoEvent(750);
1104:                ////        new TextFieldProperty(propertySheetTabOperator, Bundle.getString("org.netbeans.modules.beans.beaninfo.Bundle", "PROP_Bi_shortDescription")).setValue(new TextFieldProperty(propertySheetTabOperator, Bundle.getString("org.netbeans.modules.beans.beaninfo.Bundle", "PROP_Bi_shortDescription")).getValue());
1105:                //new EventTool().waitNoEvent(750);
1106:                new Property(propertySheetOperator, Bundle.getString(
1107:                        "org.netbeans.modules.beans.beaninfo.Bundle",
1108:                        "PROP_Bi_included")).setValue(new Property(
1109:                        propertySheetOperator, Bundle.getString(
1110:                                "org.netbeans.modules.beans.beaninfo.Bundle",
1111:                                "PROP_Bi_included")).getValue());
1112:                //new EventTool().waitNoEvent(750);
1113:
1114:                new Property(propertySheetOperator, Bundle.getString(
1115:                        "org.netbeans.modules.beans.beaninfo.Bundle",
1116:                        "PROP_Bi_unicast")).getValue();
1117:                //new EventTool().waitNoEvent(750);
1118:                new Property(propertySheetOperator, Bundle.getString(
1119:                        "org.netbeans.modules.beans.beaninfo.Bundle",
1120:                        "PROP_Bi_inDefaultEventSet")).setValue(new Property(
1121:                        propertySheetOperator, Bundle.getString(
1122:                                "org.netbeans.modules.beans.beaninfo.Bundle",
1123:                                "PROP_Bi_inDefaultEventSet")).getValue());
1124:                //new EventTool().waitNoEvent(750);
1125:
1126:                nbDialogOperator.ok();
1127:
1128:                EditorOperator eo = new EditorOperator(NAME_TEST_FILE
1129:                        + "BeanInfo");
1130:            }
1131:
1132:            public void testCheckBeanInfoCompilability() {
1133:                createContent();
1134:                RepositoryTabOperator explorerOperator = new RepositoryTabOperator();
1135:                Node repositoryRootNode = explorerOperator.getRootNode();
1136:                Node patternsNode = new Node(repositoryRootNode, sampleDir
1137:                        + "|"
1138:                        + NAME_TEST_FILE
1139:                        + "|"
1140:                        + "class "
1141:                        + NAME_TEST_FILE
1142:                        + "|"
1143:                        + Bundle.getString("org.netbeans.modules.beans.Bundle",
1144:                                "Patterns"));
1145:                patternsNode.select();
1146:                patternsNode.performPopupActionNoBlock(Bundle.getString(
1147:                        "org.netbeans.modules.beans.Bundle",
1148:                        "CTL_TITLE_GenerateBeanInfo"));
1149:                new EventTool().waitNoEvent(DELAY);
1150:                String dialogTitle = Bundle.getString(
1151:                        "org.netbeans.modules.beans.beaninfo.Bundle",
1152:                        "CTL_TITLE_GenerateBeanInfo");
1153:                NbDialogOperator nbDialogOperator = new NbDialogOperator(
1154:                        dialogTitle);
1155:                nbDialogOperator.ok();
1156:                //new EventTool().waitNoEvent(1000);
1157:                explorerOperator = new RepositoryTabOperator();
1158:                repositoryRootNode = explorerOperator.getRootNode();
1159:                JavaNode javaNode = new JavaNode(repositoryRootNode, sampleDir
1160:                        + "|" + NAME_TEST_FILE + "BeanInfo");
1161:                javaNode.select();
1162:                javaNode.compile();
1163:
1164:                MainWindowOperator.getDefault().waitStatusText(
1165:                        "Finished TestFileBeanInfo");
1166:                assertNotNull("Generated BeanInfo is not compilable",
1167:                        Repository.getDefault().findResource(
1168:                                "TestFileBeanInfo.class"));
1169:            }
1170:
1171:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.