1 19 20 package org.netbeans.test.cvsmodule; 21 22 import java.io.File ; 23 import java.io.InputStream ; 24 import junit.textui.TestRunner; 25 import org.netbeans.jellytools.JellyTestCase; 26 import org.netbeans.jellytools.NbDialogOperator; 27 import org.netbeans.jellytools.OutputOperator; 28 import org.netbeans.jellytools.OutputTabOperator; 29 import org.netbeans.jellytools.ProjectsTabOperator; 30 import org.netbeans.jellytools.modules.javacvs.BrowseRepositoryFolderOperator; 31 import org.netbeans.jellytools.modules.javacvs.CVSRootStepOperator; 32 import org.netbeans.jellytools.modules.javacvs.EditCVSRootOperator; 33 import org.netbeans.jellytools.modules.javacvs.FolderToImportStepOperator; 34 import org.netbeans.jellytools.modules.javacvs.ImportWizardOperator; 35 import org.netbeans.jellytools.nodes.Node; 36 import org.netbeans.jemmy.JemmyProperties; 37 import org.netbeans.jemmy.TimeoutExpiredException; 38 import org.netbeans.jemmy.operators.JButtonOperator; 39 import org.netbeans.jemmy.operators.JCheckBoxOperator; 40 import org.netbeans.jemmy.operators.JComboBoxOperator; 41 import org.netbeans.jemmy.operators.JFileChooserOperator; 42 import org.netbeans.jemmy.operators.JLabelOperator; 43 import org.netbeans.jemmy.operators.JPasswordFieldOperator; 44 import org.netbeans.jemmy.operators.JProgressBarOperator; 45 import org.netbeans.jemmy.operators.JRadioButtonOperator; 46 import org.netbeans.jemmy.operators.JTextFieldOperator; 47 import org.netbeans.jemmy.operators.Operator; 48 import org.netbeans.jemmy.operators.Operator.DefaultStringComparator; 49 import org.netbeans.junit.NbTestSuite; 50 import org.netbeans.junit.ide.ProjectSupport; 51 55 public class ImportWizardTest extends JellyTestCase { 56 57 String os_name; 58 File file; 59 static String sessionCVSroot; 60 final String projectName = "ForImport"; 61 final String pathToMain = "forimport|Main.java"; 62 final String PROTOCOL_FOLDER = "protocol"; 63 Operator.DefaultStringComparator comOperator; 64 Operator.DefaultStringComparator oldOperator; 65 66 69 public static void main(String [] args) { 70 72 TestRunner.run(suite()); 73 } 74 75 public static NbTestSuite suite() { 76 77 NbTestSuite suite = new NbTestSuite(); 78 suite.addTest(new ImportWizardTest("prepareProject")); 79 suite.addTest(new ImportWizardTest("testImportWizardPserverUI")); 80 suite.addTest(new ImportWizardTest("testImportWizardLocalUI")); 81 suite.addTest(new ImportWizardTest("testImportWizardForkUI")); 82 suite.addTest(new ImportWizardTest("testImportWizardExtUI")); 83 suite.addTest(new ImportWizardTest("testImportWizardExt")); 84 suite.addTest(new ImportWizardTest("testImportWizardLocal")); 85 suite.addTest(new ImportWizardTest("testImportWizardFork")); 86 suite.addTest(new ImportWizardTest("testImportWizardPserver")); 87 suite.addTest(new ImportWizardTest("testImportWizardLoginSuccess")); 88 suite.addTest(new ImportWizardTest("testImportWizardSecondStepUI")); 89 suite.addTest(new ImportWizardTest("testImportWizardFinish")); 90 suite.addTest(new ImportWizardTest("removeAllData")); 91 94 return suite; 96 } 97 protected void setUp() throws Exception { 98 99 os_name = System.getProperty("os.name"); 100 System.out.println("### "+getName()+" ###"); 102 103 } 104 105 protected boolean isUnix() { 106 boolean unix = false; 107 if (os_name.indexOf("Windows") == -1) { 108 unix = true; 109 } 110 return unix; 111 } 112 113 114 public ImportWizardTest(String name) { 115 super(name); 116 } 117 118 public void testImportWizardPserverUI() { 119 comOperator = new Operator.DefaultStringComparator(true, true); 122 oldOperator = (DefaultStringComparator) Operator.getDefaultStringComparator(); 123 Node node = new ProjectsTabOperator().getProjectRootNode(projectName); 124 Operator.setDefaultStringComparator(comOperator); 125 ImportWizardOperator iwo = ImportWizardOperator.invoke(node); 126 Operator.setDefaultStringComparator(oldOperator); 127 128 CVSRootStepOperator crso = new CVSRootStepOperator(); 129 crso.setCVSRoot(":local:/cvs"); 130 crso.setCVSRoot(":pserver:test"); 132 try { 133 JLabelOperator inv = new JLabelOperator(crso, "Invalid CVS Root"); 134 } catch (TimeoutExpiredException e) { 135 throw e; 136 } 137 138 crso.setCVSRoot(":pserver:test@localhost:2401/cvs"); 139 141 try { 143 JComboBoxOperator combo = new JComboBoxOperator(crso); 144 JPasswordFieldOperator passwd = new JPasswordFieldOperator(crso); 145 JButtonOperator btnEdit = new JButtonOperator(crso, "Edit..."); 146 JButtonOperator btnProxy = new JButtonOperator(crso, "Proxy Configuration..."); 147 JButtonOperator btnBack = new JButtonOperator(crso, "< Back"); 148 JButtonOperator btnNext = new JButtonOperator(crso, "Next >"); 149 JButtonOperator btnFinish = new JButtonOperator(crso, "Finish"); 150 JButtonOperator btnCancel = new JButtonOperator(crso, "Cancel"); 151 JButtonOperator btnHelp = new JButtonOperator(crso, "Help"); 152 } catch (TimeoutExpiredException e) { 153 throw e; 154 } 155 iwo.cancel(); 157 } 158 159 public void testImportWizardLocalUI() { 160 comOperator = new Operator.DefaultStringComparator(true, true); 163 oldOperator = (DefaultStringComparator) Operator.getDefaultStringComparator(); 164 Node node = new ProjectsTabOperator().getProjectRootNode(projectName); 165 Operator.setDefaultStringComparator(comOperator); 166 ImportWizardOperator iwo = ImportWizardOperator.invoke(node); 167 Operator.setDefaultStringComparator(oldOperator); 168 CVSRootStepOperator crso = new CVSRootStepOperator(); 169 crso.setCVSRoot(":local:/cvs"); 170 crso.setCVSRoot(":loca:"); 172 try { 173 JLabelOperator inv = new JLabelOperator(crso, "Only :pserver:, :local:, :ext: and :fork: connection methods supported"); 174 } catch (TimeoutExpiredException e) { 175 throw e; 176 } 177 crso.setCVSRoot(":local:/cvs"); 178 Exception ex; 179 try { 182 JComboBoxOperator combo = new JComboBoxOperator(crso); 183 JButtonOperator btnEdit = new JButtonOperator(crso, "Edit..."); 185 JButtonOperator btnBack = new JButtonOperator(crso, "< Back"); 186 JButtonOperator btnNext = new JButtonOperator(crso, "Next >"); 187 JButtonOperator btnFinish = new JButtonOperator(crso, "Finish"); 188 JButtonOperator btnCancel = new JButtonOperator(crso, "Cancel"); 189 JButtonOperator btnHelp = new JButtonOperator(crso, "Help"); 190 } catch (TimeoutExpiredException e) { 191 throw e; 192 } 193 195 iwo.cancel(); 196 } 197 198 public void testImportWizardForkUI() { 199 comOperator = new Operator.DefaultStringComparator(true, true); 202 oldOperator = (DefaultStringComparator) Operator.getDefaultStringComparator(); 203 Node node = new ProjectsTabOperator().getProjectRootNode(projectName); 204 Operator.setDefaultStringComparator(comOperator); 205 ImportWizardOperator iwo = ImportWizardOperator.invoke(node); 206 Operator.setDefaultStringComparator(oldOperator); 207 CVSRootStepOperator crso = new CVSRootStepOperator(); 208 crso.setCVSRoot(":fork:/cvs"); 209 crso.setCVSRoot(":for:"); 211 try { 212 JLabelOperator inv = new JLabelOperator(crso, "Only :pserver:, :local:, :ext: and :fork: connection methods supported"); 213 assertNotNull(inv); 214 } catch (TimeoutExpiredException e) { 215 throw e; 216 } 217 218 crso.setCVSRoot(":fork:/cvs"); 219 221 try { 222 JComboBoxOperator combo = new JComboBoxOperator(crso); 223 JButtonOperator btnEdit = new JButtonOperator(crso, "Edit..."); 225 JButtonOperator btnBack = new JButtonOperator(crso, "< Back"); 226 JButtonOperator btnNext = new JButtonOperator(crso, "Next >"); 227 JButtonOperator btnFinish = new JButtonOperator(crso, "Finish"); 228 JButtonOperator btnCancel = new JButtonOperator(crso, "Cancel"); 229 JButtonOperator btnHelp = new JButtonOperator(crso, "Help"); 230 } catch (TimeoutExpiredException e) { 231 throw e; 232 } 233 235 iwo.cancel(); 236 } 237 238 public void testImportWizardExtUI() { 239 comOperator = new Operator.DefaultStringComparator(true, true); 242 oldOperator = (DefaultStringComparator) Operator.getDefaultStringComparator(); 243 Node node = new ProjectsTabOperator().getProjectRootNode(projectName); 244 Operator.setDefaultStringComparator(comOperator); 245 ImportWizardOperator iwo = ImportWizardOperator.invoke(node); 246 Operator.setDefaultStringComparator(oldOperator); 247 CVSRootStepOperator crso = new CVSRootStepOperator(); 248 crso.setCVSRoot(":ext:test@localhost:2401/cvs"); 249 crso.setCVSRoot(":ext:test"); 251 try { 252 JLabelOperator inv = new JLabelOperator(crso, "Invalid CVS Root"); 253 } catch (TimeoutExpiredException e) { 254 throw e; 255 } 256 257 crso.setCVSRoot(":ext:test@localhost:2401/cvs"); 258 try { 260 JComboBoxOperator combo = new JComboBoxOperator(crso); 261 JPasswordFieldOperator passwd = new JPasswordFieldOperator(crso); 262 JButtonOperator btnEdit = new JButtonOperator(crso, "Edit..."); 263 JButtonOperator btnProxy = new JButtonOperator(crso, "Proxy Configuration..."); 264 JRadioButtonOperator internal = new JRadioButtonOperator(crso, "Use Internal SSH"); 265 JRadioButtonOperator external = new JRadioButtonOperator(crso, "Use External Shell"); 266 JCheckBoxOperator remeber = new JCheckBoxOperator(crso, "Remember Password"); 267 JTextFieldOperator sshCommand = new JTextFieldOperator(crso); 268 JButtonOperator btnBack = new JButtonOperator(crso, "< Back"); 269 JButtonOperator btnNext = new JButtonOperator(crso, "Next >"); 270 JButtonOperator btnFinish = new JButtonOperator(crso, "Finish"); 271 JButtonOperator btnCancel = new JButtonOperator(crso, "Cancel"); 272 JButtonOperator btnHelp = new JButtonOperator(crso, "Help"); 273 } catch (TimeoutExpiredException e) { 274 throw e; 275 } 276 System.setProperty("netbeans.t9y.cvs.connection.CVSROOT", ""); 278 iwo.cancel(); 279 } 280 281 public void testImportWizardLoginSuccess() throws Exception { 282 comOperator = new Operator.DefaultStringComparator(true, true); 285 oldOperator = (DefaultStringComparator) Operator.getDefaultStringComparator(); 286 Node node = new ProjectsTabOperator().getProjectRootNode(projectName); 287 Operator.setDefaultStringComparator(comOperator); 288 ImportWizardOperator iwo = ImportWizardOperator.invoke(node); 289 Operator.setDefaultStringComparator(oldOperator); 290 final CVSRootStepOperator crso = new CVSRootStepOperator(); 291 crso.setCVSRoot(":pserver:test@localhost:/cvs"); 292 294 InputStream in = TestKit.getStream(getDataDir().getCanonicalFile().toString() + File.separator + PROTOCOL_FOLDER, "authorized.in"); 296 if (in == null) { 297 System.err.println(getClass().getProtectionDomain().getCodeSource().getLocation().toExternalForm()); 298 in.markSupported(); 299 } 300 PseudoCvsServer cvss = new PseudoCvsServer(in); 301 new Thread (cvss).start(); 302 cvss.ignoreProbe(); 303 crso.setCVSRoot(cvss.getCvsRoot()); 304 305 crso.next(); 306 307 try { 308 JProgressBarOperator progress = new JProgressBarOperator(crso); 309 JButtonOperator btnStop = new JButtonOperator(crso); 310 } catch (TimeoutExpiredException e) { 311 throw e; 312 } 313 314 FolderToImportStepOperator folderToImportOper = new FolderToImportStepOperator(); 316 cvss.stop(); 317 in.close(); 318 System.setProperty("netbeans.t9y.cvs.connection.CVSROOT", ""); 319 iwo.cancel(); 320 } 321 322 public void testImportWizardExt() { 323 comOperator = new Operator.DefaultStringComparator(true, true); 326 oldOperator = (DefaultStringComparator) Operator.getDefaultStringComparator(); 327 Node node = new ProjectsTabOperator().getProjectRootNode(projectName); 328 Operator.setDefaultStringComparator(comOperator); 329 ImportWizardOperator iwo = ImportWizardOperator.invoke(node); 330 Operator.setDefaultStringComparator(oldOperator); 331 CVSRootStepOperator crso = new CVSRootStepOperator(); 332 crso.setCVSRoot(":ext:test@localhost:2401/cvs"); 333 crso.rbUseInternalSSH().push(); 334 crso.setPassword("test"); 335 crso.cbRememberPassword().push(); 336 crso.cbRememberPassword().push(); 337 crso.rbUseExternalShell().push(); 338 crso.setSSHCommand("plink.exe -l user -i private_key.ppk"); 339 EditCVSRootOperator editOperator = crso.edit(); 340 assertEquals("Wrong access method in Edit CVSRoot dialog", "ext", editOperator.getAccessMethod()); 341 assertEquals("Wrong username Edit CVSRoot dialog", "test", editOperator.getUser()); 342 assertEquals("Wrong hostname in Edit CVSRoot dialog", "localhost", editOperator.getHost()); 343 assertEquals("Wrong port Edit CVSRoot dialog", "2401", editOperator.getPort()); 344 assertEquals("Wrong repository path Edit CVSRoot dialog", "/cvs", editOperator.getRepositoryPath()); 345 346 editOperator.selectAccessMethod(editOperator.ITEM_EXT); 348 editOperator.setRepositoryPath("/cvs/repo"); 349 editOperator.setHost("127.0.0.1"); 350 editOperator.setUser("user"); 351 editOperator.setPort("8080"); 352 editOperator.cancel(); 353 assertEquals("Values are propagated, but Cancel was push", ":ext:test@localhost:2401/cvs", crso.getCVSRoot()); 354 355 editOperator = crso.edit(); 357 editOperator.selectAccessMethod(editOperator.ITEM_EXT); 358 editOperator.setRepositoryPath("/cvs/repo"); 359 editOperator.setHost("127.0.0.1"); 360 editOperator.setUser("user"); 361 editOperator.setPort("8080"); 362 editOperator.ok(); 363 assertEquals("Values are not propagated correctly", ":ext:user@127.0.0.1:8080/cvs/repo", crso.getCVSRoot()); 364 crso.cancel(); 365 } 366 367 public void testImportWizardLocal() { 368 comOperator = new Operator.DefaultStringComparator(true, true); 371 oldOperator = (DefaultStringComparator) Operator.getDefaultStringComparator(); 372 Node node = new ProjectsTabOperator().getProjectRootNode(projectName); 373 Operator.setDefaultStringComparator(comOperator); 374 ImportWizardOperator iwo = ImportWizardOperator.invoke(node); 375 Operator.setDefaultStringComparator(oldOperator); 376 CVSRootStepOperator crso = new CVSRootStepOperator(); 377 crso.setCVSRoot(":local:/cvs"); 378 379 EditCVSRootOperator editOperator = crso.edit(); 380 assertEquals("Wrong access method in Edit CVSRoot dialog", "local", editOperator.getAccessMethod()); 381 assertEquals("Wrong repository path in Edit CVSRoot dialog", "/cvs", editOperator.getRepositoryPath()); 382 383 editOperator.setRepositoryPath("/cvs/repo"); 385 editOperator.cancel(); 386 assertEquals("Values are propagated, but Cancel was push", ":local:/cvs", crso.getCVSRoot()); 387 388 editOperator = crso.edit(); 390 editOperator.setRepositoryPath("/cvs/repo"); 391 editOperator.ok(); 392 assertEquals("Values are propagated, but Cancel was push", ":local:/cvs/repo", crso.getCVSRoot()); 393 crso.cancel(); 394 } 395 396 public void testImportWizardFork() { 397 comOperator = new Operator.DefaultStringComparator(true, true); 400 oldOperator = (DefaultStringComparator) Operator.getDefaultStringComparator(); 401 Node node = new ProjectsTabOperator().getProjectRootNode(projectName); 402 Operator.setDefaultStringComparator(comOperator); 403 ImportWizardOperator iwo = ImportWizardOperator.invoke(node); 404 Operator.setDefaultStringComparator(oldOperator); 405 CVSRootStepOperator crso = new CVSRootStepOperator(); 406 crso.setCVSRoot(":fork:/cvs"); 407 408 EditCVSRootOperator editOperator = crso.edit(); 409 assertEquals("Wrong access method in Edit CVSRoot dialog", "fork", editOperator.getAccessMethod()); 410 assertEquals("Wrong repository path in Edit CVSRoot dialog", "/cvs", editOperator.getRepositoryPath()); 411 412 editOperator.setRepositoryPath("/cvs/repo"); 414 editOperator.cancel(); 415 assertEquals("Values are propagated, but Cancel was push", ":fork:/cvs", crso.getCVSRoot()); 416 417 editOperator = crso.edit(); 419 editOperator.setRepositoryPath("/cvs/repo"); 420 editOperator.ok(); 421 assertEquals("Values are propagated, but Cancel was push", ":fork:/cvs/repo", crso.getCVSRoot()); 422 crso.cancel(); 423 } 424 425 public void testImportWizardPserver() { 426 comOperator = new Operator.DefaultStringComparator(true, true); 429 oldOperator = (DefaultStringComparator) Operator.getDefaultStringComparator(); 430 Node node = new ProjectsTabOperator().getProjectRootNode(projectName); 431 Operator.setDefaultStringComparator(comOperator); 432 ImportWizardOperator iwo = ImportWizardOperator.invoke(node); 433 Operator.setDefaultStringComparator(oldOperator); 434 CVSRootStepOperator crso = new CVSRootStepOperator(); 435 436 crso.setCVSRoot(":pserver:test@localhost:2401/cvs"); 437 crso.setPassword("test"); 438 439 EditCVSRootOperator editOperator = crso.edit(); 442 assertEquals("Wrong access method in Edit CVSRoot dialog", "pserver", editOperator.getAccessMethod()); 443 assertEquals("Wrong username Edit CVSRoot dialog", "test", editOperator.getUser()); 444 assertEquals("Wrong hostname in Edit CVSRoot dialog", "localhost", editOperator.getHost()); 445 assertEquals("Wrong port Edit CVSRoot dialog", "2401", editOperator.getPort()); 446 assertEquals("Wrong repository path Edit CVSRoot dialog", "/cvs", editOperator.getRepositoryPath()); 447 448 editOperator.selectAccessMethod(editOperator.ITEM_PSERVER); 450 editOperator.setRepositoryPath("/cvs/repo"); 451 editOperator.setHost("127.0.0.1"); 452 editOperator.setUser("user"); 453 editOperator.setPort("8080"); 454 editOperator.cancel(); 455 assertEquals("Values are propagated, but Cancel was push", ":pserver:test@localhost:2401/cvs", crso.getCVSRoot()); 456 457 editOperator = crso.edit(); 459 editOperator.selectAccessMethod(editOperator.ITEM_PSERVER); 460 editOperator.setRepositoryPath("/cvs/repo"); 461 editOperator.setHost("127.0.0.1"); 462 editOperator.setUser("user"); 463 editOperator.setPort("8080"); 464 editOperator.ok(); 465 assertEquals("Values are not propagated correctly", ":pserver:user@127.0.0.1:8080/cvs/repo", crso.getCVSRoot()); 466 crso.cancel(); 467 System.setProperty("netbeans.t9y.cvs.connection.CVSROOT", ""); 468 } 469 470 public void testImportWizardSecondStepUI() throws Exception { 471 comOperator = new Operator.DefaultStringComparator(true, true); 475 oldOperator = (DefaultStringComparator) Operator.getDefaultStringComparator(); 476 Node node = new ProjectsTabOperator().getProjectRootNode(projectName); 477 Operator.setDefaultStringComparator(comOperator); 478 ImportWizardOperator iwo = ImportWizardOperator.invoke(node); 479 Operator.setDefaultStringComparator(oldOperator); 480 final CVSRootStepOperator crso = new CVSRootStepOperator(); 481 crso.setCVSRoot(":pserver:test@localhost:/cvs"); 482 484 InputStream in = TestKit.getStream(getDataDir().getCanonicalFile().toString() + File.separator + PROTOCOL_FOLDER, "authorized.in"); 486 if (in == null) { 487 System.err.println(getClass().getProtectionDomain().getCodeSource().getLocation().toExternalForm()); 488 in.markSupported(); 489 } 490 PseudoCvsServer cvss = new PseudoCvsServer(in); 491 new Thread (cvss).start(); 492 cvss.ignoreProbe(); 493 crso.setCVSRoot(cvss.getCvsRoot()); 494 System.setProperty("netbeans.t9y.cvs.connection.CVSROOT", cvss.getCvsRoot()); 495 crso.next(); 496 497 try { 498 JProgressBarOperator progress = new JProgressBarOperator(crso); 499 JButtonOperator btnStop = new JButtonOperator(crso); 500 } catch (TimeoutExpiredException e) { 501 throw e; 502 } 503 504 506 FolderToImportStepOperator folderToImportOper = new FolderToImportStepOperator(); 507 cvss.stop(); 508 in.close(); 509 folderToImportOper.setFolderToImport(getWorkDirPath()); 510 JFileChooserOperator browseFolder = folderToImportOper.browseFolderToImport(); 511 assertEquals("Directory set in wizard not propagated to file chooser:", getWorkDir().getAbsolutePath(), browseFolder.getCurrentDirectory().getAbsolutePath()); browseFolder.cancel(); 513 folderToImportOper.setImportMessage("Import message"); 515 in = TestKit.getStream(getDataDir().getCanonicalFile().toString() + File.separator + PROTOCOL_FOLDER, "repository_browsing.in"); 516 cvss = new PseudoCvsServer(in); 517 new Thread (cvss).start(); 518 String CVSroot = cvss.getCvsRoot(); 519 System.setProperty("netbeans.t9y.cvs.connection.CVSROOT", CVSroot); 520 521 folderToImportOper.setRepositoryFolder("folder"); 522 BrowseRepositoryFolderOperator browseRepositoryOper = folderToImportOper.browseRepositoryFolder(); 523 browseRepositoryOper.selectFolder(""); browseRepositoryOper.ok(); 525 folderToImportOper.checkCheckoutAfterImport(false); 526 iwo.cancel(); 527 cvss.stop(); 528 System.setProperty("netbeans.t9y.cvs.connection.CVSROOT", ""); 529 } 530 531 public void testImportWizardFinish() throws Exception { 532 String CVSroot; 535 PseudoCvsServer cvss; 536 OutputOperator oo = OutputOperator.invoke(); 537 TestKit.unversionProject(file, projectName); 538 539 comOperator = new Operator.DefaultStringComparator(true, true); 540 oldOperator = (DefaultStringComparator) Operator.getDefaultStringComparator(); 541 Node node = new ProjectsTabOperator().getProjectRootNode(projectName); 542 Operator.setDefaultStringComparator(comOperator); 543 ImportWizardOperator iwo = ImportWizardOperator.invoke(node); 544 Operator.setDefaultStringComparator(oldOperator); 545 CVSRootStepOperator crso = new CVSRootStepOperator(); 546 JComboBoxOperator combo = new JComboBoxOperator(crso, 0); 547 crso.setCVSRoot(":pserver:test@localhost:/cvs"); 548 550 InputStream in = TestKit.getStream(getDataDir().getCanonicalFile().toString() + File.separator + PROTOCOL_FOLDER, "authorized.in"); 552 if (in == null) { 553 System.err.println(getClass().getProtectionDomain().getCodeSource().getLocation().toExternalForm()); 554 in.markSupported(); 555 } 556 cvss = new PseudoCvsServer(in); 557 new Thread (cvss).start(); 558 cvss.ignoreProbe(); 559 CVSroot = cvss.getCvsRoot(); 560 sessionCVSroot = CVSroot; 561 System.setProperty("netbeans.t9y.cvs.connection.CVSROOT", CVSroot); 562 crso.setCVSRoot(CVSroot); 563 crso.next(); 564 565 try { 566 JProgressBarOperator progress = new JProgressBarOperator(crso); 567 JButtonOperator btnStop = new JButtonOperator(crso); 568 } catch (TimeoutExpiredException e) { 569 throw e; 570 } 571 572 574 FolderToImportStepOperator folderToImportOper = new FolderToImportStepOperator(); 575 cvss.stop(); 576 in.close(); 577 folderToImportOper.setImportMessage("initial import"); 578 folderToImportOper.checkCheckoutAfterImport(false); 579 in = TestKit.getStream(getDataDir().getCanonicalFile().toString() + File.separator + PROTOCOL_FOLDER, "import_finish.in"); 580 cvss = new PseudoCvsServer(in); 581 new Thread (cvss).start(); 582 CVSroot = cvss.getCvsRoot(); 583 System.setProperty("netbeans.t9y.cvs.connection.CVSROOT", CVSroot); 584 586 folderToImportOper.finish(); 588 589 590 OutputTabOperator oto = new OutputTabOperator(sessionCVSroot); 592 oto.getTimeouts().setTimeout("ComponentOperator.WaitStateTimeout", 30000); 593 oto.waitText("Importing finished"); 594 cvss.stop(); 595 in.close(); 596 System.setProperty("netbeans.t9y.cvs.connection.CVSROOT", ""); 597 } 599 600 public void prepareProject() throws Exception { 601 TestKit.closeProject(projectName); 602 file = TestKit.prepareProject("General", "Java Application", projectName, "Main.java"); 603 } 604 605 public void removeAllData() throws Exception { 606 TestKit.closeProject(projectName); 607 System.setProperty("netbeans.t9y.cvs.connection.CVSROOT", ""); 608 } 609 } 610 | Popular Tags |