Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-02-25 16:44:02 -0500
committerMichael Valenta2002-02-25 16:44:02 -0500
commite80cfa9a26d8d285d758dcc889f9c5d0b324eea3 (patch)
tree10150eb826f529645560c67a6c940152c56e2267
parent6a9f6203ac499330465fcf7d83064d03825313b3 (diff)
downloadeclipse.platform.team-e80cfa9a26d8d285d758dcc889f9c5d0b324eea3.tar.gz
eclipse.platform.team-e80cfa9a26d8d285d758dcc889f9c5d0b324eea3.tar.xz
eclipse.platform.team-e80cfa9a26d8d285d758dcc889f9c5d0b324eea3.zip
Added configurable rsh
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/readme.txt11
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/repository.properties3
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java6
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java20
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/SameResultEnv.java14
5 files changed, 28 insertions, 26 deletions
diff --git a/tests/org.eclipse.team.tests.cvs.core/readme.txt b/tests/org.eclipse.team.tests.cvs.core/readme.txt
index 2ba27cca5..82b728362 100644
--- a/tests/org.eclipse.team.tests.cvs.core/readme.txt
+++ b/tests/org.eclipse.team.tests.cvs.core/readme.txt
@@ -11,7 +11,16 @@ In order to run the tests, perform the following steps:
3. Modify the repository.properties file in plug-in
org.eclipse.team.tests.cvs.core to contain the
-information required to connect to your repository.
+information required to connect to your repository.
+Important fields in the repository properties file
+are:
+
+ repository - the location string that identifies your test repository
+ initrepo - true if you want to initialize the repository before beginning
+ rsh - the rsh (or ssh) client used to initialize the repository
+
+The rsh field is similar to the CVS_RSH environment variable
+
Your repository must allow rsh connections from your userid and machine in order for
the tests to run.
diff --git a/tests/org.eclipse.team.tests.cvs.core/repository.properties b/tests/org.eclipse.team.tests.cvs.core/repository.properties
index 845c5ef22..e40f30aa0 100644
--- a/tests/org.eclipse.team.tests.cvs.core/repository.properties
+++ b/tests/org.eclipse.team.tests.cvs.core/repository.properties
@@ -5,4 +5,5 @@ command=C:\cvs\bin\cvs
debug=false
standalone=false
initrepo=false
-temp=C:\temp \ No newline at end of file
+temp=C:\temp
+rsh=rsh \ No newline at end of file
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java
index 3875762b8..4207841b0 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/CVSTestSetup.java
@@ -21,6 +21,7 @@ public class CVSTestSetup extends TestSetup {
public static String REPOSITORY_LOCATION;
static boolean INITIALIZE_REPO;
public static final boolean DEBUG;
+ public static final String RSH;
public static CVSRepositoryLocation repository;
@@ -37,6 +38,7 @@ public class CVSTestSetup extends TestSetup {
REPOSITORY_LOCATION = System.getProperty("eclipse.cvs.repository");
INITIALIZE_REPO = (System.getProperty("eclipse.cvs.initrepo")==null)?false:(new Boolean(System.getProperty("eclipse.cvs.initrepo")).booleanValue());
DEBUG= (System.getProperty("eclipse.cvs.debug")==null)?false:(new Boolean(System.getProperty("eclipse.cvs.debug")).booleanValue());
+ RSH= (System.getProperty("eclipse.cvs.rsh")==null)?"rsh":System.getProperty("eclipse.cvs.rsh");
}
/**
* Constructor for CVSTestSetup.
@@ -52,8 +54,8 @@ public class CVSTestSetup extends TestSetup {
String repositoryHost = repository.getHost();
String userName = repository.getUsername();
String repoRoot = repository.getRootDirectory();
- String cmd1 = new String("rsh " + repositoryHost + " -l " + userName + " rm -rf " + repoRoot);
- String cmd2 = new String("rsh " + repositoryHost + " -l " + userName + " cvs -d " + repoRoot + " init");
+ String cmd1 = new String(RSH + " " + repositoryHost + " -l " + userName + " rm -rf " + repoRoot);
+ String cmd2 = new String(RSH + " " + repositoryHost + " -l " + userName + " cvs -d " + repoRoot + " init");
try {
Process p = Runtime.getRuntime().exec(cmd1);
p.waitFor();
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java
index 070cb0ddd..725d7c106 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java
@@ -20,8 +20,10 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
import org.eclipse.team.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.ccvs.core.CVSStatus;
+import org.eclipse.team.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.Session;
@@ -212,18 +214,18 @@ public abstract class JUnitTestCase extends TestCase {
CVSRepositoryLocation location = CVSRepositoryLocation.fromString(REPOSITORY_NAME);
String host = location.getHost();
String repoRoot = location.getRootDirectory();
- magicDeleteProject(host, repoRoot, project);
+ magicDeleteProject(location, project);
}
/**
* Delete a project/resource form the standard cvs-server
*/
- protected static void magicDeleteProject(String host, String repoRoot, String project) throws CVSException {
+ protected static void magicDeleteProject(ICVSRepositoryLocation location, String project) throws CVSException {
String commandLine;
Process process;
- commandLine = new String("rsh " + host + " rm -rf " + repoRoot + "/" + project);
+ commandLine = new String(CVSTestSetup.RSH + " " + location.getHost() + " -l " + location.getUsername() + " rm -rf " + new Path(location.getRootDirectory()).append(project).toString());
try {
process = Runtime.getRuntime().exec(commandLine);
@@ -246,9 +248,7 @@ public abstract class JUnitTestCase extends TestCase {
*/
public void magicSetUpRepo(String project, String[] createResources) throws CVSException {
CVSRepositoryLocation location = CVSRepositoryLocation.fromString(REPOSITORY_NAME);
- String host = location.getHost();
- String repoRoot = location.getRootDirectory();
- magicSetUpRepo(workspaceRoot,host,repoRoot,REPOSITORY_NAME,project,createResources);
+ magicSetUpRepo(workspaceRoot, location ,project, createResources);
}
/**
@@ -262,17 +262,17 @@ public abstract class JUnitTestCase extends TestCase {
* @param project e.g. org.eclipse.swt
* @param createResources e.g. new String[]{"a.txt","f1/b.txt","f1/c.txt","f2/d.txt"}
*/
- private static void magicSetUpRepo(File root, String host, String repoRoot, String repoName, String project, String[] createResources) throws CVSException {
+ private static void magicSetUpRepo(File root, ICVSRepositoryLocation location, String project, String[] createResources) throws CVSException {
File workFolder;
- workFolder = new File(root,project + "tmpXXXtmp");
+ workFolder = new File(root, project + "tmpXXXtmp");
createRandomFile(workFolder, createResources);
- magicDeleteProject(host,repoRoot,project);
+ magicDeleteProject(location, project);
- String[] gOptions = new String[]{"-d",repoName};
+ String[] gOptions = new String[]{"-d", location.getLocation()};
String[] lOptions = new String[]{"-m","msg"};
String[] args = new String[]{project,"a","b"};
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/SameResultEnv.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/SameResultEnv.java
index a17ffc143..25f6d6273 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/SameResultEnv.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/SameResultEnv.java
@@ -88,18 +88,8 @@ public final class SameResultEnv extends JUnitTestCase {
* Deletes files on the both of the cvs-servers.
*/
public void magicDeleteRemote(String project) throws CVSException {
-
- referenceClientRepository = CompatibleTestSetup.referenceClientRepository;
- eclipseClientRepository = CompatibleTestSetup.eclipseClientRepository;
-
- String host1 = referenceClientRepository.getHost();
- String repoRoot1 = referenceClientRepository.getRootDirectory();
-
- String host2 = eclipseClientRepository.getHost();
- String repoRoot2 = eclipseClientRepository.getRootDirectory();
-
- magicDeleteProject(host1,repoRoot1,project);
- magicDeleteProject(host2,repoRoot2,project);
+ magicDeleteProject(CompatibleTestSetup.referenceClientRepository,project);
+ magicDeleteProject(CompatibleTestSetup.eclipseClientRepository,project);
}
/**

Back to the top