1.1 --- a/vcs.advanced/test/qa-functional/src/complete/cvs_profile/JellyGroup.java Mon Oct 14 09:12:12 2002 +0000
1.2 +++ b/vcs.advanced/test/qa-functional/src/complete/cvs_profile/JellyGroup.java Mon Oct 14 13:47:01 2002 +0000
1.3 @@ -65,9 +65,7 @@
1.4 import util.History;
1.5 import util.StatusBarTracer;
1.6
1.7 -public class JellyGroup extends JellyTestCase {
1.8 -
1.9 - public static final boolean DEBUG = false;
1.10 +public class JellyGroup extends JellyStub {
1.11
1.12 public static final String TEST_GROUP = "TestGroup";
1.13 public static final String GROUP_DESCRIPTION = "Description of TestGroup";
1.14 @@ -95,174 +93,26 @@
1.15 junit.textui.TestRunner.run(suite());
1.16 }
1.17
1.18 - ExplorerOperator exp;
1.19 - StatusBarTracer sbt;
1.20 - static String serverDirectory;
1.21 static String clientDirectory;
1.22 - static String hRoot = ".", nRoot;
1.23 + static History history;
1.24 + static String nRoot;
1.25 static String tInitDir = "initdir", hInitDir = tInitDir, fInitDir, nInitDir;
1.26 static String tText1 = "text1", hText1 = hInitDir + "/" + tText1, fText1, nText1;
1.27 static String tText2 = "text2", hText2 = hInitDir + "/" + tText2, fText2, nText2;
1.28 static String tText3 = "text3", hText3 = hInitDir + "/" + tText3, fText3, nText3;
1.29
1.30 static boolean text1InDefaultGroup = false;
1.31 -
1.32 - PrintStream out;
1.33 - PrintStream info;
1.34 - static History history;
1.35
1.36 - public static void closeAllProperties() {
1.37 - for (;;) {
1.38 - NbFrameOperator fr = NbFrameOperator.find("Propert", 0);
1.39 - if (fr == null)
1.40 - break;
1.41 - fr.close();
1.42 - Helper.sleep(1000);
1.43 - }
1.44 - }
1.45 -
1.46 - public void waitStatus(String status, String node) {
1.47 - assertTrue ("waitStatus(status,node) precondition failed", status == null || status.indexOf(';') < 0);
1.48 - waitStatus(status, node, false);
1.49 - }
1.50 -
1.51 - public void waitStatus(String status, String node, boolean withversion) {
1.52 - waitStatus (exp.repositoryTab ().tree (), status, node, withversion);
1.53 - }
1.54 -
1.55 - public void waitStatus(JTreeOperator tree, String status, String node, boolean withversion) {
1.56 - String ano = null;
1.57 - for (int a = 0; a < 15; a ++) {
1.58 - Helper.sleep(1000);
1.59 - Node n = new Node(tree, node);
1.60 - ano = n.getText();
1.61 - int i = ano.indexOf('[');
1.62 - if (i < 0) {
1.63 - if (status == null)
1.64 - return;
1.65 - continue;
1.66 - }
1.67 - ano = ano.substring(i + 1);
1.68 - i = ano.lastIndexOf(']');
1.69 - if (i < 0)
1.70 - continue;
1.71 - ano = ano.substring(0, i);
1.72 - if (!withversion) {
1.73 - i = ano.indexOf(';');
1.74 - if (i >= 0)
1.75 - ano = ano.substring(0, i);
1.76 - }
1.77 - if (ano.equals(status))
1.78 - return;
1.79 - }
1.80 - assertTrue("CVS File Status is not reached: Expected: " + status + " Got: " + ano, false);
1.81 - }
1.82 -
1.83 - public void waitVersion(String version, String node) {
1.84 - String ano = null;
1.85 - for (int a = 0; a < 15; a ++) {
1.86 - Helper.sleep(1000);
1.87 - Node n = new Node(exp.repositoryTab().tree(), node);
1.88 - ano = n.getText();
1.89 - int i = ano.indexOf('(');
1.90 - if (i < 0) {
1.91 - if (version == null)
1.92 - return;
1.93 - continue;
1.94 - }
1.95 - ano = ano.substring(i + 1);
1.96 - i = ano.lastIndexOf(')');
1.97 - if (i < 0)
1.98 - continue;
1.99 - ano = ano.substring(0, i);
1.100 - if (ano.equals(version))
1.101 - return;
1.102 - }
1.103 - assertTrue("CVS File Version is not reached: Expected: " + version + " Got: " + ano, false);
1.104 - }
1.105 -
1.106 - boolean equalPaths (String p1, String p2) {
1.107 - p1 = p1.replace ('\\', '/');
1.108 - p2 = p2.replace ('\\', '/');
1.109 - return p1.equalsIgnoreCase(p2);
1.110 - }
1.111 -
1.112 - protected void setUp() throws Exception {
1.113 - exp = new ExplorerOperator();
1.114 - sbt = new StatusBarTracer();
1.115 - out = getRef();
1.116 - info = getLog();
1.117 + protected void prepareServer (String dir) {
1.118 + new File(dir + "/" + tInitDir).mkdirs();
1.119 }
1.120
1.121 public void testWorkDir() {
1.122 - String workroot;
1.123 - try {
1.124 - workroot = getWorkDirPath();
1.125 - } catch (IOException e) {
1.126 - throw new AssertionFailedErrorException("IOException while getWorkDirPath()", e);
1.127 - }
1.128 - serverDirectory = workroot + "/server";
1.129 - clientDirectory = workroot + "/client";
1.130 - if (Utilities.isUnix ()) {
1.131 - serverDirectory = serverDirectory.replace ('\\', '/');
1.132 - clientDirectory = clientDirectory.replace ('\\', '/');
1.133 - } else {
1.134 - serverDirectory = serverDirectory.replace ('/', '\\');
1.135 - clientDirectory = clientDirectory.replace ('/', '\\');
1.136 - }
1.137 + JellyStub.Configuration conf = super.configureWorkDir ();
1.138
1.139 - new File(serverDirectory).mkdirs();
1.140 - new File(clientDirectory).mkdirs();
1.141 - new File(serverDirectory + "/" + tInitDir).mkdirs();
1.142 -
1.143 - info.println("Server: " + serverDirectory);
1.144 - info.println("Client: " + clientDirectory);
1.145 -
1.146 - if (!DEBUG) {
1.147 - // mount
1.148 - new VCSGenericMountAction().perform();
1.149 - VCSWizardProfile wizard = new VCSWizardProfile();
1.150 - wizard.verify("");
1.151 - wizard.setWorkingDirectory(clientDirectory);
1.152 - String profile = Utilities.isUnix() ? VCSWizardProfile.CVS_UNIX : VCSWizardProfile.CVS_WIN_NT;
1.153 - sbt.start();
1.154 - wizard.setProfile(profile);
1.155 - sbt.removeText("Command AUTO_FILL_CONFIG finished.");
1.156 - sbt.stop();
1.157 - wizard.setCVSServerType("local");
1.158 - wizard.setCVSServerName("");
1.159 - wizard.setCVSUserName("");
1.160 - wizard.setCVSRepository(serverDirectory);
1.161 - wizard.next();
1.162 - VCSWizardAdvanced wizard2 = new VCSWizardAdvanced();
1.163 - wizard2.checkAdvancedMode(true);
1.164 - wizard2.finish();
1.165 - Helper.sleep(5000);
1.166 - }
1.167 -
1.168 - nRoot = "CVS " + clientDirectory;
1.169 - boolean found = false;
1.170 - info.println("Searching for CVS filesystem: " + nRoot);
1.171 - for (int a = 0; a < 10; a ++) {
1.172 - Enumeration e = TopManager.getDefault().getRepository().getFileSystems();
1.173 - while (e.hasMoreElements()) {
1.174 - FileSystem f = (FileSystem) e.nextElement();
1.175 - info.println("Is it: " + f.getDisplayName());
1.176 - if (equalPaths (f.getDisplayName(), nRoot)) {
1.177 - info.println("Yes");
1.178 - nRoot = f.getDisplayName();
1.179 - info.println("Working Directory nRoot: " + nRoot);
1.180 - history = new History(f);
1.181 - found = true;
1.182 - break;
1.183 - }
1.184 - }
1.185 - if (found == true)
1.186 - break;
1.187 - Helper.sleep(1000);
1.188 - }
1.189 - assertTrue("Filesystem not found: Filesystem: " + nRoot, found);
1.190 - new CVSFileNode(exp.repositoryTab().tree(), nRoot);
1.191 + nRoot = conf.nRoot;
1.192 + clientDirectory = conf.clientDirectory;
1.193 + history = conf.history;
1.194
1.195 fInitDir = clientDirectory + "/" + tInitDir;
1.196 nInitDir = nRoot + "|" + tInitDir;
1.197 @@ -276,32 +126,7 @@
1.198 fText3 = fInitDir + "/" + tText3;
1.199 nText3 = nInitDir + "|" + tText3;
1.200
1.201 - if (!DEBUG) {
1.202 - closeAllProperties();
1.203 - FilesystemHistoryNode cvshistorynode = new FilesystemHistoryNode(exp.runtimeTab().tree(), nRoot);
1.204 - cvshistorynode.properties();
1.205 - PropertySheetOperator pso = new PropertySheetOperator(PropertySheetOperator.MODE_PROPERTIES_OF_ONE_OBJECT, nRoot);
1.206 - PropertySheetTabOperator pst = pso.getPropertySheetTabOperator("Properties");
1.207 - new StringProperty(pst, "Number of Finished Commands To Keep").setValue("200");
1.208 - pso.close();
1.209 -
1.210 - // init
1.211 - new CVSFileNode(exp.repositoryTab().tree(), nRoot).cVSInit();
1.212 - history.waitCommand("Init", ".");
1.213 -
1.214 - // checkout
1.215 - new CVSFileNode(exp.repositoryTab().tree(), nRoot).cVSCheckOut();
1.216 - CVSCheckoutFolderAdvDialog co = new CVSCheckoutFolderAdvDialog();
1.217 - co.setModuleS(hRoot);
1.218 - co.checkPruneEmptyFolders(false);
1.219 - co.oK();
1.220 - assertTrue("Check Out command failed", history.waitCommand("Check Out", hRoot));
1.221 -
1.222 - // workaround - probably jelly issue - if not used, popup menu does not work in versioning frame
1.223 - VCSCommandsOutputOperator voo = new VCSCommandsOutputOperator ("CHECKOUT_COMMAND");
1.224 - voo.close();
1.225 - voo.waitClosed();
1.226 -
1.227 + if (!JellyStub.DEBUG) {
1.228 // add
1.229 try {
1.230 new File(fText1).createNewFile();