Source Code Cross Referenced for BranchTest.java in  » IDE-Netbeans » versioning » org » netbeans » test » cvsmodule » 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 » versioning » org.netbeans.test.cvsmodule 
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:
042:        package org.netbeans.test.cvsmodule;
043:
044:        import java.io.File;
045:        import java.io.InputStream;
046:        import junit.textui.TestRunner;
047:        import org.netbeans.jellytools.JellyTestCase;
048:        import org.netbeans.jellytools.NbDialogOperator;
049:        import org.netbeans.jellytools.OutputOperator;
050:        import org.netbeans.jellytools.OutputTabOperator;
051:        import org.netbeans.jellytools.ProjectsTabOperator;
052:        import org.netbeans.jellytools.modules.javacvs.BranchOperator;
053:        import org.netbeans.jellytools.modules.javacvs.BrowseTagsOperator;
054:        import org.netbeans.jellytools.modules.javacvs.CVSRootStepOperator;
055:        import org.netbeans.jellytools.modules.javacvs.CheckoutWizardOperator;
056:        import org.netbeans.jellytools.modules.javacvs.MergeChangesFromBranchOperator;
057:        import org.netbeans.jellytools.modules.javacvs.ModuleToCheckoutStepOperator;
058:        import org.netbeans.jellytools.modules.javacvs.SwitchToBranchOperator;
059:        import org.netbeans.jellytools.nodes.Node;
060:        import org.netbeans.jellytools.nodes.SourcePackagesNode;
061:        import org.netbeans.jemmy.QueueTool;
062:        import org.netbeans.jemmy.TimeoutExpiredException;
063:        import org.netbeans.jemmy.operators.JButtonOperator;
064:        import org.netbeans.jemmy.operators.JCheckBoxOperator;
065:        import org.netbeans.jemmy.operators.JProgressBarOperator;
066:        import org.netbeans.jemmy.operators.JRadioButtonOperator;
067:        import org.netbeans.jemmy.operators.JTextFieldOperator;
068:        import org.netbeans.jemmy.operators.Operator;
069:        import org.netbeans.jemmy.operators.Operator.DefaultStringComparator;
070:        import org.netbeans.junit.NbTestSuite;
071:        import org.netbeans.junit.ide.ProjectSupport;
072:
073:        /**
074:         *
075:         * @author peter
076:         */
077:        public class BranchTest extends JellyTestCase {
078:
079:            String os_name;
080:            static String sessionCVSroot;
081:            boolean unix = false;
082:            final String projectName = "ForImport";
083:            final String pathToMain = "forimport|Main.java";
084:            final String PROTOCOL_FOLDER = "protocol";
085:            Operator.DefaultStringComparator comOperator;
086:            Operator.DefaultStringComparator oldOperator;
087:
088:            /** Creates a new instance of BranchTest */
089:            public BranchTest(String name) {
090:                super (name);
091:            }
092:
093:            protected void setUp() throws Exception {
094:
095:                os_name = System.getProperty("os.name");
096:                //System.out.println(os_name);
097:                System.out.println("### " + getName() + " ###");
098:
099:            }
100:
101:            protected boolean isUnix() {
102:                boolean unix = false;
103:                if (os_name.indexOf("Windows") == -1) {
104:                    unix = true;
105:                }
106:                return unix;
107:            }
108:
109:            public static void main(String[] args) {
110:                // TODO code application logic here
111:                TestRunner.run(suite());
112:            }
113:
114:            public static NbTestSuite suite() {
115:                NbTestSuite suite = new NbTestSuite();
116:                suite.addTest(new BranchTest("testCheckOutProject"));
117:                suite.addTest(new BranchTest("testBranchDialogUI"));
118:                suite.addTest(new BranchTest("testSwitchToBranchDialogUI"));
119:                suite.addTest(new BranchTest(
120:                        "testMergeChangesFromBranchDialogUI"));
121:                suite.addTest(new BranchTest("testOnNonVersioned"));
122:                suite.addTest(new BranchTest("removeAllData"));
123:                //debug
124:                //suite.addTest(new BranchTest("testOnNonVersioned"));
125:                return suite;
126:            }
127:
128:            public void testCheckOutProject() throws Exception {
129:
130:                //JemmyProperties.setCurrentTimeout("ComponentOperator.WaitComponentTimeout", 18000);
131:                //JemmyProperties.setCurrentTimeout("DialogWaiter.WaitDialogTimeout", 18000);
132:                TestKit.closeProject(projectName);
133:                new ProjectsTabOperator().tree().clearSelection();
134:                comOperator = new Operator.DefaultStringComparator(true, true);
135:                oldOperator = (DefaultStringComparator) Operator
136:                        .getDefaultStringComparator();
137:                Operator.setDefaultStringComparator(comOperator);
138:                CheckoutWizardOperator cwo = CheckoutWizardOperator.invoke();
139:                Operator.setDefaultStringComparator(oldOperator);
140:                CVSRootStepOperator crso = new CVSRootStepOperator();
141:                //JComboBoxOperator combo = new JComboBoxOperator(crso, 0);
142:                crso.setCVSRoot(":pserver:anoncvs@localhost:/cvs");
143:                //crso.setPassword("");
144:                //crso.setPassword("test");
145:
146:                //prepare stream for successful authentification and run PseudoCVSServer
147:                InputStream in = TestKit.getStream(getDataDir()
148:                        .getCanonicalFile().toString()
149:                        + File.separator + PROTOCOL_FOLDER, "authorized.in");
150:                PseudoCvsServer cvss = new PseudoCvsServer(in);
151:                new Thread(cvss).start();
152:                cvss.ignoreProbe();
153:                String CVSroot = cvss.getCvsRoot();
154:                sessionCVSroot = CVSroot;
155:                //System.out.println(sessionCVSroot);
156:                crso.setCVSRoot(CVSroot);
157:                System.setProperty("netbeans.t9y.cvs.connection.CVSROOT",
158:                        CVSroot);
159:                crso.next();
160:
161:                //second step of checkoutwizard
162:                //2nd step of CheckOutWizard
163:
164:                File tmp = new File("/tmp"); // NOI18N
165:                File work = new File(tmp, "" + File.separator
166:                        + System.currentTimeMillis());
167:                File cacheFolder = new File(work, projectName + File.separator
168:                        + "src" + File.separator + "forimport" + File.separator
169:                        + "CVS" + File.separator + "RevisionCache");
170:                tmp.mkdirs();
171:                work.mkdirs();
172:                tmp.deleteOnExit();
173:                ModuleToCheckoutStepOperator moduleCheck = new ModuleToCheckoutStepOperator();
174:                cvss.stop();
175:                in.close();
176:                moduleCheck.setModule("ForImport");
177:                moduleCheck.setLocalFolder(work.getAbsolutePath()); // NOI18N
178:
179:                //Pseudo CVS server for finishing check out wizard
180:                in = TestKit.getStream(getDataDir().getCanonicalFile()
181:                        .toString()
182:                        + File.separator + PROTOCOL_FOLDER,
183:                        "checkout_finish_2.in");
184:                cvss = new PseudoCvsServer(in);
185:                new Thread(cvss).start();
186:                CVSroot = cvss.getCvsRoot();
187:                //cvss.ignoreProbe();
188:
189:                //crso.setCVSRoot(CVSroot);
190:                //combo.setSelectedItem(CVSroot);
191:                System.setProperty("netbeans.t9y.cvs.connection.CVSROOT",
192:                        CVSroot);
193:                cwo.finish();
194:                Thread.sleep(3000);
195:
196:                OutputOperator oo = OutputOperator.invoke();
197:                //System.out.println(CVSroot);
198:
199:                OutputTabOperator oto = oo.getOutputTab(sessionCVSroot);
200:                oto.waitText("Checking out finished");
201:                cvss.stop();
202:                in.close();
203:                NbDialogOperator nbdialog = new NbDialogOperator(
204:                        "Checkout Completed");
205:                JButtonOperator open = new JButtonOperator(nbdialog,
206:                        "Open Project");
207:                open.push();
208:
209:                ProjectSupport.waitScanFinished();
210:                TestKit.waitForQueueEmpty();
211:                ProjectSupport.waitScanFinished();
212:
213:                //create new elements for testing
214:                TestKit.createNewElementsCommitCvs11(projectName);
215:                System.setProperty("netbeans.t9y.cvs.connection.CVSROOT", "");
216:            }
217:
218:            public void removeAllData() throws Exception {
219:                TestKit.closeProject(projectName);
220:                System.setProperty("netbeans.t9y.cvs.connection.CVSROOT", "");
221:            }
222:
223:            public void testBranchDialogUI() throws Exception {
224:
225:                //JemmyProperties.setCurrentTimeout("ComponentOperator.WaitComponentTimeout", 3000);
226:                //JemmyProperties.setCurrentTimeout("DialogWaiter.WaitDialogTimeout", 3000);
227:                PseudoCvsServer cvss;
228:                InputStream in;
229:
230:                in = TestKit.getStream(getDataDir().getCanonicalFile()
231:                        .toString()
232:                        + File.separator + PROTOCOL_FOLDER,
233:                        "browse_tags_branches.in");
234:                cvss = new PseudoCvsServer(in);
235:                new Thread(cvss).start();
236:                System.setProperty("netbeans.t9y.cvs.connection.CVSROOT", cvss
237:                        .getCvsRoot());
238:                //invoke Branch dialog on file node
239:                Node node = new Node(new SourcePackagesNode(projectName),
240:                        pathToMain);
241:
242:                BranchOperator bo = BranchOperator.invoke(node);
243:                BrowseTagsOperator browseTags = bo.browse();
244:
245:                //Head node
246:                browseTags.selectPath("Head");
247:                //Tags node
248:                browseTags.selectPath("Tags");
249:                //Branches node
250:                browseTags.selectPath("Branches");
251:                //
252:                browseTags.selectPath("Branches|MyBranch");
253:                browseTags.selectPath("Tags|MyBranch_root");
254:                cvss.stop();
255:                //
256:                //Ok button
257:                try {
258:                    JButtonOperator btnBranch = new JButtonOperator(browseTags,
259:                            "OK");
260:                    JButtonOperator btnHelp = new JButtonOperator(browseTags,
261:                            "Help");
262:                    JButtonOperator btnCancel = new JButtonOperator(browseTags,
263:                            "Cancel");
264:                    btnCancel.push();
265:                } catch (TimeoutExpiredException e) {
266:                    throw e;
267:                }
268:                try {
269:                    JTextFieldOperator tf1 = new JTextFieldOperator(bo, 0);
270:                    JTextFieldOperator tf2 = new JTextFieldOperator(bo, 1);
271:                    JCheckBoxOperator cb1 = new JCheckBoxOperator(bo,
272:                            "Tag Before Branching");
273:                    JCheckBoxOperator cb2 = new JCheckBoxOperator(bo,
274:                            "Switch to This Branch Afterwards");
275:                    JButtonOperator btnBranch = new JButtonOperator(bo,
276:                            "Branch");
277:                    JButtonOperator btnHelp = new JButtonOperator(bo, "Help");
278:                    JButtonOperator btnCancel = new JButtonOperator(bo,
279:                            "Cancel");
280:
281:                } catch (TimeoutExpiredException ex) {
282:                    throw ex;
283:                }
284:                //
285:                bo.checkTagBeforeBranching(false);
286:                assertFalse(bo.txtTagName().isEnabled());
287:                //
288:                bo.checkTagBeforeBranching(true);
289:                assertTrue(bo.txtTagName().isEnabled());
290:                System.setProperty("netbeans.t9y.cvs.connection.CVSROOT", "");
291:                bo.cancel();
292:            }
293:
294:            public void testSwitchToBranchDialogUI() throws Exception {
295:                //JemmyProperties.setCurrentTimeout("ComponentOperator.WaitComponentTimeout", 3000);
296:                //JemmyProperties.setCurrentTimeout("DialogWaiter.WaitDialogTimeout", 3000);
297:                Node node = new Node(new SourcePackagesNode(projectName),
298:                        pathToMain);
299:                SwitchToBranchOperator sbo = SwitchToBranchOperator
300:                        .invoke(node);
301:                JRadioButtonOperator trunkRb = new JRadioButtonOperator(sbo,
302:                        "Switch to Trunk");
303:                JRadioButtonOperator branchRb = new JRadioButtonOperator(sbo,
304:                        "Switch to Branch");
305:                sbo.switchToBranch();
306:
307:                PseudoCvsServer cvss;
308:                InputStream in;
309:
310:                in = TestKit.getStream(getDataDir().getCanonicalFile()
311:                        .toString()
312:                        + File.separator + PROTOCOL_FOLDER,
313:                        "browse_tags_branches.in");
314:                cvss = new PseudoCvsServer(in);
315:                new Thread(cvss).start();
316:                System.setProperty("netbeans.t9y.cvs.connection.CVSROOT", cvss
317:                        .getCvsRoot());
318:                //invoke Branch dialog on file node
319:
320:                BrowseTagsOperator browseTags = sbo.browse();
321:                //Head node
322:                browseTags.selectPath("Head");
323:                //Tags node
324:                browseTags.selectPath("Tags");
325:                //Branches node
326:                browseTags.selectPath("Branches");
327:                //
328:                browseTags.selectPath("Branches|MyBranch");
329:                browseTags.selectPath("Tags|MyBranch_root");
330:                cvss.stop();
331:                //
332:                //Ok button
333:                TimeoutExpiredException tee = null;
334:                try {
335:                    JButtonOperator btnOk = new JButtonOperator(browseTags,
336:                            "OK");
337:                    JButtonOperator btnHelp = new JButtonOperator(browseTags,
338:                            "Help");
339:                    JButtonOperator btnCancel = new JButtonOperator(browseTags,
340:                            "Cancel");
341:                    btnCancel.push();
342:                } catch (Exception e) {
343:                    if (e instanceof  TimeoutExpiredException) {
344:                        tee = (TimeoutExpiredException) e;
345:                    } else {
346:                        throw e;
347:                    }
348:                }
349:                assertNull(
350:                        "All components should be available, but some of them were not!",
351:                        tee);
352:
353:                tee = null;
354:                try {
355:                    JTextFieldOperator tf1 = new JTextFieldOperator(sbo, 0);
356:                    //tf1.getFocus();
357:
358:                    JButtonOperator btnBranch = new JButtonOperator(sbo,
359:                            "Switch");
360:                    JButtonOperator btnHelp = new JButtonOperator(sbo, "Help");
361:                    JButtonOperator btnCancel = new JButtonOperator(sbo,
362:                            "Cancel");
363:                } catch (Exception e) {
364:                    if (e instanceof  TimeoutExpiredException) {
365:                        tee = (TimeoutExpiredException) e;
366:                    } else {
367:                        throw e;
368:                    }
369:                }
370:                assertNull(
371:                        "All components should be available, but some of them were not!",
372:                        tee);
373:
374:                //check functionality of radiobutton selection 
375:                sbo.switchToTrunk();
376:                assertEquals(false, sbo.btBrowse().isEnabled());
377:                sbo.switchToBranch();
378:                assertEquals(true, sbo.btBrowse().isEnabled());
379:                sbo.cancel();
380:                System.setProperty("netbeans.t9y.cvs.connection.CVSROOT", "");
381:            }
382:
383:            public void testMergeChangesFromBranchDialogUI() throws Exception {
384:                //JemmyProperties.setCurrentTimeout("ComponentOperator.WaitComponentTimeout", 3000);
385:                //JemmyProperties.setCurrentTimeout("DialogWaiter.WaitDialogTimeout", 3000);
386:                Node node = new Node(new SourcePackagesNode(projectName),
387:                        pathToMain);
388:                MergeChangesFromBranchOperator mcbo = MergeChangesFromBranchOperator
389:                        .invoke(node);
390:                mcbo.mergeFromTag();
391:
392:                //browse 1.
393:                PseudoCvsServer cvss;
394:                InputStream in;
395:
396:                in = TestKit.getStream(getDataDir().getCanonicalFile()
397:                        .toString()
398:                        + File.separator + PROTOCOL_FOLDER,
399:                        "browse_tags_branches.in");
400:                cvss = new PseudoCvsServer(in);
401:                new Thread(cvss).start();
402:                System.setProperty("netbeans.t9y.cvs.connection.CVSROOT", cvss
403:                        .getCvsRoot());
404:
405:                BrowseTagsOperator browseTags = mcbo.browseStartingFromTag();
406:                //Head node
407:                browseTags.selectPath("Head");
408:                //Tags node
409:                browseTags.selectPath("Tags");
410:                //Branches node
411:                browseTags.selectPath("Branches");
412:                browseTags.selectPath("Branches|MyBranch");
413:                browseTags.selectPath("Tags|MyBranch_root");
414:                cvss.stop();
415:                try {
416:                    JButtonOperator btnOk = new JButtonOperator(browseTags,
417:                            "OK");
418:                    JButtonOperator btnHelp = new JButtonOperator(browseTags,
419:                            "Help");
420:                    JButtonOperator btnCancel = new JButtonOperator(browseTags,
421:                            "Cancel");
422:                    btnCancel.push();
423:                } catch (TimeoutExpiredException e) {
424:                    throw e;
425:                }
426:
427:                //browse 2.
428:                in = TestKit.getStream(getDataDir().getCanonicalFile()
429:                        .toString()
430:                        + File.separator + PROTOCOL_FOLDER,
431:                        "browse_tags_branches.in");
432:                cvss = new PseudoCvsServer(in);
433:                new Thread(cvss).start();
434:                System.setProperty("netbeans.t9y.cvs.connection.CVSROOT", cvss
435:                        .getCvsRoot());
436:
437:                mcbo.mergeUntilBranchHead();
438:                browseTags = mcbo.browseBranchHead();
439:                //Head node
440:                browseTags.selectPath("Head");
441:                //Tags node
442:                browseTags.selectPath("Tags");
443:                //Branches node
444:                browseTags.selectPath("Branches");
445:                browseTags.selectPath("Branches|MyBranch");
446:                browseTags.selectPath("Tags|MyBranch_root");
447:                cvss.stop();
448:                try {
449:                    JButtonOperator btnOk = new JButtonOperator(browseTags,
450:                            "OK");
451:                    JButtonOperator btnHelp = new JButtonOperator(browseTags,
452:                            "Help");
453:                    JButtonOperator btnCancel = new JButtonOperator(browseTags,
454:                            "Cancel");
455:                    btnCancel.push();
456:                } catch (TimeoutExpiredException e) {
457:                    throw e;
458:                }
459:
460:                //browse 3.
461:                in = TestKit.getStream(getDataDir().getCanonicalFile()
462:                        .toString()
463:                        + File.separator + PROTOCOL_FOLDER,
464:                        "browse_tags_branches.in");
465:                cvss = new PseudoCvsServer(in);
466:                new Thread(cvss).start();
467:                System.setProperty("netbeans.t9y.cvs.connection.CVSROOT", cvss
468:                        .getCvsRoot());
469:
470:                mcbo.checkTagAfterMerge(true);
471:                browseTags = mcbo.browseTagName();
472:                //Head node
473:                browseTags.selectPath("Head");
474:                //Tags node
475:                browseTags.selectPath("Tags");
476:                //Branches node
477:                browseTags.selectPath("Branches");
478:                browseTags.selectPath("Branches|MyBranch");
479:                browseTags.selectPath("Tags|MyBranch_root");
480:                cvss.stop();
481:                try {
482:                    JButtonOperator btnOk = new JButtonOperator(browseTags,
483:                            "OK");
484:                    JButtonOperator btnHelp = new JButtonOperator(browseTags,
485:                            "Help");
486:                    JButtonOperator btnCancel = new JButtonOperator(browseTags,
487:                            "Cancel");
488:                    btnCancel.push();
489:                } catch (TimeoutExpiredException e) {
490:                    throw e;
491:                }
492:                try {
493:                    JTextFieldOperator tf1 = new JTextFieldOperator(mcbo, 0);
494:                    JTextFieldOperator tf2 = new JTextFieldOperator(mcbo, 1);
495:                    JTextFieldOperator tf3 = new JTextFieldOperator(mcbo, 2);
496:                    JButtonOperator btnMerge = new JButtonOperator(mcbo,
497:                            "Merge");
498:                    JButtonOperator btnHelp = new JButtonOperator(mcbo, "Help");
499:                    JButtonOperator btnCancel = new JButtonOperator(mcbo,
500:                            "Cancel");
501:                } catch (TimeoutExpiredException ex) {
502:                    throw ex;
503:                }
504:
505:                //functionality of button
506:                //for radiobutton
507:                mcbo.mergeFromBranchingPoint();
508:                assertFalse(mcbo.txtStartingFromTag().isEnabled());
509:                assertFalse(mcbo.btBrowseStartingFromTag().isEnabled());
510:
511:                //
512:                mcbo.mergeTrunkHead();
513:                assertFalse(mcbo.txtBranchHead().isEnabled());
514:                assertFalse(mcbo.btBrowseBranchHead().isEnabled());
515:                assertFalse(mcbo.txtUntilTag().isEnabled());
516:                assertFalse(mcbo.btBrowseUntilTag().isEnabled());
517:
518:                //
519:                mcbo.mergeFromTag();
520:                assertTrue(mcbo.txtStartingFromTag().isEnabled());
521:                assertTrue(mcbo.btBrowseStartingFromTag().isEnabled());
522:
523:                //
524:                mcbo.mergeUntilBranchHead();
525:                assertTrue(mcbo.txtBranchHead().isEnabled());
526:                assertTrue(mcbo.btBrowseBranchHead().isEnabled());
527:                assertFalse(mcbo.txtUntilTag().isEnabled());
528:                assertFalse(mcbo.btBrowseUntilTag().isEnabled());
529:
530:                //
531:                mcbo.mergeUntilTag();
532:                assertFalse(mcbo.txtBranchHead().isEnabled());
533:                assertFalse(mcbo.btBrowseBranchHead().isEnabled());
534:                assertTrue(mcbo.txtUntilTag().isEnabled());
535:                assertTrue(mcbo.btBrowseUntilTag().isEnabled());
536:
537:                //
538:                mcbo.mergeUntilBranchHead();
539:                mcbo.checkTagAfterMerge(false);
540:                assertFalse(mcbo.txtTagName().isEnabled());
541:                assertFalse(mcbo.btBrowseTagName().isEnabled());
542:                //
543:                mcbo.checkTagAfterMerge(true);
544:                assertTrue(mcbo.txtTagName().isEnabled());
545:                assertTrue(mcbo.btBrowseTagName().isEnabled());
546:
547:                mcbo.cancel();
548:                System.setProperty("netbeans.t9y.cvs.connection.CVSROOT", "");
549:            }
550:
551:            public void testOnNonVersioned() throws Exception {
552:                //JemmyProperties.setCurrentTimeout("ComponentOperator.WaitComponentTimeout", 3000);
553:                //JemmyProperties.setCurrentTimeout("DialogWaiter.WaitDialogTimeout", 3000);
554:                //delete fake versioning of file
555:                //TestKit.unversionProject(file, projNonName);
556:
557:                TimeoutExpiredException tee = null;
558:                try {
559:                    Node node = new Node(new SourcePackagesNode(projectName),
560:                            "xx|NewClass.java");
561:                    BranchOperator bo = BranchOperator.invoke(node);
562:                } catch (Exception e) {
563:                    tee = (TimeoutExpiredException) e;
564:                }
565:                assertNotNull(tee);
566:                //
567:                tee = null;
568:                try {
569:                    Node node = new Node(new SourcePackagesNode(projectName),
570:                            "xx|NewClass.java");
571:                    SwitchToBranchOperator sbo = SwitchToBranchOperator
572:                            .invoke(node);
573:                } catch (Exception e) {
574:                    tee = (TimeoutExpiredException) e;
575:                }
576:                assertNotNull(tee);
577:                //
578:                tee = null;
579:                try {
580:                    Node node = new Node(new SourcePackagesNode(projectName),
581:                            "xx|NewClass.java");
582:                    MergeChangesFromBranchOperator mcbo = MergeChangesFromBranchOperator
583:                            .invoke(node);
584:                } catch (Exception e) {
585:                    tee = (TimeoutExpiredException) e;
586:                }
587:                assertNotNull(tee);
588:                System.setProperty("netbeans.t9y.cvs.connection.CVSROOT", "");
589:            }
590:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.