0001: /*
0002: * UpdateTest.java
0003: *
0004: * Created on July 12, 2006, 12:40 PM
0005: *
0006: * To change this template, choose Tools | Template Manager
0007: * and open the template in the editor.
0008: */
0009:
0010: package org.netbeans.test.cvsmodule;
0011:
0012: import java.io.File;
0013: import junit.textui.TestRunner;
0014: import org.netbeans.jellytools.EditorOperator;
0015: import org.netbeans.jellytools.JellyTestCase;
0016: import org.netbeans.jellytools.NbDialogOperator;
0017: import org.netbeans.jellytools.OutputOperator;
0018: import org.netbeans.jellytools.OutputTabOperator;
0019: import org.netbeans.jellytools.ProjectsTabOperator;
0020: import org.netbeans.jellytools.actions.ActionNoBlock;
0021: import org.netbeans.jellytools.modules.javacvs.CVSRootStepOperator;
0022: import org.netbeans.jellytools.modules.javacvs.CheckoutWizardOperator;
0023: import org.netbeans.jellytools.modules.javacvs.CommitOperator;
0024: import org.netbeans.jellytools.modules.javacvs.ModuleToCheckoutStepOperator;
0025: import org.netbeans.jellytools.modules.javacvs.VersioningOperator;
0026: import org.netbeans.jellytools.nodes.Node;
0027: import org.netbeans.jellytools.nodes.SourcePackagesNode;
0028: import org.netbeans.jemmy.QueueTool;
0029: import org.netbeans.jemmy.operators.JButtonOperator;
0030: import org.netbeans.jemmy.operators.JFileChooserOperator;
0031: import org.netbeans.jemmy.operators.Operator;
0032: import org.netbeans.jemmy.operators.Operator.DefaultStringComparator;
0033: import org.netbeans.junit.NbTestSuite;
0034: import org.netbeans.junit.ide.ProjectSupport;
0035:
0036: /**
0037: *
0038: * @author pvcs
0039: */
0040: public class UpdateTest extends JellyTestCase {
0041:
0042: static final String PROJECT1 = "Project1";
0043: static final String PROJECT2 = "Project2";
0044: static final String cvsRoot1 = ":pserver:test@qa-linux-s6:/usr/local/CVSrepo";
0045: static final String cvsRoot2 = ":pserver:pvcs@peterp.czech.sun.com:/usr/cvsrepo";
0046: //static final String[] nodes1 = new String[] {"aa|NewClass1.java", "aa|NewClass2.java", "aa|NewClass3.java", "aa|NewClass4.java", "aa|NewClass5.java",
0047: // "bb|NewClass1.java", "bb|NewClass2.java", "bb|NewClass3.java", "bb|NewClass4.java", "bb|NewClass5.java",
0048: // "cc|NewClass1.java", "cc|NewClass2.java", "cc|NewClass3.java", "cc|NewClass4.java", "cc|NewClass5.java"};
0049:
0050: static final String[] nodes1 = new String[] { "aa|NewClass1.java",
0051: "aa|NewClass2.java" };
0052:
0053: String os_name;
0054: static String sessionCVSroot;
0055: boolean unix = false;
0056: final String projectName = "CVS Client Library";
0057: Operator.DefaultStringComparator comOperator;
0058: Operator.DefaultStringComparator oldOperator;
0059:
0060: /** Creates a new instance of UpdateTest */
0061: public UpdateTest(String name) {
0062: super (name);
0063: }
0064:
0065: protected void setUp() throws Exception {
0066:
0067: os_name = System.getProperty("os.name");
0068: //System.out.println(os_name);
0069: System.out.println("### " + getName() + " ###");
0070:
0071: }
0072:
0073: protected boolean isUnix() {
0074: boolean unix = false;
0075: if (os_name.indexOf("Windows") == -1) {
0076: unix = true;
0077: }
0078: return unix;
0079: }
0080:
0081: public static void main(String[] args) {
0082: // TODO code application logic here
0083: TestRunner.run(suite());
0084: }
0085:
0086: public static NbTestSuite suite() {
0087: NbTestSuite suite = new NbTestSuite();
0088: //suite.addTest(new UpdateTest("testOpen"));
0089: suite.addTest(new UpdateTest("testBrokenUpdateModMer"));
0090: suite.addTest(new UpdateTest("testBrokenUpdateModConf"));
0091: suite.addTest(new UpdateTest("testBrokenUpdateModMod"));
0092: suite.addTest(new UpdateTest("testBrokenUpdateMerMer"));
0093: suite.addTest(new UpdateTest("testBrokenUpdateMerConf"));
0094: suite.addTest(new UpdateTest("testBrokenUpdateConfMer"));
0095: suite.addTest(new UpdateTest("testBrokenUpdateConfMod"));
0096: suite.addTest(new UpdateTest("testBrokenUpdateModMerMer"));
0097: suite.addTest(new UpdateTest("testBrokenUpdateModMerConf"));
0098: suite.addTest(new UpdateTest("testBrokenUpdateModConfConf"));
0099: suite.addTest(new UpdateTest("testBrokenUpdateMerModMer"));
0100: suite.addTest(new UpdateTest("testBrokenUpdateConfModConf"));
0101: suite.addTest(new UpdateTest("testBrokenUpdateConfConfMod"));
0102: suite.addTest(new UpdateTest("testBrokenUpdateMerMerMod"));
0103: return suite;
0104: }
0105:
0106: public void testOpen() throws Exception {
0107: File loc = new File("/tmp/work/w1153322002833");
0108: //TestKit.closeProject(PROJECT1);
0109: //closeProject(PROJECT2);
0110: openProject(loc, PROJECT1);
0111: }
0112:
0113: public void testUpdate() throws Exception {
0114: String cvsRoot = ":pserver:anoncvs@cvsnetbeansorg.sfbay.sun.com:/cvs";
0115: Node node;
0116: org.openide.nodes.Node nodeIDE;
0117: String color;
0118:
0119: String[] nodes = new String[] {
0120: "org.netbeans.lib.cvsclient|Bundle.properties",
0121: "org.netbeans.lib.cvsclient|CVSRoot.java",
0122: "org.netbeans.lib.cvsclient|Client.java",
0123: "org.netbeans.lib.cvsclient|ClientServices.java",
0124: "org.netbeans.lib.cvsclient.admin|AdminHandler.java",
0125: "org.netbeans.lib.cvsclient.admin|DateComparator.java",
0126: "org.netbeans.lib.cvsclient.admin|Entry.java",
0127: "org.netbeans.lib.cvsclient.admin|StandardAdminHandler.java",
0128: "org.netbeans.lib.cvsclient.command|BasicCommand.java",
0129: "org.netbeans.lib.cvsclient.command|BinaryBuilder.java",
0130: "org.netbeans.lib.cvsclient.command|BuildableCommand.java",
0131: "org.netbeans.lib.cvsclient.command|Builder.java",
0132: "org.netbeans.lib.cvsclient.command|Bundle.properties",
0133: "org.netbeans.lib.cvsclient.command|Command.java",
0134: "org.netbeans.lib.cvsclient.command|CommandAbortedException.java",
0135: "org.netbeans.lib.cvsclient.command|CommandException.java",
0136: "org.netbeans.lib.cvsclient.command|CommandUtils.java",
0137: "org.netbeans.lib.cvsclient.command|DefaultFileInfoContainer.java",
0138: "org.netbeans.lib.cvsclient.command|FileInfoContainer.java",
0139: "org.netbeans.lib.cvsclient.command|GlobalOptions.java",
0140: "org.netbeans.lib.cvsclient.command|KeywordSubstitutionOptions.java",
0141: "org.netbeans.lib.cvsclient.command|PipedFileInformation.java",
0142: "org.netbeans.lib.cvsclient.command|PipedFilesBuilder.java",
0143: "org.netbeans.lib.cvsclient.command|RepositoryCommand.java",
0144: "org.netbeans.lib.cvsclient.command|TemporaryFileCreator.java",
0145: "org.netbeans.lib.cvsclient.command|Watch.java",
0146: "org.netbeans.lib.cvsclient.command|WrapperUtils.java" };
0147: VersioningOperator vo = VersioningOperator.invoke();
0148: OutputOperator oo = OutputOperator.invoke();
0149: OutputTabOperator oto = new OutputTabOperator(cvsRoot);
0150: oto.getTimeouts().setTimeout(
0151: "ComponentOperator.WaitStateTimeout", 30000);
0152: oto.clear();
0153: node = new Node(new ProjectsTabOperator().tree(), projectName);
0154: node.performPopupAction("CVS|Show Changes");
0155: oto.waitText("Refreshing CVS Status finished");
0156: Thread.sleep(1000);
0157:
0158: assertEquals("Wrong files counts in Versioning view",
0159: nodes.length, vo.tabFiles().getRowCount());
0160: String[] actual = new String[vo.tabFiles().getRowCount()];
0161: String[] expected = new String[nodes.length];
0162: for (int i = 0; i < vo.tabFiles().getRowCount(); i++) {
0163: actual[i] = vo.tabFiles().getModel().getValueAt(i, 0)
0164: .toString();
0165: }
0166: for (int i = 0; i < nodes.length; i++) {
0167: expected[i] = getObjectName(nodes[i]);
0168: }
0169:
0170: int result = TestKit.compareThem(expected, actual, false);
0171: assertEquals("Some files disappear!!!", expected.length, result);
0172:
0173: for (int j = 0; j < 10; j++) {
0174: oto = new OutputTabOperator(cvsRoot);
0175: oto.getTimeouts().setTimeout(
0176: "ComponentOperator.WaitStateTimeout", 30000);
0177: oto.clear();
0178: node = new Node(new ProjectsTabOperator().tree(),
0179: projectName);
0180: node.performPopupAction("CVS|Update");
0181: oto.waitText("Updating \"CVS Client Library\" finished");
0182: Thread.sleep(1000);
0183: for (int i = 0; i < nodes.length; i++) {
0184: node = new Node(new SourcePackagesNode(projectName),
0185: nodes[i]);
0186: nodeIDE = (org.openide.nodes.Node) node
0187: .getOpenideNode();
0188: color = TestKit.getColor(nodeIDE.getHtmlDisplayName());
0189: assertEquals("Wrong color of <" + nodes[i] + ">",
0190: TestKit.MODIFIED_COLOR, color);
0191: }
0192: vo = VersioningOperator.invoke();
0193: actual = new String[vo.tabFiles().getRowCount()];
0194: for (int i = 0; i < vo.tabFiles().getRowCount(); i++) {
0195: actual[i] = vo.tabFiles().getModel().getValueAt(i, 0)
0196: .toString();
0197: }
0198: result = TestKit.compareThem(expected, actual, false);
0199: assertEquals("Some files disappear!!!", expected.length,
0200: result);
0201: }
0202: }
0203:
0204: String getObjectName(String value) {
0205: int pos = value.lastIndexOf('|');
0206: return value.substring(pos + 1);
0207: }
0208:
0209: /* test invokes issue #71488
0210: * if 1st file is "M" and
0211: * 2nd is merged then first one changed to up-to-date
0212: */
0213:
0214: public void testBrokenUpdateModMer() throws Exception {
0215: int j = 0;
0216: long iter1 = 1;
0217: long iter2 = 2;
0218: File location1;
0219: File location2;
0220: File work = new File("/tmp/work");
0221: work.mkdirs();
0222: TestKit.closeProject(PROJECT1);
0223: //closeProject(PROJECT2);
0224: //TestKit.deleteRecursively(work);
0225:
0226: Node node1;
0227: Node node2;
0228: org.openide.nodes.Node nodeIDE1;
0229: org.openide.nodes.Node nodeIDE2;
0230:
0231: location1 = checkOutProject(cvsRoot1, "test", PROJECT1);
0232: //location2 = checkOutProject(cvsRoot2, "pvcspvcs", PROJECT2);
0233:
0234: for (int i = 0; i < 1; i++) {
0235: editChosenFile(PROJECT1, "NewClass2.java", 5, iter1);
0236: //editFilesForMerge(PROJECT2, iter);
0237:
0238: TestKit.closeProject(PROJECT1);
0239: //closeProject(PROJECT2);
0240:
0241: checkOutProject(cvsRoot1, "test", PROJECT1);
0242: //checkOutProject(cvsRoot2, "pvcspvcs", PROJECT2);
0243:
0244: editChosenFile(PROJECT1, "NewClass2.java", 7, iter1);
0245: //editFiles(PROJECT2, iter);
0246:
0247: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
0248: //node2 = new Node(new SourcePackagesNode(PROJECT2), "");
0249: CommitOperator co = CommitOperator
0250: .invoke(new Node[] { node1 });
0251: assertEquals("Wrong count of files to commit", 1, co
0252: .tabFiles().getRowCount());
0253:
0254: OutputTabOperator oto1 = new OutputTabOperator(cvsRoot1);
0255: //OutputTabOperator oto2 = new OutputTabOperator(cvsRoot2);
0256: oto1.getTimeouts().setTimeout(
0257: "ComponentOperator.WaitStateTimeout", 30000);
0258: oto1.clear();
0259: //oto2.getTimeouts().setTimeout("ComponentOperator.WaitStateTimeout", 30000);
0260: //oto2.clear();
0261: co.commit();
0262: oto1.waitText("Committing");
0263: oto1.waitText("finished");
0264: //oto2.waitText("Committing");
0265: //oto2.waitText("finished");
0266: //delete all
0267: TestKit.closeProject(PROJECT1);
0268: //closeProject(PROJECT2);
0269: //TestKit.deleteRecursively(work);
0270:
0271: openProject(location1, PROJECT1);
0272: //openProject(location2, PROJECT2);
0273:
0274: editChosenFile(PROJECT1, "NewClass1.java", 5, iter1);
0275: //editFilesOthers(PROJECT2, iter);
0276:
0277: updateProject(PROJECT1, cvsRoot1);
0278: //updateProject(PROJECT2, cvsRoot2);
0279:
0280: Thread.sleep(1000);
0281: oto1 = new OutputTabOperator(cvsRoot1);
0282: oto1.getTimeouts().setTimeout(
0283: "ComponentOperator.WaitStateTimeout", 30000);
0284: oto1.clear();
0285: Node node = new Node(new SourcePackagesNode(PROJECT1), "");
0286: node.performPopupAction("CVS|Show Changes");
0287: oto1.waitText("Refreshing CVS Status finished");
0288:
0289: VersioningOperator vo = VersioningOperator.invoke();
0290: String[] expected = new String[] { "NewClass1.java",
0291: "NewClass2.java" };
0292: String[] actual = new String[vo.tabFiles().getRowCount()];
0293: for (int k = 0; k < actual.length; k++) {
0294: actual[k] = vo.tabFiles().getValueAt(k, 0).toString();
0295: System.out.println(actual[k]);
0296: }
0297: int result = TestKit.compareThem(expected, actual, false);
0298: assertEquals("Wrong records displayed in dialog", 2, result);
0299:
0300: //Commit
0301: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
0302: //node2 = new Node(new SourcePackagesNode(PROJECT2), "");
0303: co = CommitOperator.invoke(new Node[] { node1 });
0304: assertEquals(
0305: "Wrong count of files to commit - issue #71488", 2,
0306: co.tabFiles().getRowCount());
0307: co.cancel();
0308: /*
0309: oto1 = new OutputTabOperator(cvsRoot1);
0310: //oto2 = new OutputTabOperator(cvsRoot2);
0311: oto1.getTimeouts().setTimeout("ComponentOperator.WaitStateTimeout", 30000);
0312: oto1.clear();
0313: //oto2.getTimeouts().setTimeout("ComponentOperator.WaitStateTimeout", 30000);
0314: //oto2.clear();
0315: co.commit();
0316: oto1.waitText("Committing");
0317: oto1.waitText("finished");
0318: //oto2.waitText("Committing");
0319: //oto2.waitText("finished");
0320: //delete all
0321: TestKit.closeProject(PROJECT1);
0322: //closeProject(PROJECT2);
0323: //TestKit.deleteRecursively(work);
0324:
0325: //check out again
0326: location1 = checkOutProject(cvsRoot1, "test", PROJECT1);
0327: //location2 = checkOutProject(cvsRoot2, "pvcspvcs", PROJECT2);
0328:
0329: //validate data
0330: validateCheckout(PROJECT1, iter, new int[] {1, 6});
0331: //validateCheckout(PROJECT2, iter, new int[] {1, 6});
0332: */
0333: }
0334: }
0335:
0336: public void testBrokenUpdateModConf() throws Exception {
0337: int j = 0;
0338: long iter1 = 1;
0339: long iter2 = 2;
0340: File location1;
0341: File location2;
0342: File work = new File("/tmp/work");
0343: work.mkdirs();
0344: TestKit.closeProject(PROJECT1);
0345:
0346: Node node1;
0347: org.openide.nodes.Node nodeIDE1;
0348:
0349: location1 = checkOutProject(cvsRoot1, "test", PROJECT1);
0350:
0351: iter1 = System.currentTimeMillis();
0352: //change last file from last package
0353: editChosenFile(PROJECT1, "NewClass3.java", 5, iter1);
0354:
0355: TestKit.closeProject(PROJECT1);
0356:
0357: checkOutProject(cvsRoot1, "test", PROJECT1);
0358:
0359: iter2 = System.currentTimeMillis();
0360: editChosenFile(PROJECT1, "NewClass3.java", 5, iter2);
0361:
0362: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
0363: CommitOperator co = CommitOperator.invoke(new Node[] { node1 });
0364: assertEquals("Wrong count of files to commit", 1, co.tabFiles()
0365: .getRowCount());
0366:
0367: OutputTabOperator oto1 = new OutputTabOperator(cvsRoot1);
0368: //OutputTabOperator oto2 = new OutputTabOperator(cvsRoot2);
0369: oto1.getTimeouts().setTimeout(
0370: "ComponentOperator.WaitStateTimeout", 30000);
0371: oto1.clear();
0372:
0373: co.commit();
0374: oto1.waitText("Committing");
0375: oto1.waitText("finished");
0376:
0377: TestKit.closeProject(PROJECT1);
0378:
0379: openProject(location1, PROJECT1);
0380:
0381: editChosenFile(PROJECT1, "NewClass1.java", 5, iter1);
0382:
0383: updateProject(PROJECT1, cvsRoot1);
0384:
0385: NbDialogOperator nbDialog = new NbDialogOperator("Warning");
0386: JButtonOperator btnOk = new JButtonOperator(nbDialog);
0387: btnOk.push();
0388:
0389: Thread.sleep(1000);
0390: oto1 = new OutputTabOperator(cvsRoot1);
0391: oto1.getTimeouts().setTimeout(
0392: "ComponentOperator.WaitStateTimeout", 30000);
0393: oto1.clear();
0394: Node node = new Node(new SourcePackagesNode(PROJECT1), "");
0395: node.performPopupAction("CVS|Show Changes");
0396: oto1.waitText("Refreshing CVS Status finished");
0397: nbDialog = new NbDialogOperator("Command");
0398: btnOk = new JButtonOperator(nbDialog);
0399: btnOk.push();
0400:
0401: VersioningOperator vo = VersioningOperator.invoke();
0402: String[] expected = new String[] { "NewClass1.java",
0403: "NewClass3.java" };
0404: String[] actual = new String[vo.tabFiles().getRowCount()];
0405: for (int k = 0; k < actual.length; k++) {
0406: actual[k] = vo.tabFiles().getValueAt(k, 0).toString();
0407: }
0408: int result = TestKit.compareThem(expected, actual, false);
0409: assertEquals("Wrong records displayed in dialog", 2, result);
0410:
0411: expected = new String[] { "Locally Modified", "Local Conflict" };
0412: actual = new String[vo.tabFiles().getRowCount()];
0413: for (int k = 0; k < actual.length; k++) {
0414: actual[k] = vo.tabFiles().getValueAt(k, 1).toString();
0415: }
0416: result = TestKit.compareThem(expected, actual, false);
0417: assertEquals("Wrong records displayed in dialog", 2, result);
0418:
0419: //Commit
0420: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
0421:
0422: co = CommitOperator.invoke(new Node[] { node1 });
0423: assertEquals("Wrong count of files to commit - issue #71488",
0424: 2, co.tabFiles().getRowCount());
0425: co.cancel();
0426: }
0427:
0428: public void testBrokenUpdateModMod() throws Exception {
0429: int j = 0;
0430: long iter;
0431: File location1;
0432: File location2;
0433: File work = new File("/tmp/work");
0434: work.mkdirs();
0435: TestKit.closeProject(PROJECT1);
0436: //closeProject(PROJECT2);
0437: //TestKit.deleteRecursively(work);
0438:
0439: Node node1;
0440: org.openide.nodes.Node nodeIDE1;
0441:
0442: location1 = checkOutProject(cvsRoot1, "test", PROJECT1);
0443:
0444: iter = System.currentTimeMillis();
0445:
0446: editChosenFile(PROJECT1, "NewClass1.java", 5, iter);
0447: editChosenFile(PROJECT1, "NewClass2.java", 5, iter);
0448:
0449: updateProject(PROJECT1, cvsRoot1);
0450:
0451: Thread.sleep(1000);
0452: OutputTabOperator oto1 = new OutputTabOperator(cvsRoot1);
0453: oto1.getTimeouts().setTimeout(
0454: "ComponentOperator.WaitStateTimeout", 30000);
0455: oto1.clear();
0456: Node node = new Node(new SourcePackagesNode(PROJECT1), "");
0457: node.performPopupAction("CVS|Show Changes");
0458: oto1.waitText("Refreshing CVS Status finished");
0459:
0460: VersioningOperator vo = VersioningOperator.invoke();
0461: String[] expected = new String[] { "NewClass1.java",
0462: "NewClass2.java" };
0463: String[] actual = new String[vo.tabFiles().getRowCount()];
0464: for (int k = 0; k < actual.length; k++) {
0465: actual[k] = vo.tabFiles().getValueAt(k, 0).toString();
0466: }
0467: int result = TestKit.compareThem(expected, actual, false);
0468: assertEquals("Wrong records displayed in dialog", 2, result);
0469:
0470: expected = new String[] { "Locally Modified",
0471: "Locally Modified" };
0472: actual = new String[vo.tabFiles().getRowCount()];
0473: for (int k = 0; k < actual.length; k++) {
0474: actual[k] = vo.tabFiles().getValueAt(k, 1).toString();
0475: }
0476: result = TestKit.compareThem(expected, actual, false);
0477: assertEquals("Wrong records displayed in dialog", 2, result);
0478:
0479: //Commit
0480: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
0481: CommitOperator co = CommitOperator.invoke(new Node[] { node1 });
0482: assertEquals("Wrong count of files to commit - issue #71488",
0483: 2, co.tabFiles().getRowCount());
0484: co.cancel();
0485: }
0486:
0487: public void testBrokenUpdateMerMer() throws Exception {
0488: int j = 0;
0489: long iter1 = 1;
0490: long iter2 = 2;
0491: File location1;
0492: File location2;
0493: File work = new File("/tmp/work");
0494: work.mkdirs();
0495: TestKit.closeProject(PROJECT1);
0496:
0497: Node node1;
0498: org.openide.nodes.Node nodeIDE1;
0499:
0500: location1 = checkOutProject(cvsRoot1, "test", PROJECT1);
0501:
0502: editChosenFile(PROJECT1, "NewClass1.java", 3, iter1);
0503: editChosenFile(PROJECT1, "NewClass2.java", 3, iter1);
0504: TestKit.closeProject(PROJECT1);
0505:
0506: checkOutProject(cvsRoot1, "test", PROJECT1);
0507:
0508: editChosenFile(PROJECT1, "NewClass1.java", 5, iter2);
0509: editChosenFile(PROJECT1, "NewClass2.java", 5, iter2);
0510:
0511: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
0512: CommitOperator co = CommitOperator.invoke(new Node[] { node1 });
0513: assertEquals("Wrong count of files to commit", 2, co.tabFiles()
0514: .getRowCount());
0515:
0516: OutputTabOperator oto1 = new OutputTabOperator(cvsRoot1);
0517: oto1.getTimeouts().setTimeout(
0518: "ComponentOperator.WaitStateTimeout", 30000);
0519: oto1.clear();
0520: co.commit();
0521: oto1.waitText("Committing");
0522: oto1.waitText("finished");
0523:
0524: TestKit.closeProject(PROJECT1);
0525:
0526: openProject(location1, PROJECT1);
0527:
0528: updateProject(PROJECT1, cvsRoot1);
0529:
0530: Thread.sleep(1000);
0531: oto1 = new OutputTabOperator(cvsRoot1);
0532: oto1.getTimeouts().setTimeout(
0533: "ComponentOperator.WaitStateTimeout", 30000);
0534: oto1.clear();
0535: Node node = new Node(new SourcePackagesNode(PROJECT1), "");
0536: node.performPopupAction("CVS|Show Changes");
0537: oto1.waitText("Refreshing CVS Status finished");
0538:
0539: VersioningOperator vo = VersioningOperator.invoke();
0540: String[] expected = new String[] { "NewClass1.java",
0541: "NewClass2.java" };
0542: String[] actual = new String[vo.tabFiles().getRowCount()];
0543: for (int k = 0; k < actual.length; k++) {
0544: actual[k] = vo.tabFiles().getValueAt(k, 0).toString();
0545: System.out.println(actual[k]);
0546: }
0547: int result = TestKit.compareThem(expected, actual, false);
0548: assertEquals("Wrong records displayed in dialog", 2, result);
0549:
0550: expected = new String[] { "Locally Modified",
0551: "Locally Modified" };
0552: actual = new String[vo.tabFiles().getRowCount()];
0553: for (int k = 0; k < actual.length; k++) {
0554: actual[k] = vo.tabFiles().getValueAt(k, 1).toString();
0555: }
0556: result = TestKit.compareThem(expected, actual, false);
0557: assertEquals("Wrong records displayed in dialog", 2, result);
0558:
0559: //Commit
0560: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
0561: co = CommitOperator.invoke(new Node[] { node1 });
0562: assertEquals("Wrong count of files to commit - issue #71488",
0563: 2, co.tabFiles().getRowCount());
0564: co.cancel();
0565: }
0566:
0567: public void testBrokenUpdateConfConf() throws Exception {
0568: int j = 0;
0569: long iter1 = 1;
0570: long iter2 = 2;
0571: File location1;
0572: File work = new File("/tmp/work");
0573: work.mkdirs();
0574: TestKit.closeProject(PROJECT1);
0575:
0576: Node node1;
0577: org.openide.nodes.Node nodeIDE1;
0578:
0579: location1 = checkOutProject(cvsRoot1, "test", PROJECT1);
0580:
0581: iter1 = System.currentTimeMillis();
0582: //change last file from last package
0583: editChosenFile(PROJECT1, "NewClass1.java", 5, iter1);
0584: editChosenFile(PROJECT1, "NewClass2.java", 5, iter1);
0585:
0586: TestKit.closeProject(PROJECT1);
0587:
0588: checkOutProject(cvsRoot1, "test", PROJECT1);
0589:
0590: iter2 = System.currentTimeMillis();
0591: editChosenFile(PROJECT1, "NewClass1.java", 5, iter1);
0592: editChosenFile(PROJECT1, "NewClass2.java", 5, iter1);
0593:
0594: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
0595: CommitOperator co = CommitOperator.invoke(new Node[] { node1 });
0596: assertEquals("Wrong count of files to commit", 2, co.tabFiles()
0597: .getRowCount());
0598:
0599: OutputTabOperator oto1 = new OutputTabOperator(cvsRoot1);
0600: oto1.getTimeouts().setTimeout(
0601: "ComponentOperator.WaitStateTimeout", 30000);
0602: oto1.clear();
0603: co.commit();
0604: oto1.waitText("Committing");
0605: oto1.waitText("finished");
0606: TestKit.closeProject(PROJECT1);
0607:
0608: openProject(location1, PROJECT1);
0609:
0610: updateProject(PROJECT1, cvsRoot1);
0611:
0612: NbDialogOperator nbDialog = new NbDialogOperator("Warning");
0613: JButtonOperator btnOk = new JButtonOperator(nbDialog);
0614: btnOk.push();
0615:
0616: Thread.sleep(1000);
0617: oto1 = new OutputTabOperator(cvsRoot1);
0618: oto1.getTimeouts().setTimeout(
0619: "ComponentOperator.WaitStateTimeout", 30000);
0620: oto1.clear();
0621:
0622: Node node = new Node(new SourcePackagesNode(PROJECT1), "");
0623: node.performPopupAction("CVS|Show Changes");
0624: oto1.waitText("Refreshing CVS Status finished");
0625: nbDialog = new NbDialogOperator("Command");
0626: btnOk = new JButtonOperator(nbDialog);
0627: btnOk.push();
0628:
0629: VersioningOperator vo = VersioningOperator.invoke();
0630: String[] expected = new String[] { "NewClass1.java",
0631: "NewClass2.java" };
0632: String[] actual = new String[vo.tabFiles().getRowCount()];
0633: for (int k = 0; k < actual.length; k++) {
0634: actual[k] = vo.tabFiles().getValueAt(k, 0).toString();
0635: System.out.println(actual[k]);
0636: }
0637: int result = TestKit.compareThem(expected, actual, false);
0638: assertEquals("Wrong records displayed in dialog", 2, result);
0639:
0640: expected = new String[] { "Local Conflict", "Local Conflict" };
0641: actual = new String[vo.tabFiles().getRowCount()];
0642: for (int k = 0; k < actual.length; k++) {
0643: actual[k] = vo.tabFiles().getValueAt(k, 1).toString();
0644: }
0645: result = TestKit.compareThem(expected, actual, false);
0646: assertEquals("Wrong records displayed in dialog", 2, result);
0647:
0648: //Commit
0649: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
0650: co = CommitOperator.invoke(new Node[] { node1 });
0651: assertEquals("Wrong count of files to commit - issue #71488",
0652: 2, co.tabFiles().getRowCount());
0653: co.cancel();
0654: }
0655:
0656: public void testBrokenUpdateMerConf() throws Exception {
0657: int j = 0;
0658: long iter1 = 1;
0659: long iter2 = 2;
0660: File location1;
0661: File location2;
0662: File work = new File("/tmp/work");
0663: work.mkdirs();
0664: TestKit.closeProject(PROJECT1);
0665:
0666: Node node1;
0667: org.openide.nodes.Node nodeIDE1;
0668:
0669: location1 = checkOutProject(cvsRoot1, "test", PROJECT1);
0670:
0671: iter1 = System.currentTimeMillis();
0672: editChosenFile(PROJECT1, "NewClass1.java", 5, iter1);
0673: editChosenFile(PROJECT1, "NewClass2.java", 5, iter1);
0674:
0675: TestKit.closeProject(PROJECT1);
0676:
0677: checkOutProject(cvsRoot1, "test", PROJECT1);
0678: iter2 = System.currentTimeMillis();
0679: editChosenFile(PROJECT1, "NewClass1.java", 2, iter2);
0680: editChosenFile(PROJECT1, "NewClass2.java", 5, iter2);
0681: //editFiles(PROJECT2, iter);
0682:
0683: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
0684: CommitOperator co = CommitOperator.invoke(new Node[] { node1 });
0685: assertEquals("Wrong count of files to commit", 2, co.tabFiles()
0686: .getRowCount());
0687:
0688: OutputTabOperator oto1 = new OutputTabOperator(cvsRoot1);
0689: oto1.getTimeouts().setTimeout(
0690: "ComponentOperator.WaitStateTimeout", 30000);
0691: oto1.clear();
0692: co.commit();
0693: oto1.waitText("Committing");
0694: oto1.waitText("finished");
0695: TestKit.closeProject(PROJECT1);
0696:
0697: openProject(location1, PROJECT1);
0698: updateProject(PROJECT1, cvsRoot1);
0699:
0700: NbDialogOperator nbDialog = new NbDialogOperator("Warning");
0701: JButtonOperator btnOk = new JButtonOperator(nbDialog);
0702: btnOk.push();
0703:
0704: Thread.sleep(1000);
0705: oto1 = new OutputTabOperator(cvsRoot1);
0706: oto1.getTimeouts().setTimeout(
0707: "ComponentOperator.WaitStateTimeout", 30000);
0708: oto1.clear();
0709:
0710: Node node = new Node(new SourcePackagesNode(PROJECT1), "");
0711: node.performPopupAction("CVS|Show Changes");
0712: oto1.waitText("Refreshing CVS Status finished");
0713: nbDialog = new NbDialogOperator("Command");
0714: btnOk = new JButtonOperator(nbDialog);
0715: btnOk.push();
0716:
0717: VersioningOperator vo = VersioningOperator.invoke();
0718: String[] expected = new String[] { "NewClass1.java",
0719: "NewClass2.java" };
0720: String[] actual = new String[vo.tabFiles().getRowCount()];
0721: for (int k = 0; k < actual.length; k++) {
0722: actual[k] = vo.tabFiles().getValueAt(k, 0).toString();
0723: }
0724: int result = TestKit.compareThem(expected, actual, false);
0725: assertEquals("Wrong records displayed in dialog", 2, result);
0726:
0727: expected = new String[] { "Locally Modified", "Local Conflict" };
0728: actual = new String[vo.tabFiles().getRowCount()];
0729: for (int k = 0; k < actual.length; k++) {
0730: actual[k] = vo.tabFiles().getValueAt(k, 1).toString();
0731: }
0732: result = TestKit.compareThem(expected, actual, false);
0733: assertEquals("Wrong records displayed in dialog", 2, result);
0734:
0735: //Commit
0736: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
0737: co = CommitOperator.invoke(new Node[] { node1 });
0738: assertEquals("Wrong count of files to commit - issue #71488",
0739: 2, co.tabFiles().getRowCount());
0740: co.cancel();
0741: }
0742:
0743: public void testBrokenUpdateConfMer() throws Exception {
0744: int j = 0;
0745: long iter1 = 1;
0746: long iter2 = 2;
0747: File location1;
0748: File location2;
0749: File work = new File("/tmp/work");
0750: work.mkdirs();
0751: TestKit.closeProject(PROJECT1);
0752:
0753: Node node1;
0754: org.openide.nodes.Node nodeIDE1;
0755:
0756: location1 = checkOutProject(cvsRoot1, "test", PROJECT1);
0757: iter1 = System.currentTimeMillis();
0758: //change last file from last package
0759: editChosenFile(PROJECT1, "NewClass1.java", 5, iter1);
0760: editChosenFile(PROJECT1, "NewClass2.java", 5, iter1);
0761: TestKit.closeProject(PROJECT1);
0762:
0763: checkOutProject(cvsRoot1, "test", PROJECT1);
0764: iter2 = System.currentTimeMillis();
0765: editChosenFile(PROJECT1, "NewClass1.java", 5, iter2);
0766: editChosenFile(PROJECT1, "NewClass2.java", 2, iter2);
0767:
0768: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
0769: CommitOperator co = CommitOperator.invoke(new Node[] { node1 });
0770: assertEquals("Wrong count of files to commit", 2, co.tabFiles()
0771: .getRowCount());
0772:
0773: OutputTabOperator oto1 = new OutputTabOperator(cvsRoot1);
0774: oto1.getTimeouts().setTimeout(
0775: "ComponentOperator.WaitStateTimeout", 30000);
0776: oto1.clear();
0777: co.commit();
0778: oto1.waitText("Committing");
0779: oto1.waitText("finished");
0780:
0781: TestKit.closeProject(PROJECT1);
0782:
0783: openProject(location1, PROJECT1);
0784:
0785: updateProject(PROJECT1, cvsRoot1);
0786:
0787: NbDialogOperator nbDialog = new NbDialogOperator("Warning");
0788: JButtonOperator btnOk = new JButtonOperator(nbDialog);
0789: btnOk.push();
0790:
0791: Thread.sleep(1000);
0792: oto1 = new OutputTabOperator(cvsRoot1);
0793: oto1.getTimeouts().setTimeout(
0794: "ComponentOperator.WaitStateTimeout", 30000);
0795: oto1.clear();
0796:
0797: Node node = new Node(new SourcePackagesNode(PROJECT1), "");
0798: node.performPopupAction("CVS|Show Changes");
0799: oto1.waitText("Refreshing CVS Status finished");
0800: nbDialog = new NbDialogOperator("Command");
0801: btnOk = new JButtonOperator(nbDialog);
0802: btnOk.push();
0803:
0804: VersioningOperator vo = VersioningOperator.invoke();
0805: String[] expected = new String[] { "NewClass1.java",
0806: "NewClass2.java" };
0807: String[] actual = new String[vo.tabFiles().getRowCount()];
0808: for (int k = 0; k < actual.length; k++) {
0809: actual[k] = vo.tabFiles().getValueAt(k, 0).toString();
0810: }
0811: int result = TestKit.compareThem(expected, actual, false);
0812: assertEquals("Wrong records displayed in dialog", 2, result);
0813:
0814: expected = new String[] { "Local Conflict", "Locally Modified" };
0815: actual = new String[vo.tabFiles().getRowCount()];
0816: for (int k = 0; k < actual.length; k++) {
0817: actual[k] = vo.tabFiles().getValueAt(k, 1).toString();
0818: }
0819: result = TestKit.compareThem(expected, actual, false);
0820: assertEquals("Wrong records displayed in dialog", 2, result);
0821:
0822: //Commit
0823: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
0824: co = CommitOperator.invoke(new Node[] { node1 });
0825: assertEquals("Wrong count of files to commit - issue #71488",
0826: 2, co.tabFiles().getRowCount());
0827: co.cancel();
0828: }
0829:
0830: public void testBrokenUpdateConfMod() throws Exception {
0831: int j = 0;
0832: long iter1 = 1;
0833: long iter2 = 2;
0834: File location1;
0835: File location2;
0836: File work = new File("/tmp/work");
0837: work.mkdirs();
0838: TestKit.closeProject(PROJECT1);
0839:
0840: Node node1;
0841: org.openide.nodes.Node nodeIDE1;
0842:
0843: location1 = checkOutProject(cvsRoot1, "test", PROJECT1);
0844:
0845: iter1 = System.currentTimeMillis();
0846:
0847: editChosenFile(PROJECT1, "NewClass1.java", 5, iter1);
0848:
0849: TestKit.closeProject(PROJECT1);
0850:
0851: checkOutProject(cvsRoot1, "test", PROJECT1);
0852:
0853: iter2 = System.currentTimeMillis();
0854: editChosenFile(PROJECT1, "NewClass1.java", 5, iter2);
0855:
0856: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
0857: CommitOperator co = CommitOperator.invoke(new Node[] { node1 });
0858: assertEquals("Wrong count of files to commit", 1, co.tabFiles()
0859: .getRowCount());
0860:
0861: OutputTabOperator oto1 = new OutputTabOperator(cvsRoot1);
0862: oto1.getTimeouts().setTimeout(
0863: "ComponentOperator.WaitStateTimeout", 30000);
0864: oto1.clear();
0865: co.commit();
0866: oto1.waitText("Committing");
0867: oto1.waitText("finished");
0868: TestKit.closeProject(PROJECT1);
0869:
0870: openProject(location1, PROJECT1);
0871: editChosenFile(PROJECT1, "NewClass2.java", 5, iter1);
0872:
0873: updateProject(PROJECT1, cvsRoot1);
0874:
0875: NbDialogOperator nbDialog = new NbDialogOperator("Warning");
0876: JButtonOperator btnOk = new JButtonOperator(nbDialog);
0877: btnOk.push();
0878:
0879: Thread.sleep(1000);
0880: oto1 = new OutputTabOperator(cvsRoot1);
0881: oto1.getTimeouts().setTimeout(
0882: "ComponentOperator.WaitStateTimeout", 30000);
0883: oto1.clear();
0884:
0885: Node node = new Node(new SourcePackagesNode(PROJECT1), "");
0886: node.performPopupAction("CVS|Show Changes");
0887: oto1.waitText("Refreshing CVS Status finished");
0888: nbDialog = new NbDialogOperator("Command");
0889: btnOk = new JButtonOperator(nbDialog);
0890: btnOk.push();
0891:
0892: VersioningOperator vo = VersioningOperator.invoke();
0893: String[] expected = new String[] { "NewClass1.java",
0894: "NewClass2.java" };
0895: String[] actual = new String[vo.tabFiles().getRowCount()];
0896: for (int k = 0; k < actual.length; k++) {
0897: actual[k] = vo.tabFiles().getValueAt(k, 0).toString();
0898: }
0899: int result = TestKit.compareThem(expected, actual, false);
0900: assertEquals("Wrong records displayed in dialog", 2, result);
0901:
0902: expected = new String[] { "Local Conflict", "Locally Modified" };
0903: actual = new String[vo.tabFiles().getRowCount()];
0904: for (int k = 0; k < actual.length; k++) {
0905: actual[k] = vo.tabFiles().getValueAt(k, 1).toString();
0906: }
0907: result = TestKit.compareThem(expected, actual, false);
0908: assertEquals("Wrong records displayed in dialog", 2, result);
0909:
0910: //Commit
0911: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
0912: co = CommitOperator.invoke(new Node[] { node1 });
0913: assertEquals("Wrong count of files to commit - issue #71488",
0914: 2, co.tabFiles().getRowCount());
0915: co.cancel();
0916: }
0917:
0918: public void testBrokenUpdateModMerMer() throws Exception {
0919: int j = 0;
0920: long iter1 = 1;
0921: long iter2 = 2;
0922: File location1;
0923: File work = new File("/tmp/work");
0924: work.mkdirs();
0925: TestKit.closeProject(PROJECT1);
0926:
0927: Node node1;
0928: org.openide.nodes.Node nodeIDE1;
0929:
0930: location1 = checkOutProject(cvsRoot1, "test", PROJECT1);
0931: iter1 = System.currentTimeMillis();
0932:
0933: editChosenFile(PROJECT1, "NewClass2.java", 5, iter1);
0934: editChosenFile(PROJECT1, "NewClass3.java", 5, iter1);
0935:
0936: TestKit.closeProject(PROJECT1);
0937:
0938: checkOutProject(cvsRoot1, "test", PROJECT1);
0939: iter2 = System.currentTimeMillis();
0940: editChosenFile(PROJECT1, "NewClass2.java", 3, iter2);
0941: editChosenFile(PROJECT1, "NewClass3.java", 3, iter2);
0942:
0943: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
0944: CommitOperator co = CommitOperator.invoke(new Node[] { node1 });
0945: assertEquals("Wrong count of files to commit", 2, co.tabFiles()
0946: .getRowCount());
0947:
0948: OutputTabOperator oto1 = new OutputTabOperator(cvsRoot1);
0949: oto1.getTimeouts().setTimeout(
0950: "ComponentOperator.WaitStateTimeout", 30000);
0951: oto1.clear();
0952: co.commit();
0953: oto1.waitText("Committing");
0954: oto1.waitText("finished");
0955: TestKit.closeProject(PROJECT1);
0956:
0957: openProject(location1, PROJECT1);
0958:
0959: editChosenFile(PROJECT1, "NewClass1.java", 7, iter1);
0960:
0961: updateProject(PROJECT1, cvsRoot1);
0962:
0963: Thread.sleep(1000);
0964: oto1 = new OutputTabOperator(cvsRoot1);
0965: oto1.getTimeouts().setTimeout(
0966: "ComponentOperator.WaitStateTimeout", 30000);
0967: oto1.clear();
0968:
0969: Node node = new Node(new SourcePackagesNode(PROJECT1), "");
0970: node.performPopupAction("CVS|Show Changes");
0971: oto1.waitText("Refreshing CVS Status finished");
0972:
0973: VersioningOperator vo = VersioningOperator.invoke();
0974: String[] expected = new String[] { "NewClass1.java",
0975: "NewClass2.java", "NewClass3.java" };
0976: String[] actual = new String[vo.tabFiles().getRowCount()];
0977: for (int k = 0; k < actual.length; k++) {
0978: actual[k] = vo.tabFiles().getValueAt(k, 0).toString();
0979: }
0980: int result = TestKit.compareThem(expected, actual, false);
0981: assertEquals("Wrong records displayed in dialog", 3, result);
0982:
0983: expected = new String[] { "Locally Modified",
0984: "Locally Modified", "Locally Modified" };
0985: actual = new String[vo.tabFiles().getRowCount()];
0986: for (int k = 0; k < actual.length; k++) {
0987: actual[k] = vo.tabFiles().getValueAt(k, 1).toString();
0988: }
0989: result = TestKit.compareThem(expected, actual, false);
0990: assertEquals("Wrong records displayed in dialog", 3, result);
0991:
0992: //Commit
0993: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
0994: co = CommitOperator.invoke(new Node[] { node1 });
0995: assertEquals("Wrong count of files to commit - issue #71488",
0996: 3, co.tabFiles().getRowCount());
0997: co.cancel();
0998: }
0999:
1000: public void testBrokenUpdateModMerConf() throws Exception {
1001: int j = 0;
1002: long iter1 = 1;
1003: long iter2 = 2;
1004: File location1;
1005: File work = new File("/tmp/work");
1006: work.mkdirs();
1007: TestKit.closeProject(PROJECT1);
1008:
1009: Node node1;
1010: org.openide.nodes.Node nodeIDE1;
1011:
1012: location1 = checkOutProject(cvsRoot1, "test", PROJECT1);
1013:
1014: iter1 = System.currentTimeMillis();
1015: editChosenFile(PROJECT1, "NewClass2.java", 5, iter1);
1016: editChosenFile(PROJECT1, "NewClass3.java", 5, iter1);
1017: TestKit.closeProject(PROJECT1);
1018:
1019: checkOutProject(cvsRoot1, "test", PROJECT1);
1020: iter2 = System.currentTimeMillis();
1021: editChosenFile(PROJECT1, "NewClass2.java", 3, iter2);
1022: editChosenFile(PROJECT1, "NewClass3.java", 5, iter2);
1023:
1024: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
1025: CommitOperator co = CommitOperator.invoke(new Node[] { node1 });
1026: assertEquals("Wrong count of files to commit", 2, co.tabFiles()
1027: .getRowCount());
1028:
1029: OutputTabOperator oto1 = new OutputTabOperator(cvsRoot1);
1030: oto1.getTimeouts().setTimeout(
1031: "ComponentOperator.WaitStateTimeout", 30000);
1032: oto1.clear();
1033: co.commit();
1034: oto1.waitText("Committing");
1035: oto1.waitText("finished");
1036:
1037: TestKit.closeProject(PROJECT1);
1038:
1039: openProject(location1, PROJECT1);
1040:
1041: editChosenFile(PROJECT1, "NewClass1.java", 7, iter1);
1042:
1043: updateProject(PROJECT1, cvsRoot1);
1044:
1045: NbDialogOperator nbDialog = new NbDialogOperator("Warning");
1046: JButtonOperator btnOk = new JButtonOperator(nbDialog);
1047: btnOk.push();
1048:
1049: Thread.sleep(1000);
1050: oto1 = new OutputTabOperator(cvsRoot1);
1051: oto1.getTimeouts().setTimeout(
1052: "ComponentOperator.WaitStateTimeout", 30000);
1053: oto1.clear();
1054:
1055: Node node = new Node(new SourcePackagesNode(PROJECT1), "");
1056: node.performPopupAction("CVS|Show Changes");
1057: oto1.waitText("Refreshing CVS Status finished");
1058: nbDialog = new NbDialogOperator("Command");
1059: btnOk = new JButtonOperator(nbDialog);
1060: btnOk.push();
1061:
1062: VersioningOperator vo = VersioningOperator.invoke();
1063: String[] expected = new String[] { "NewClass1.java",
1064: "NewClass2.java", "NewClass3.java" };
1065: String[] actual = new String[vo.tabFiles().getRowCount()];
1066: for (int k = 0; k < actual.length; k++) {
1067: actual[k] = vo.tabFiles().getValueAt(k, 0).toString();
1068: }
1069: int result = TestKit.compareThem(expected, actual, false);
1070: assertEquals("Wrong records displayed in dialog", 3, result);
1071:
1072: expected = new String[] { "Locally Modified",
1073: "Locally Modified", "Local Conflict" };
1074: actual = new String[vo.tabFiles().getRowCount()];
1075: for (int k = 0; k < actual.length; k++) {
1076: actual[k] = vo.tabFiles().getValueAt(k, 1).toString();
1077: }
1078: result = TestKit.compareThem(expected, actual, false);
1079: assertEquals("Wrong records displayed in dialog", 3, result);
1080:
1081: //Commit
1082: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
1083: co = CommitOperator.invoke(new Node[] { node1 });
1084: assertEquals("Wrong count of files to commit - issue #71488",
1085: 3, co.tabFiles().getRowCount());
1086: co.cancel();
1087: }
1088:
1089: public void testBrokenUpdateModConfConf() throws Exception {
1090: int j = 0;
1091: long iter1 = 1;
1092: long iter2 = 2;
1093: File location1;
1094: File work = new File("/tmp/work");
1095: work.mkdirs();
1096: TestKit.closeProject(PROJECT1);
1097:
1098: Node node1;
1099: Node node2;
1100: org.openide.nodes.Node nodeIDE1;
1101: org.openide.nodes.Node nodeIDE2;
1102:
1103: location1 = checkOutProject(cvsRoot1, "test", PROJECT1);
1104:
1105: iter1 = System.currentTimeMillis();
1106: editChosenFile(PROJECT1, "NewClass2.java", 5, iter1);
1107: editChosenFile(PROJECT1, "NewClass3.java", 5, iter1);
1108:
1109: TestKit.closeProject(PROJECT1);
1110:
1111: checkOutProject(cvsRoot1, "test", PROJECT1);
1112: iter2 = System.currentTimeMillis();
1113: editChosenFile(PROJECT1, "NewClass2.java", 5, iter2);
1114: editChosenFile(PROJECT1, "NewClass3.java", 5, iter2);
1115:
1116: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
1117: CommitOperator co = CommitOperator.invoke(new Node[] { node1 });
1118: assertEquals("Wrong count of files to commit", 2, co.tabFiles()
1119: .getRowCount());
1120:
1121: OutputTabOperator oto1 = new OutputTabOperator(cvsRoot1);
1122: oto1.getTimeouts().setTimeout(
1123: "ComponentOperator.WaitStateTimeout", 30000);
1124: oto1.clear();
1125: co.commit();
1126: oto1.waitText("Committing");
1127: oto1.waitText("finished");
1128: TestKit.closeProject(PROJECT1);
1129:
1130: openProject(location1, PROJECT1);
1131:
1132: editChosenFile(PROJECT1, "NewClass1.java", 7, iter1);
1133:
1134: updateProject(PROJECT1, cvsRoot1);
1135:
1136: NbDialogOperator nbDialog = new NbDialogOperator("Warning");
1137: JButtonOperator btnOk = new JButtonOperator(nbDialog);
1138: btnOk.push();
1139:
1140: Thread.sleep(1000);
1141: oto1 = new OutputTabOperator(cvsRoot1);
1142: oto1.getTimeouts().setTimeout(
1143: "ComponentOperator.WaitStateTimeout", 30000);
1144: oto1.clear();
1145:
1146: Node node = new Node(new SourcePackagesNode(PROJECT1), "");
1147: node.performPopupAction("CVS|Show Changes");
1148: oto1.waitText("Refreshing CVS Status finished");
1149: nbDialog = new NbDialogOperator("Command");
1150: btnOk = new JButtonOperator(nbDialog);
1151: btnOk.push();
1152:
1153: VersioningOperator vo = VersioningOperator.invoke();
1154: String[] expected = new String[] { "NewClass1.java",
1155: "NewClass2.java", "NewClass3.java" };
1156: String[] actual = new String[vo.tabFiles().getRowCount()];
1157: for (int k = 0; k < actual.length; k++) {
1158: actual[k] = vo.tabFiles().getValueAt(k, 0).toString();
1159: }
1160: int result = TestKit.compareThem(expected, actual, false);
1161: assertEquals("Wrong records displayed in dialog", 3, result);
1162:
1163: expected = new String[] { "Locally Modified", "Local Conflict",
1164: "Local Conflict" };
1165: actual = new String[vo.tabFiles().getRowCount()];
1166: for (int k = 0; k < actual.length; k++) {
1167: actual[k] = vo.tabFiles().getValueAt(k, 1).toString();
1168: }
1169: result = TestKit.compareThem(expected, actual, false);
1170: assertEquals("Wrong records displayed in dialog", 3, result);
1171:
1172: //Commit
1173: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
1174: co = CommitOperator.invoke(new Node[] { node1 });
1175: assertEquals("Wrong count of files to commit - issue #71488",
1176: 3, co.tabFiles().getRowCount());
1177: co.cancel();
1178: }
1179:
1180: public void testBrokenUpdateMerModMer() throws Exception {
1181: int j = 0;
1182: long iter1 = 1;
1183: long iter2 = 2;
1184: File location1;
1185: File work = new File("/tmp/work");
1186: work.mkdirs();
1187: TestKit.closeProject(PROJECT1);
1188:
1189: Node node1;
1190: org.openide.nodes.Node nodeIDE1;
1191:
1192: location1 = checkOutProject(cvsRoot1, "test", PROJECT1);
1193:
1194: iter1 = System.currentTimeMillis();
1195:
1196: editChosenFile(PROJECT1, "NewClass1.java", 3, iter1);
1197: editChosenFile(PROJECT1, "NewClass3.java", 3, iter1);
1198:
1199: TestKit.closeProject(PROJECT1);
1200:
1201: checkOutProject(cvsRoot1, "test", PROJECT1);
1202: iter2 = System.currentTimeMillis();
1203: editChosenFile(PROJECT1, "NewClass1.java", 5, iter2);
1204: editChosenFile(PROJECT1, "NewClass3.java", 5, iter2);
1205:
1206: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
1207: CommitOperator co = CommitOperator.invoke(new Node[] { node1 });
1208: assertEquals("Wrong count of files to commit", 2, co.tabFiles()
1209: .getRowCount());
1210:
1211: OutputTabOperator oto1 = new OutputTabOperator(cvsRoot1);
1212: oto1.getTimeouts().setTimeout(
1213: "ComponentOperator.WaitStateTimeout", 30000);
1214: oto1.clear();
1215: co.commit();
1216: oto1.waitText("Committing");
1217: oto1.waitText("finished");
1218: TestKit.closeProject(PROJECT1);
1219:
1220: openProject(location1, PROJECT1);
1221:
1222: editChosenFile(PROJECT1, "NewClass2.java", 7, iter1);
1223: updateProject(PROJECT1, cvsRoot1);
1224:
1225: Thread.sleep(1000);
1226: oto1 = new OutputTabOperator(cvsRoot1);
1227: oto1.getTimeouts().setTimeout(
1228: "ComponentOperator.WaitStateTimeout", 30000);
1229: oto1.clear();
1230:
1231: Node node = new Node(new SourcePackagesNode(PROJECT1), "");
1232: node.performPopupAction("CVS|Show Changes");
1233: oto1.waitText("Refreshing CVS Status finished");
1234:
1235: VersioningOperator vo = VersioningOperator.invoke();
1236: String[] expected = new String[] { "NewClass1.java",
1237: "NewClass2.java", "NewClass3.java" };
1238: String[] actual = new String[vo.tabFiles().getRowCount()];
1239: for (int k = 0; k < actual.length; k++) {
1240: actual[k] = vo.tabFiles().getValueAt(k, 0).toString();
1241: }
1242: int result = TestKit.compareThem(expected, actual, false);
1243: assertEquals("Wrong records displayed in dialog", 3, result);
1244:
1245: expected = new String[] { "Locally Modified",
1246: "Locally Modified", "Locally Modified" };
1247: actual = new String[vo.tabFiles().getRowCount()];
1248: for (int k = 0; k < actual.length; k++) {
1249: actual[k] = vo.tabFiles().getValueAt(k, 1).toString();
1250: }
1251: result = TestKit.compareThem(expected, actual, false);
1252: assertEquals("Wrong records displayed in dialog", 3, result);
1253:
1254: //Commit
1255: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
1256: co = CommitOperator.invoke(new Node[] { node1 });
1257: assertEquals("Wrong count of files to commit - issue #71488",
1258: 3, co.tabFiles().getRowCount());
1259: co.cancel();
1260: }
1261:
1262: public void testBrokenUpdateMerModConf() throws Exception {
1263: int j = 0;
1264: long iter1 = 1;
1265: long iter2 = 2;
1266: File location1;
1267: File work = new File("/tmp/work");
1268: work.mkdirs();
1269: TestKit.closeProject(PROJECT1);
1270:
1271: Node node1;
1272: org.openide.nodes.Node nodeIDE1;
1273:
1274: location1 = checkOutProject(cvsRoot1, "test", PROJECT1);
1275:
1276: iter1 = System.currentTimeMillis();
1277:
1278: editChosenFile(PROJECT1, "NewClass1.java", 3, iter1);
1279: editChosenFile(PROJECT1, "NewClass3.java", 3, iter1);
1280:
1281: TestKit.closeProject(PROJECT1);
1282:
1283: checkOutProject(cvsRoot1, "test", PROJECT1);
1284: iter2 = System.currentTimeMillis();
1285: editChosenFile(PROJECT1, "NewClass1.java", 5, iter2);
1286: editChosenFile(PROJECT1, "NewClass3.java", 3, iter2);
1287:
1288: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
1289: CommitOperator co = CommitOperator.invoke(new Node[] { node1 });
1290: assertEquals("Wrong count of files to commit", 2, co.tabFiles()
1291: .getRowCount());
1292:
1293: OutputTabOperator oto1 = new OutputTabOperator(cvsRoot1);
1294: oto1.getTimeouts().setTimeout(
1295: "ComponentOperator.WaitStateTimeout", 30000);
1296: oto1.clear();
1297: co.commit();
1298: oto1.waitText("Committing");
1299: oto1.waitText("finished");
1300: TestKit.closeProject(PROJECT1);
1301:
1302: openProject(location1, PROJECT1);
1303:
1304: editChosenFile(PROJECT1, "NewClass2.java", 7, iter1);
1305:
1306: updateProject(PROJECT1, cvsRoot1);
1307:
1308: NbDialogOperator nbDialog = new NbDialogOperator("Warning");
1309: JButtonOperator btnOk = new JButtonOperator(nbDialog);
1310: btnOk.push();
1311:
1312: Thread.sleep(1000);
1313: oto1 = new OutputTabOperator(cvsRoot1);
1314: oto1.getTimeouts().setTimeout(
1315: "ComponentOperator.WaitStateTimeout", 30000);
1316: oto1.clear();
1317:
1318: Node node = new Node(new SourcePackagesNode(PROJECT1), "");
1319: node.performPopupAction("CVS|Show Changes");
1320: oto1.waitText("Refreshing CVS Status finished");
1321: nbDialog = new NbDialogOperator("Command");
1322: btnOk = new JButtonOperator(nbDialog);
1323: btnOk.push();
1324:
1325: Thread.sleep(1000);
1326: oto1 = new OutputTabOperator(cvsRoot1);
1327: oto1.getTimeouts().setTimeout(
1328: "ComponentOperator.WaitStateTimeout", 30000);
1329: oto1.clear();
1330:
1331: VersioningOperator vo = VersioningOperator.invoke();
1332: String[] expected = new String[] { "NewClass1.java",
1333: "NewClass2.java", "NewClass3.java" };
1334: String[] actual = new String[vo.tabFiles().getRowCount()];
1335: for (int k = 0; k < actual.length; k++) {
1336: actual[k] = vo.tabFiles().getValueAt(k, 0).toString();
1337: }
1338: int result = TestKit.compareThem(expected, actual, false);
1339: assertEquals("Wrong records displayed in dialog", 3, result);
1340:
1341: expected = new String[] { "Locally Modified",
1342: "Locally Modified", "Local Conflict" };
1343: actual = new String[vo.tabFiles().getRowCount()];
1344: for (int k = 0; k < actual.length; k++) {
1345: actual[k] = vo.tabFiles().getValueAt(k, 1).toString();
1346: }
1347: result = TestKit.compareThem(expected, actual, false);
1348: assertEquals("Wrong records displayed in dialog", 3, result);
1349:
1350: //Commit
1351: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
1352: co = CommitOperator.invoke(new Node[] { node1 });
1353: assertEquals("Wrong count of files to commit - issue #71488",
1354: 3, co.tabFiles().getRowCount());
1355: co.cancel();
1356: }
1357:
1358: public void testBrokenUpdateConfModConf() throws Exception {
1359: int j = 0;
1360: long iter1 = 1;
1361: long iter2 = 2;
1362: File location1;
1363: File work = new File("/tmp/work");
1364: work.mkdirs();
1365: TestKit.closeProject(PROJECT1);
1366:
1367: Node node1;
1368: org.openide.nodes.Node nodeIDE1;
1369:
1370: location1 = checkOutProject(cvsRoot1, "test", PROJECT1);
1371:
1372: iter1 = System.currentTimeMillis();
1373: editChosenFile(PROJECT1, "NewClass1.java", 3, iter1);
1374: editChosenFile(PROJECT1, "NewClass3.java", 3, iter1);
1375:
1376: TestKit.closeProject(PROJECT1);
1377:
1378: checkOutProject(cvsRoot1, "test", PROJECT1);
1379: iter2 = System.currentTimeMillis();
1380: editChosenFile(PROJECT1, "NewClass1.java", 3, iter2);
1381: editChosenFile(PROJECT1, "NewClass3.java", 3, iter2);
1382:
1383: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
1384: CommitOperator co = CommitOperator.invoke(new Node[] { node1 });
1385: assertEquals("Wrong count of files to commit", 2, co.tabFiles()
1386: .getRowCount());
1387:
1388: OutputTabOperator oto1 = new OutputTabOperator(cvsRoot1);
1389: oto1.getTimeouts().setTimeout(
1390: "ComponentOperator.WaitStateTimeout", 30000);
1391: oto1.clear();
1392: co.commit();
1393: oto1.waitText("Committing");
1394: oto1.waitText("finished");
1395: TestKit.closeProject(PROJECT1);
1396:
1397: openProject(location1, PROJECT1);
1398:
1399: editChosenFile(PROJECT1, "NewClass2.java", 7, iter1);
1400:
1401: updateProject(PROJECT1, cvsRoot1);
1402: NbDialogOperator nbDialog = new NbDialogOperator("Warning");
1403: JButtonOperator btnOk = new JButtonOperator(nbDialog);
1404: btnOk.push();
1405:
1406: Thread.sleep(1000);
1407: oto1 = new OutputTabOperator(cvsRoot1);
1408: oto1.getTimeouts().setTimeout(
1409: "ComponentOperator.WaitStateTimeout", 30000);
1410: oto1.clear();
1411:
1412: Node node = new Node(new SourcePackagesNode(PROJECT1), "");
1413: node.performPopupAction("CVS|Show Changes");
1414: oto1.waitText("Refreshing CVS Status finished");
1415: nbDialog = new NbDialogOperator("Command");
1416: btnOk = new JButtonOperator(nbDialog);
1417: btnOk.push();
1418:
1419: Thread.sleep(1000);
1420: oto1 = new OutputTabOperator(cvsRoot1);
1421: oto1.getTimeouts().setTimeout(
1422: "ComponentOperator.WaitStateTimeout", 30000);
1423: oto1.clear();
1424:
1425: VersioningOperator vo = VersioningOperator.invoke();
1426: String[] expected = new String[] { "NewClass1.java",
1427: "NewClass2.java", "NewClass3.java" };
1428: String[] actual = new String[vo.tabFiles().getRowCount()];
1429: for (int k = 0; k < actual.length; k++) {
1430: actual[k] = vo.tabFiles().getValueAt(k, 0).toString();
1431: }
1432: int result = TestKit.compareThem(expected, actual, false);
1433: assertEquals("Wrong records displayed in dialog", 3, result);
1434:
1435: expected = new String[] { "Local Conflict", "Locally Modified",
1436: "Local Conflict" };
1437: actual = new String[vo.tabFiles().getRowCount()];
1438: for (int k = 0; k < actual.length; k++) {
1439: actual[k] = vo.tabFiles().getValueAt(k, 1).toString();
1440: }
1441: result = TestKit.compareThem(expected, actual, false);
1442: assertEquals("Wrong records displayed in dialog", 3, result);
1443:
1444: //Commit
1445: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
1446: co = CommitOperator.invoke(new Node[] { node1 });
1447: assertEquals("Wrong count of files to commit - issue #71488",
1448: 3, co.tabFiles().getRowCount());
1449: co.cancel();
1450: }
1451:
1452: public void testBrokenUpdateConfConfMod() throws Exception {
1453: int j = 0;
1454: long iter1 = 1;
1455: long iter2 = 2;
1456: File location1;
1457: File work = new File("/tmp/work");
1458: work.mkdirs();
1459: TestKit.closeProject(PROJECT1);
1460:
1461: Node node1;
1462: Node node2;
1463: org.openide.nodes.Node nodeIDE1;
1464: org.openide.nodes.Node nodeIDE2;
1465:
1466: location1 = checkOutProject(cvsRoot1, "test", PROJECT1);
1467:
1468: iter1 = System.currentTimeMillis();
1469: editChosenFile(PROJECT1, "NewClass1.java", 3, iter1);
1470: editChosenFile(PROJECT1, "NewClass2.java", 3, iter1);
1471:
1472: TestKit.closeProject(PROJECT1);
1473:
1474: checkOutProject(cvsRoot1, "test", PROJECT1);
1475:
1476: iter2 = System.currentTimeMillis();
1477: editChosenFile(PROJECT1, "NewClass1.java", 3, iter2);
1478: editChosenFile(PROJECT1, "NewClass2.java", 3, iter2);
1479:
1480: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
1481: CommitOperator co = CommitOperator.invoke(new Node[] { node1 });
1482: assertEquals("Wrong count of files to commit", 2, co.tabFiles()
1483: .getRowCount());
1484:
1485: OutputTabOperator oto1 = new OutputTabOperator(cvsRoot1);
1486: oto1.getTimeouts().setTimeout(
1487: "ComponentOperator.WaitStateTimeout", 30000);
1488: oto1.clear();
1489: co.commit();
1490: oto1.waitText("Committing");
1491: oto1.waitText("finished");
1492: TestKit.closeProject(PROJECT1);
1493:
1494: openProject(location1, PROJECT1);
1495:
1496: editChosenFile(PROJECT1, "NewClass3.java", 7, iter1);
1497:
1498: updateProject(PROJECT1, cvsRoot1);
1499: NbDialogOperator nbDialog = new NbDialogOperator("Warning");
1500: JButtonOperator btnOk = new JButtonOperator(nbDialog);
1501: btnOk.push();
1502:
1503: Thread.sleep(1000);
1504: oto1 = new OutputTabOperator(cvsRoot1);
1505: oto1.getTimeouts().setTimeout(
1506: "ComponentOperator.WaitStateTimeout", 30000);
1507: oto1.clear();
1508:
1509: Node node = new Node(new SourcePackagesNode(PROJECT1), "");
1510: node.performPopupAction("CVS|Show Changes");
1511: oto1.waitText("Refreshing CVS Status finished");
1512: nbDialog = new NbDialogOperator("Command");
1513: btnOk = new JButtonOperator(nbDialog);
1514: btnOk.push();
1515:
1516: Thread.sleep(1000);
1517: oto1 = new OutputTabOperator(cvsRoot1);
1518: oto1.getTimeouts().setTimeout(
1519: "ComponentOperator.WaitStateTimeout", 30000);
1520: oto1.clear();
1521:
1522: VersioningOperator vo = VersioningOperator.invoke();
1523: String[] expected = new String[] { "NewClass1.java",
1524: "NewClass2.java", "NewClass3.java" };
1525: String[] actual = new String[vo.tabFiles().getRowCount()];
1526: for (int k = 0; k < actual.length; k++) {
1527: actual[k] = vo.tabFiles().getValueAt(k, 0).toString();
1528: }
1529: int result = TestKit.compareThem(expected, actual, false);
1530: assertEquals("Wrong records displayed in dialog", 3, result);
1531:
1532: expected = new String[] { "Local Conflict", "Local Conflict",
1533: "Locally Modified" };
1534: actual = new String[vo.tabFiles().getRowCount()];
1535: for (int k = 0; k < actual.length; k++) {
1536: actual[k] = vo.tabFiles().getValueAt(k, 1).toString();
1537: }
1538: result = TestKit.compareThem(expected, actual, false);
1539: assertEquals("Wrong records displayed in dialog", 3, result);
1540:
1541: //Commit
1542: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
1543: co = CommitOperator.invoke(new Node[] { node1 });
1544: assertEquals("Wrong count of files to commit - issue #71488",
1545: 3, co.tabFiles().getRowCount());
1546: co.cancel();
1547: }
1548:
1549: public void testBrokenUpdateMerMerMod() throws Exception {
1550: int j = 0;
1551: long iter1 = 1;
1552: long iter2 = 2;
1553: File location1;
1554: File work = new File("/tmp/work");
1555: work.mkdirs();
1556: TestKit.closeProject(PROJECT1);
1557:
1558: Node node1;
1559: org.openide.nodes.Node nodeIDE1;
1560:
1561: location1 = checkOutProject(cvsRoot1, "test", PROJECT1);
1562:
1563: iter1 = System.currentTimeMillis();
1564: editChosenFile(PROJECT1, "NewClass1.java", 3, iter1);
1565: editChosenFile(PROJECT1, "NewClass2.java", 3, iter1);
1566:
1567: TestKit.closeProject(PROJECT1);
1568:
1569: checkOutProject(cvsRoot1, "test", PROJECT1);
1570: iter2 = System.currentTimeMillis();
1571: editChosenFile(PROJECT1, "NewClass1.java", 5, iter2);
1572: editChosenFile(PROJECT1, "NewClass2.java", 5, iter2);
1573:
1574: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
1575: CommitOperator co = CommitOperator.invoke(new Node[] { node1 });
1576: assertEquals("Wrong count of files to commit", 2, co.tabFiles()
1577: .getRowCount());
1578:
1579: OutputTabOperator oto1 = new OutputTabOperator(cvsRoot1);
1580: oto1.getTimeouts().setTimeout(
1581: "ComponentOperator.WaitStateTimeout", 30000);
1582: oto1.clear();
1583: co.commit();
1584: oto1.waitText("Committing");
1585: oto1.waitText("finished");
1586: TestKit.closeProject(PROJECT1);
1587:
1588: openProject(location1, PROJECT1);
1589:
1590: editChosenFile(PROJECT1, "NewClass3.java", 7, iter1);
1591:
1592: updateProject(PROJECT1, cvsRoot1);
1593:
1594: Thread.sleep(1000);
1595: oto1 = new OutputTabOperator(cvsRoot1);
1596: oto1.getTimeouts().setTimeout(
1597: "ComponentOperator.WaitStateTimeout", 30000);
1598: oto1.clear();
1599:
1600: Node node = new Node(new SourcePackagesNode(PROJECT1), "");
1601: node.performPopupAction("CVS|Show Changes");
1602: oto1.waitText("Refreshing CVS Status finished");
1603:
1604: Thread.sleep(1000);
1605: oto1 = new OutputTabOperator(cvsRoot1);
1606: oto1.getTimeouts().setTimeout(
1607: "ComponentOperator.WaitStateTimeout", 30000);
1608: oto1.clear();
1609:
1610: VersioningOperator vo = VersioningOperator.invoke();
1611: String[] expected = new String[] { "NewClass1.java",
1612: "NewClass2.java", "NewClass3.java" };
1613: String[] actual = new String[vo.tabFiles().getRowCount()];
1614: for (int k = 0; k < actual.length; k++) {
1615: actual[k] = vo.tabFiles().getValueAt(k, 0).toString();
1616: }
1617: int result = TestKit.compareThem(expected, actual, false);
1618: assertEquals("Wrong records displayed in dialog", 3, result);
1619:
1620: expected = new String[] { "Locally Modified",
1621: "Locally Modified", "Locally Modified" };
1622: actual = new String[vo.tabFiles().getRowCount()];
1623: for (int k = 0; k < actual.length; k++) {
1624: actual[k] = vo.tabFiles().getValueAt(k, 1).toString();
1625: }
1626: result = TestKit.compareThem(expected, actual, false);
1627: assertEquals("Wrong records displayed in dialog", 3, result);
1628:
1629: //Commit
1630: node1 = new Node(new SourcePackagesNode(PROJECT1), "");
1631: co = CommitOperator.invoke(new Node[] { node1 });
1632: assertEquals("Wrong count of files to commit - issue #71488",
1633: 3, co.tabFiles().getRowCount());
1634: co.cancel();
1635: }
1636:
1637: public void updateProject(String project, String cvsRoot)
1638: throws Exception {
1639: OutputTabOperator oto = new OutputTabOperator(cvsRoot);
1640: oto.getTimeouts().setTimeout(
1641: "ComponentOperator.WaitStateTimeout", 30000);
1642: Node node = new Node(new ProjectsTabOperator().tree(), project);
1643: node.performPopupAction("CVS|Update");
1644: oto.waitText("Updating");
1645: oto.waitText("finished");
1646: }
1647:
1648: public File checkOutProject(String cvsRoot, String passwd,
1649: String project) throws Exception {
1650: File work = new File("/tmp/work/w" + System.currentTimeMillis());
1651: work.mkdir();
1652: OutputOperator oo = OutputOperator.invoke();
1653: new ProjectsTabOperator().tree().clearSelection();
1654: comOperator = new Operator.DefaultStringComparator(true, true);
1655: oldOperator = (DefaultStringComparator) Operator
1656: .getDefaultStringComparator();
1657: Operator.setDefaultStringComparator(comOperator);
1658: CheckoutWizardOperator cwo = CheckoutWizardOperator.invoke();
1659: Operator.setDefaultStringComparator(oldOperator);
1660: CVSRootStepOperator crso = new CVSRootStepOperator();
1661: //JComboBoxOperator combo = new JComboBoxOperator(crso, 0);
1662: crso.setCVSRoot(cvsRoot);
1663: //crso.setPassword("");
1664: crso.setPassword(passwd);
1665: crso.next();
1666: ModuleToCheckoutStepOperator moduleCheck = new ModuleToCheckoutStepOperator();
1667: moduleCheck.setModule(project);
1668: moduleCheck.setLocalFolder(work.getCanonicalPath());
1669: moduleCheck.finish();
1670: OutputTabOperator oto = new OutputTabOperator(cvsRoot);
1671: oto.getTimeouts().setTimeout(
1672: "ComponentOperator.WaitStateTimeout", 30000);
1673: oto.waitText("Checking out finished");
1674: NbDialogOperator nbdialog = new NbDialogOperator(
1675: "Checkout Completed");
1676: JButtonOperator open = new JButtonOperator(nbdialog,
1677: "Open Project");
1678: open.push();
1679:
1680: ProjectSupport.waitScanFinished();
1681: TestKit.waitForQueueEmpty();
1682: ProjectSupport.waitScanFinished();
1683:
1684: return work;
1685: }
1686:
1687: public void editChosenFile(String project, String name, int line,
1688: long iter) {
1689: Node node = new Node(new ProjectsTabOperator().tree(), project);
1690: //node.performPopupAction("CVS|Show Changes");
1691: node = new Node(new SourcePackagesNode(project), "aa|" + name);
1692: node.performPopupAction("Open");
1693: EditorOperator eo = new EditorOperator(name);
1694: eo.insert("//" + name + " >iter< " + iter + "\n", line, 1);
1695: eo.save();
1696: }
1697:
1698: public void validateCheckout(String project, long iter,
1699: int[] indexes) throws Exception {
1700: Node node;
1701: EditorOperator eo;
1702: for (int i = nodes1.length - 1; i < nodes1.length; i++) {
1703: node = new Node(new SourcePackagesNode(project), nodes1[i]);
1704: node.performPopupAction("Open");
1705: eo = new EditorOperator(getObjectName(nodes1[i]));
1706: for (int j = 0; j < indexes.length; j++) {
1707: String line = eo.getText(indexes[j]);
1708: System.out.println("line: " + line);
1709: assertEquals("Data was not committed!!!", "//"
1710: + nodes1[i] + " >iter< " + iter + "\n", line);
1711:
1712: }
1713: if (i == nodes1.length - 1)
1714: eo.closeDiscardAll();
1715: }
1716:
1717: }
1718:
1719: public void openProject(File location, String project)
1720: throws Exception {
1721: new ActionNoBlock("File|Open Project", null).perform();
1722: NbDialogOperator nb = new NbDialogOperator("Open Project");
1723: JFileChooserOperator fco = new JFileChooserOperator(nb);
1724: System.out.println(location.getCanonicalPath());
1725: fco.setCurrentDirectory(new File(location, project));
1726: fco.approve();
1727: ProjectSupport.waitScanFinished();
1728: }
1729: }
|