|
What this is
Other links
The source code
/*
* Sun Public License Notice
*
* The contents of this file are subject to the Sun Public License
* Version 1.0 (the "License"). You may not use this file except in
* compliance with the License. A copy of the License is available at
* http://www.sun.com/
*
* The Original Code is NetBeans. The Initial Developer of the Original
* Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
* Microsystems, Inc. All Rights Reserved.
*/
package complete;
import org.netbeans.jellytools.EditorOperator;
import org.netbeans.jellytools.NbDialogOperator;
import org.netbeans.jellytools.NewWizardOperator;
import org.netbeans.jellytools.TopComponentOperator;
import org.netbeans.jellytools.actions.OpenAction;
import org.netbeans.jellytools.modules.javacvs.output.AnnotateOutputOperator;
import org.netbeans.jellytools.modules.javacvs.output.LogOutputOperator;
import org.netbeans.jellytools.modules.javacvs.output.StatusOutputOperator;
import org.netbeans.jellytools.modules.vcscore.VCSCommandsOutputOperator;
import org.netbeans.jellytools.nodes.FilesystemNode;
import org.netbeans.jellytools.nodes.Node;
import org.netbeans.jellytools.util.StringFilter;
import org.netbeans.jemmy.operators.JTextFieldOperator;
import org.netbeans.test.oo.gui.jelly.javacvs.AddDialog;
import org.netbeans.test.oo.gui.jelly.javacvs.AnnotateDialog;
import org.netbeans.test.oo.gui.jelly.javacvs.CommitDialog;
import org.netbeans.test.oo.gui.jelly.javacvs.DiffDialog;
import org.netbeans.test.oo.gui.jelly.javacvs.LogDialog;
import org.netbeans.test.oo.gui.jelly.javacvs.RemoveDialog;
import org.netbeans.test.oo.gui.jelly.javacvs.StatusDialog;
import org.netbeans.test.oo.gui.jelly.javacvs.TagDialog;
import org.netbeans.test.oo.gui.jelly.vcscore.OutputOfVCSCommandsFrame;
public class BasicCommands extends JCVSStub {
public BasicCommands(String testName) {
super(testName);
}
public static junit.framework.Test suite() {
// DEBUG = true;
junit.framework.TestSuite suite = new org.netbeans.junit.NbTestSuite();
suite.addTest(new BasicCommands("configure"));
suite.addTest(new BasicCommands("testAddDirectoryRecursive"));
suite.addTest(new BasicCommands("testAddNoKeywordSubstitution"));
suite.addTest(new BasicCommands("testAddKeywordSubstitution"));
suite.addTest(new BasicCommands("testTagInit"));
suite.addTest(new BasicCommands("testTagDirectory"));
suite.addTest(new BasicCommands("testTagAdd"));
suite.addTest(new BasicCommands("testTagModified"));
suite.addTest(new BasicCommands("testTagByRevision"));
suite.addTest(new BasicCommands("testTagForce"));
suite.addTest(new BasicCommands("testTagDelete"));
suite.addTest(new BasicCommands("testUnmount"));
return suite;
}
public static void main(java.lang.String[] args) {
junit.textui.TestRunner.run(suite());
}
GenericNode pac1, subpac1;
GenericNode add1, add2, add3;
GenericNode pac2, subpac2, subpac22;
GenericNode tag1, tag2, tag3, tag4, tag51, tag52, tag6;
protected void createStructure() {
pac1 = new GenericNode (root, "pac1");
subpac1 = new GenericNode (pac1, "subpac1");
add1 = new GenericNode (subpac1, "add1");
add2 = new GenericNode (pac1, "add2");
add3 = new GenericNode (pac1, "add3");
pac2 = new GenericNode (root, "pac2");
subpac2 = new GenericNode (pac2, "subpac2");
tag1 = new GenericNode (subpac2, "tag1", ".java");
tag2 = new GenericNode (pac2, "tag2", ".java");
tag3 = new GenericNode (pac2, "tag3", ".java");
tag4 = new GenericNode (pac2, "tag4", ".java");
subpac22 = new GenericNode (pac2, "subpa22");
tag51 = new GenericNode (subpac22, "tag51");
tag52 = new GenericNode (subpac22, "tag52");
tag6 = new GenericNode (pac2, "tag6",".java");
}
public void configure () {
super.configure ();
}
public void dumpStatus (GenericNode node, boolean directory) {
closeAllVCSWindows ();
node.jcvsNode ().jCVSStatus ();
StatusDialog stat = new StatusDialog ();
checkCheckBox (stat.cbIncludeTagInfo());
stat.runCommand();
stat.waitClosed ();
node.waitHistoryShort ("status -v");
StatusOutputOperator soo = new StatusOutputOperator (directory);
if (directory)
soo.dumpAll(out, "/cvsroot/test/jcvs/" + roothistoryshort);
else
soo.dumpFile(out, "/cvsroot/test/jcvs/" + roothistoryshort);
}
public void testAddDirectoryRecursive () {
subpac1.mkdirs ();
add1.save ("Adding 1");
refresh(root);
pac1.jcvsNode ().jCVSAdd ();
AddDialog add = new AddDialog ();
add.txtMessage().setText ("Adding Desc 1");
checkCheckBox(add.cbRecursively());
add.runCommand();
add.waitClosed ();
pac1.waitHistoryShort("add -m \"Addin...\"");
add1.waitStatus ("LAdded; New", true);
dumpStatus (add1, false);
compareReferenceFiles ();
}
public void assertKeywordSubstitution (AddDialog add, String value, String switches) {
switches = "add " + ((switches != null) ? (switches + " ") : "");
add.cboSubstitution().selectItem (value);
add.compareSwitches(switches);
JTextFieldOperator tfo = new JTextFieldOperator (add, switches);
assertEquals ("Keyword Substitution assertion failed", switches, tfo.getText ());
}
public void testAddNoKeywordSubstitution () {
add2.save ("$Revision: 1.5 $\n");
refresh (pac1);
add2.jcvsNode ().jCVSAdd ();
AddDialog add = new AddDialog ();
assertKeywordSubstitution (add, "Reuse Old Value (-ko)", "-ko");
add.txtMessage().setText ("Adding Desc 2");
add.runCommand();
add.waitClosed ();
add2.waitHistoryShort("add -m \"Addin...\" -ko");
add2.waitStatus ("LAdded; New", true);
commitFile (add2, null, null);
add2.waitStatus ("Up-to-date; 1.1", true);
out.println ("Corrected file:");
out.println (loadFile(add2.file ()));
compareReferenceFiles ();
}
public void testAddKeywordSubstitution () {
add3.save ("$Revision: 1.5 $\n");
refresh (pac1);
add3.jcvsNode ().jCVSAdd ();
AddDialog add = new AddDialog ();
assertKeywordSubstitution (add, "
|
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.