Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-02-27 17:20:20 -0500
committerMichael Valenta2002-02-27 17:20:20 -0500
commit4b8f124862657edd8db4773d38759949fc1cdfc2 (patch)
tree2254efbfdb67b5bec7f740a05717627741263dbd
parentfd8787a996bd844702a4b06414c3a2f4ad29ea1c (diff)
downloadeclipse.platform.team-4b8f124862657edd8db4773d38759949fc1cdfc2.tar.gz
eclipse.platform.team-4b8f124862657edd8db4773d38759949fc1cdfc2.tar.xz
eclipse.platform.team-4b8f124862657edd8db4773d38759949fc1cdfc2.zip
*** empty log message ***
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/JUnitTestCase.java14
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/BasicTest.java8
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/ConflictTest.java2
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/ModuleTest.java239
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/ReferenceClient.java34
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/SameResultEnv.java23
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CVSProviderTest.java5
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CommandsTest.java12
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ModuleTest.java2
9 files changed, 279 insertions, 60 deletions
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 725d7c106..c5bf9c5ec 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
@@ -210,17 +210,17 @@ public abstract class JUnitTestCase extends TestCase {
/**
* Delete a project/resource form the standard cvs-server
*/
- protected void magicDeleteProject(String project) throws CVSException {
+ protected void deleteRemoteResource(String project) throws CVSException {
CVSRepositoryLocation location = CVSRepositoryLocation.fromString(REPOSITORY_NAME);
String host = location.getHost();
String repoRoot = location.getRootDirectory();
- magicDeleteProject(location, project);
+ deleteRemoteResource(location, project);
}
/**
* Delete a project/resource form the standard cvs-server
*/
- protected static void magicDeleteProject(ICVSRepositoryLocation location, String project) throws CVSException {
+ protected static void deleteRemoteResource(ICVSRepositoryLocation location, String project) throws CVSException {
String commandLine;
Process process;
@@ -246,9 +246,9 @@ public abstract class JUnitTestCase extends TestCase {
* Set the project on the standard cvs-server up so that it contains the resources
* in createResources. The files have random content.
*/
- public void magicSetUpRepo(String project, String[] createResources) throws CVSException {
+ public void createRemoteProject(String project, String[] createResources) throws CVSException {
CVSRepositoryLocation location = CVSRepositoryLocation.fromString(REPOSITORY_NAME);
- magicSetUpRepo(workspaceRoot, location ,project, createResources);
+ createRemoteProject(workspaceRoot, location ,project, createResources);
}
/**
@@ -262,7 +262,7 @@ 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, ICVSRepositoryLocation location, String project, String[] createResources) throws CVSException {
+ private static void createRemoteProject(File root, ICVSRepositoryLocation location, String project, String[] createResources) throws CVSException {
File workFolder;
@@ -270,7 +270,7 @@ public abstract class JUnitTestCase extends TestCase {
createRandomFile(workFolder, createResources);
- magicDeleteProject(location, project);
+ deleteRemoteResource(location, project);
String[] gOptions = new String[]{"-d", location.getLocation()};
String[] lOptions = new String[]{"-m","msg"};
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/BasicTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/BasicTest.java
index 7e6a159d2..3ad5d3062 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/BasicTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/BasicTest.java
@@ -23,7 +23,7 @@ public class BasicTest extends JUnitTestCase {
}
public BasicTest() {
- this("BasicTest");
+ this(null);
}
public static void main(String[] args) {
@@ -40,7 +40,7 @@ public class BasicTest extends JUnitTestCase {
env2.setUp();
// Set the project to the content we need ...
- env1.magicSetUpRepo("proj2",new String[]{"a.txt","f1/b.txt","f1/c.txt"});
+ env1.createRemoteProject("proj2",new String[]{"a.txt","f1/b.txt","f1/c.txt"});
env2.deleteFile("proj2");
}
@@ -383,7 +383,7 @@ public class BasicTest extends JUnitTestCase {
public void testImportWrappers() throws Exception {
// Make the project empty
- env1.magicSetUpRepo("proj3",new String[]{"NoImportant.txt"});
+ env1.createRemoteProject("proj3",new String[]{"NoImportant.txt"});
env2.deleteFile("proj3");
// Create resouces and import them with the
@@ -400,7 +400,7 @@ public class BasicTest extends JUnitTestCase {
public void testImportIgnores() throws Exception {
// Make the project empty
- env1.magicSetUpRepo("proj3",new String[]{"NoImportant.txt"});
+ env1.createRemoteProject("proj3",new String[]{"NoImportant.txt"});
env2.deleteFile("proj3");
// Create resouces and import them with the
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/ConflictTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/ConflictTest.java
index e45529e3a..16080d5e9 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/ConflictTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/ConflictTest.java
@@ -29,7 +29,7 @@ public class ConflictTest extends JUnitTestCase {
env2.setUp();
// Set the project to the content we need ...
- env1.magicSetUpRepo("proj2",new String[]{"a.txt","f1/b.txt","f1/c.txt"});
+ env1.createRemoteProject("proj2",new String[]{"a.txt","f1/b.txt","f1/c.txt"});
env2.deleteFile("proj2");
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/ModuleTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/ModuleTest.java
index feaa6b68c..b444713f1 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/ModuleTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/ModuleTest.java
@@ -11,32 +11,26 @@ import org.eclipse.team.tests.ccvs.core.JUnitTestCase;
public class ModuleTest extends JUnitTestCase {
SameResultEnv env1;
- SameResultEnv env2;
+
+ public ModuleTest() {
+ this(null);
+ }
public ModuleTest(String arg) {
super(arg);
- env1 = new SameResultEnv(arg,getFile("checkout1"));
- env2 = new SameResultEnv(arg,getFile("checkout2"));
- }
-
- public static void main(String[] args) {
- run(ModuleTest.class);
+ env1 = new SameResultEnv(arg, getFile("checkout1"));
}
public void setUp() throws Exception {
env1.setUp();
- env2.setUp();
// Set the project to the content we need ...
- env1.magicDeleteRemote("CVSROOT/modules");
- env1.magicDeleteRemote("CVSROOT/modules,v");
- env1.magicSetUpRepo("proj2",new String[]{"a.txt","f1/b.txt","f1/c.txt","f2/d.txt","f2/f3/e.txt"});
- env2.deleteFile("proj2");
+ env1.deleteRemoteResource("CVSROOT/modules");
+ env1.deleteRemoteResource("CVSROOT/modules,v");
}
public void tearDown() throws Exception {
env1.tearDown();
- env2.tearDown();
}
public static Test suite() {
@@ -57,34 +51,239 @@ public class ModuleTest extends JUnitTestCase {
}
public void testSimpleModule() throws Exception {
+
setUpModuleFile(new String[]{"mod1 proj2"});
+ env1.createRemoteProject("proj2",new String[]{"a.txt","f1/b.txt","f1/c.txt","f2/d.txt","f2/f3/e.txt"});
+
env1.execute("co",EMPTY_ARGS,new String[]{"mod1"});
+ env1.execute("co",new String[] {"-d", "mod1-copy"}, new String[]{"mod1"});
+
env1.appendToFile("mod1/a.txt","Append");
env1.execute("ci",new String[]{"-m","m"},new String[]{"mod1"});
+
env1.execute("update",EMPTY_ARGS,new String[]{"mod1"});
+ env1.execute("update",EMPTY_ARGS,new String[]{"mod1-copy"});
}
public void testCompositeModule() throws Exception {
- setUpModuleFile(new String[]{ "mod1-f1 proj2/f1",
- "mod1-f2 proj2/f2",
- "mod1f &mod1-f1 &mod1-f2"});
+
+ setUpModuleFile(new String[]{
+ "mod1-f1 proj2/f1",
+ "mod1-f2 proj2/f2",
+ "mod1f &mod1-f1 &mod1-f2"});
+ env1.createRemoteProject("proj2",new String[]{"a.txt","f1/b.txt","f1/c.txt","f2/d.txt","f2/f3/e.txt"});
env1.execute("co",EMPTY_ARGS,new String[]{"mod1f"});
+ env1.execute("co",new String[] {"-d", "mod1f-copy"}, new String[]{"mod1f"});
+
env1.appendToFile("mod1f/mod1-f1/b.txt","Append");
+ env1.appendToFile("mod1f/mod1-f2/d.txt","Append");
env1.execute("ci",new String[]{"-m","m"},new String[]{"mod1f"});
+
env1.execute("update",EMPTY_ARGS,new String[]{"mod1f"});
+ env1.execute("update",EMPTY_ARGS,new String[]{"mod1f-copy"});
}
public void testCompositeAliasModule() throws Exception {
- setUpModuleFile(new String[]{"mod1-f1 proj2/f1",
- "mod1t proj2/f1 b.txt",
- "mod1-f2 &proj2/f2 &mod1t",
- "mod1f -a mod1-f1 mod1-f2"});
+
+ setUpModuleFile(new String[]{
+ "mod1-f1 proj2/f1",
+ "mod1t proj2/f1 b.txt",
+ "mod1-f2 &proj2/f2 &mod1t", // XXX &proj2 is not a moduel definition!!!
+ "mod1f -a mod1-f1 mod1-f2"});
+ env1.createRemoteProject("proj2",new String[]{"a.txt","f1/b.txt","f1/c.txt","f2/d.txt","f2/f3/e.txt"});
env1.execute("co",EMPTY_ARGS,new String[]{"mod1f"});
+ env1.execute("co",new String[] {"-d", "mod1f-copy"}, new String[]{"mod1f"});
+
+ env1.appendToFile("mod1-f1/c.txt","Append");
+ env1.appendToFile("mod1-f2/mod1t/b.txt","Append");
env1.appendToFile("mod1-f1/b.txt","Append");
env1.execute("ci",new String[]{"-m","m"},new String[]{"mod1-f1","mod1-f2"});
+
env1.execute("update",EMPTY_ARGS,new String[]{"mod1-f1","mod1-f2"});
+ env1.execute("update",EMPTY_ARGS,new String[]{"mod1f-copy"});
}
+
+ public void testSelfReferencingModule() throws Exception {
+
+ // Setup the modules file and
+ setUpModuleFile(new String[]{
+ "project1 project1 &project2",
+ "project2 project2"});
+ env1.createRemoteProject("project1",new String[]{"a.txt","f1/b.txt","f1/c.txt","f2/d.txt","f2/f3/e.txt"});
+ env1.createRemoteProject("project2",new String[]{"e.txt","f10/b.txt","f10/c.txt","f20/d.txt","f20/f30/e.txt"});
+
+ // Checkout the module and a copy of the module
+ env1.execute("co",EMPTY_ARGS,new String[]{"project1"});
+ env1.execute("co",new String[] {"-d", "project1-copy"}, new String[]{"project1"});
+
+ // Change some files in directories mapped to different remote dirs
+ env1.appendToFile("project1/a.txt","Append");
+ env1.appendToFile("project1/project2/e.txt","Append More");
+ env1.execute("ci", new String[]{"-m","m"}, new String[]{"project1"});
+
+ // Update the project and the copy
+ env1.execute("update",EMPTY_ARGS,new String[]{"project1"});
+ env1.execute("update",EMPTY_ARGS,new String[]{"project1-copy"});
+ }
+
+ public void testMinusD() throws Exception {
+
+ // Setup the modules file and
+ setUpModuleFile(new String[]{
+ "help-docs -d docs common/docs",
+ "macros common/macros",
+ "project project &help-docs" });
+ env1.createRemoteProject("common",new String[]{"docs/readme.txt","macros/macro1"});
+ env1.createRemoteProject("project",new String[]{"file-p2.txt"});
+
+ // Checkout the module and a copy of the module
+ env1.execute("co",EMPTY_ARGS,new String[]{"help-docs"});
+ env1.execute("co",new String[] {"-d", "docs-copy"}, new String[]{"help-docs"});
+
+ // Change some files in directories mapped to different remote dirs
+ env1.appendToFile("docs/readme.txt","Append");;
+ env1.execute("ci", new String[]{"-m","m"}, new String[]{"docs"});
+
+ // Update the project and the copy
+ env1.execute("update",EMPTY_ARGS,new String[]{"docs"});
+ env1.execute("update",EMPTY_ARGS,new String[]{"docs-copy"});
+
+ // Checkout the module and a copy of the module
+ env1.execute("co",EMPTY_ARGS,new String[]{"macros"});
+ env1.execute("co",new String[] {"-d", "macros-copy"}, new String[]{"macros"});
+
+ // Change some files in directories mapped to different remote dirs
+ env1.appendToFile("macros/macro1","Append");;
+ env1.execute("ci", new String[]{"-m","m"}, new String[]{"macros"});
+
+ // Update the project and the copy
+ env1.execute("update",EMPTY_ARGS,new String[]{"macros"});
+ env1.execute("update",EMPTY_ARGS,new String[]{"macros-copy"});
+
+ // Checkout the module and a copy of the module
+ env1.execute("co",EMPTY_ARGS,new String[]{"project"});
+ env1.execute("co",new String[] {"-d", "project-copy"}, new String[]{"project"});
+
+ // Change some files in directories mapped to different remote dirs
+ env1.appendToFile("project/docs/readme.txt","Append");;
+ env1.execute("ci", new String[]{"-m","m"}, new String[]{"project"});
+
+ // Update the project and the copy
+ env1.execute("update",EMPTY_ARGS,new String[]{"project"});
+ env1.execute("update",EMPTY_ARGS,new String[]{"project-copy"});
+ }
+
+ public void testFileAlias() throws Exception {
+
+ // Setup the modules file and
+ setUpModuleFile(new String[]{
+ "project3-src project3/src",
+ "project3-src_file -a project3-src/file.c project3-src/file.h",
+ "project3-sub project3/sub &project3-src_file" });
+ env1.createRemoteProject("project3",new String[]{"src/file.c", "src/file.h", "sub/file-sub.txt"});
+
+ // Checkout the module and a copy of the module
+ env1.execute("co",EMPTY_ARGS,new String[]{"project3-sub"});
+ env1.execute("co",new String[] {"-d", "project3-sub-copy"}, new String[]{"project3-sub"});
+
+ // Change some files in directories mapped to different remote dirs
+ env1.appendToFile("project3-sub/project3-src/file.c","Append");
+ env1.execute("ci", new String[]{"-m","m"}, new String[]{"project3-sub"});
+
+ // Update the project and the copy
+ env1.execute("update",EMPTY_ARGS,new String[]{"project3-sub"});
+ env1.execute("update",EMPTY_ARGS,new String[]{"project3-sub-copy"});
+ }
+
+ public void testEmbedding() throws Exception {
+
+ // Setup the modules file and
+ setUpModuleFile(new String[]{
+ "macros common/macros",
+ "project4 project4 &macros",
+ "project5-project4 -d extensions/project4 project4",
+ "project5 project5 &project5-project4 &macros", });
+ env1.createRemoteProject("common",new String[]{"docs/readme.txt","macros/macro1"});
+ env1.createRemoteProject("project4",new String[]{"file-p4.txt"});
+ env1.createRemoteProject("project5",new String[]{"file-p5.txt"});
+
+ // Checkout the module and a copy of the module
+ env1.execute("co",EMPTY_ARGS,new String[]{"project4"});
+ env1.execute("co",new String[] {"-d", "project4-copy"}, new String[]{"project4"});
+
+ // Change some files in directories mapped to different remote dirs
+ env1.appendToFile("project4/file-p4.txt","Append");
+ env1.appendToFile("project4/macros/macro1","Append");;
+ env1.execute("ci", new String[]{"-m","m"}, new String[]{"project4"});
+
+ // Update the project and the copy
+ env1.execute("update",EMPTY_ARGS,new String[]{"project4"});
+ env1.execute("update",EMPTY_ARGS,new String[]{"project4-copy"});
+
+ // Checkout the module and a copy of the module
+ env1.execute("co",EMPTY_ARGS,new String[]{"project5"});
+ env1.execute("co",new String[] {"-d", "project5-copy"}, new String[]{"project5"});
+
+ // Change some files in directories mapped to different remote dirs
+ env1.appendToFile("project5/file-p5.txt","Append");
+ env1.appendToFile("project5/extensions/project4/file-p4.txt","Append");
+ env1.appendToFile("project5/macros/macro1","Append");
+ env1.execute("ci", new String[]{"-m","m"}, new String[]{"project5"});
+
+ // Update the project and the copy
+ env1.execute("update",EMPTY_ARGS,new String[]{"project5"});
+ env1.execute("update",EMPTY_ARGS,new String[]{"project5-copy"});
+
+ }
+
+ public void testEmbeddingDirectories() throws Exception {
+
+ // Setup the modules file and
+ setUpModuleFile(new String[]{
+ "project6-dirA -d dirA project6/A",
+ "project6-dirB -d dirB project6/B",
+ "project6 &project6-dirA &project6-dirB" });
+ env1.createRemoteProject("project6",new String[]{"A/a.txt", "B/b.txt", "c.txt"});
+
+ // Checkout the module and a copy of the module
+ env1.execute("co",EMPTY_ARGS,new String[]{"project6"});
+ env1.execute("co",new String[] {"-d", "project6-copy"}, new String[]{"project6"});
+
+ // Change some files in directories mapped to different remote dirs
+ env1.appendToFile("project6/dirA/a.txt","Append");
+ env1.appendToFile("project6/dirB/b.txt","Append");
+ env1.execute("ci", new String[]{"-m","m"}, new String[]{"project6"});
+
+ // Update the project and the copy
+ env1.execute("update",EMPTY_ARGS,new String[]{"project6"});
+ env1.execute("update",EMPTY_ARGS,new String[]{"project6-copy"});
+ }
+
+ public void testAliasPackaging() throws Exception {
+
+ // Setup the modules file and
+ setUpModuleFile(new String[]{
+ "project7-common -a project7/common",
+ "project7-pc -a project7-common project7/pc",
+ "project7-linux -a project7-common project7/linux" });
+ env1.createRemoteProject("project7",new String[]{"common/com.txt", "pc/file.txt", "linux/file.txt"});
+
+ // Checkout the module and a copy of the module
+ env1.execute("co",EMPTY_ARGS,new String[]{"project7-pc"});
+ // XXX The reference client does not allow the following checkout
+// env1.execute("co",new String[] {"-d", "project7-pc-copy"}, new String[]{"project7-pc"});
+
+ // Change some files in directories mapped to different remote dirs
+ env1.appendToFile("project7/common/com.txt","Append");
+ env1.appendToFile("project7/pc/file.txt","Append");
+ env1.execute("ci", new String[]{"-m","m"}, new String[]{"project7"});
+
+ // Update the project and the copy
+ env1.execute("update",EMPTY_ARGS,new String[]{"project7"});
+// env1.execute("update",EMPTY_ARGS,new String[]{"project7-pc-copy"});
+ }
+
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/ReferenceClient.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/ReferenceClient.java
index 8447ab552..6b47c08b2 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/ReferenceClient.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/ReferenceClient.java
@@ -5,6 +5,7 @@ package org.eclipse.team.tests.ccvs.core.compatible;
*/
import java.io.BufferedReader;
import java.io.File;
+import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
@@ -14,6 +15,7 @@ import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.client.Session;
import org.eclipse.team.internal.ccvs.core.resources.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.util.SyncFileUtil;
+import org.eclipse.team.tests.ccvs.core.CVSTestSetup;
/**
* This class is responsible for executing cvs commands using
@@ -22,6 +24,9 @@ import org.eclipse.team.internal.ccvs.core.util.SyncFileUtil;
public class ReferenceClient {
public static final String cvsLocation = System.getProperty("eclipse.cvs.command");
+
+ private static final String logFileName = "cvslog";
+
/**
* Puts opetions into one String seperated by
* space.
@@ -85,7 +90,12 @@ public class ReferenceClient {
// System.out.println(ioRoot.getPath() + "> " + commandLine);
try {
- process = runtime.exec(commandLine, null, ioRoot);
+ String[] envVars = null;
+ if (CVSTestSetup.DEBUG) {
+ // XXX This doesn't work.
+// envVars = new String[] { "CVS_CLIENT_LOG=" + logFileName };
+ }
+ process = runtime.exec(commandLine, envVars, ioRoot);
} catch (IOException e) {
throw new CVSException("IOException while executing ReferenceClient",e);
}
@@ -102,6 +112,19 @@ public class ReferenceClient {
throw new CVSException("InterruptedException while executing ReferenceClient",e);
}
+ if (CVSTestSetup.DEBUG) {
+// try {
+// File logFileIn = new File(ioRoot, logFileName + ".in");
+// File logFileOut = new File(ioRoot, logFileName + ".out");
+// printLogFile(logFileIn);
+// printLogFile(logFileOut);
+// logFileIn.delete();
+// logFileOut.delete();
+// } catch (IOException e) {
+// throw new ReferenceException("Error reading log files");
+// }
+ }
+
if (process.exitValue() != 0) {
throw new ReferenceException("Return Code of CVS reference client: " +
process.exitValue() + "\nwhile executing: " +
@@ -156,6 +179,15 @@ public class ReferenceClient {
return repoName.substring(0,colonPlace) + repoName.substring(atPlace);
}
+
+ private static void printLogFile(File logFile) throws IOException {
+ System.out.println("/nReference client: " + logFile.getName());
+ BufferedReader reader = new BufferedReader(new FileReader(logFile));
+ String line;
+ while ((line = reader.readLine()) != null) {
+ System.out.println(line);
+ }
+ }
}
/**
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 e5df2863b..b2235d6c6 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,33 +88,20 @@ public final class SameResultEnv extends JUnitTestCase {
/**
* Deletes files on the both of the cvs-servers.
*/
- public void magicDeleteRemote(String project) throws CVSException {
- magicDeleteProject(CompatibleTestSetup.referenceClientRepository,project);
- magicDeleteProject(CompatibleTestSetup.eclipseClientRepository,project);
- }
-
- /**
- * Set up both of the repos on the cvs-server(s) with the standard
- * file-structure:
- * project
- * a.txt
- * f1
- * b.txt
- * c.txt
- */
- public void magicSetUpRepo(String project) throws CVSException {
- magicSetUpRepo(project,new String[]{"a.txt","f1/b.txt","f1/c.txt"});
+ public void deleteRemoteResource(String project) throws CVSException {
+ deleteRemoteResource(CompatibleTestSetup.referenceClientRepository,project);
+ deleteRemoteResource(CompatibleTestSetup.eclipseClientRepository,project);
}
/**
* Set up both of the repos on the cvs-server(s) with a filestructre
* resulting for your input in the parameter createResources.
*/
- public void magicSetUpRepo(String project,String[] createResources) throws CVSException {
+ public void createRemoteProject(String project,String[] createResources) throws CVSException {
// This will trigger asynchronizer reload
// deleteFile(project);
- magicDeleteRemote(project);
+ deleteRemoteResource(project);
createRandomFile(createResources, project);
execute("import",new String[]{"-m","msg"},new String[]{project,"a","b"},project);
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CVSProviderTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CVSProviderTest.java
index f554913bc..aad869432 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CVSProviderTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CVSProviderTest.java
@@ -40,8 +40,8 @@ public class CVSProviderTest extends EclipseTest {
public static Test suite() {
TestSuite suite = new TestSuite(CVSProviderTest.class);
- return new CVSTestSetup(suite);
- //return new CVSTestSetup(new CVSProviderTest("testPruning"));
+ //return new CVSTestSetup(suite);
+ return new CVSTestSetup(new CVSProviderTest("testGet"));
}
public void testAddAndDelete() throws TeamException, CoreException {
@@ -159,6 +159,7 @@ public class CVSProviderTest extends EclipseTest {
addResources(copy, new String[] { "added.txt", "folder2/", "folder2/added.txt" }, false);
deleteResources(copy, new String[] {"deleted.txt"}, false);
IFile file = copy.getFile("changed.txt");
+ JUnitTestCase.waitMsec(1500);
file.setContents(getRandomContents(), false, false, null);
// get the remote conetns
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CommandsTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CommandsTest.java
index 23b2fc7cc..c637a694e 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CommandsTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/CommandsTest.java
@@ -46,7 +46,7 @@ public class CommandsTest extends JUnitTestCase {
public void setUp() throws Exception {
if (!isSetUp) {
try {
- magicSetUpRepo("proj1", new String[] { "folder1/c.txt", "folder1/d.txt", "folder2/test.flag"});
+ createRemoteProject("proj1", new String[] { "folder1/c.txt", "folder1/d.txt", "folder2/test.flag"});
} catch (Exception e) {
System.err.println("Could not setup repository");
}
@@ -168,8 +168,8 @@ public class CommandsTest extends JUnitTestCase {
// Do the setup ...
- magicSetUpRepo("coProject1",new String[]{"a.txt","f1/b.txt","f1/c.txt","f2/d.txt"});
- magicSetUpRepo("coProject2",new String[]{"a.txt","f1/b.txt","f1/c.txt","f2/d.txt"});
+ createRemoteProject("coProject1",new String[]{"a.txt","f1/b.txt","f1/c.txt","f2/d.txt"});
+ createRemoteProject("coProject2",new String[]{"a.txt","f1/b.txt","f1/c.txt","f2/d.txt"});
execute("co",
globalOptions,
@@ -437,8 +437,8 @@ public class CommandsTest extends JUnitTestCase {
public void testDoubleCheckout() throws Exception {
- magicSetUpRepo("coProject1",new String[]{"a.txt","f1/b.txt","f1/c.txt","f2/d.txt"});
- magicSetUpRepo("coProject2",new String[]{"a.txt","f1/b.txt","f1/c.txt","f2/d.txt"});
+ createRemoteProject("coProject1",new String[]{"a.txt","f1/b.txt","f1/c.txt","f2/d.txt"});
+ createRemoteProject("coProject2",new String[]{"a.txt","f1/b.txt","f1/c.txt","f2/d.txt"});
execute("co",
globalOptions,
EMPTY_ARGS,
@@ -464,7 +464,7 @@ public class CommandsTest extends JUnitTestCase {
String[] fileStructure = new String[]{"im/a.txt","im/f1/a.txt","im/f1/b.txt"};
createRandomFile(ioFolder,fileStructure);
- magicDeleteProject("im");
+ deleteRemoteResource("im");
execute("import",globalOptions,
new String[]{"-m","Initial Release"},
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ModuleTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ModuleTest.java
index 6b21dacc0..f1c72e5b0 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ModuleTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/ModuleTest.java
@@ -47,7 +47,7 @@ public class ModuleTest extends EclipseTest {
public static Test suite() {
TestSuite suite = new TestSuite(ModuleTest.class);
//return new CVSTestSetup(suite);
- return new CVSTestSetup(new ModuleTest("testSimpleAlias"));
+ return new CVSTestSetup(new ModuleTest("testAliasForFiles"));
}
private static boolean isSetUp = false;

Back to the top