Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2002-02-27 11:37:14 -0500
committerJean Michel-Lemieux2002-02-27 11:37:14 -0500
commit6e814e99c13f430583a21740d6ba8d4701cbe159 (patch)
treea4c77bd560416c29a94950c210144a1140dacb1c
parent39e1d5717a04030eb2d65de4601b332e9beba250 (diff)
downloadeclipse.platform.team-6e814e99c13f430583a21740d6ba8d4701cbe159.tar.gz
eclipse.platform.team-6e814e99c13f430583a21740d6ba8d4701cbe159.tar.xz
eclipse.platform.team-6e814e99c13f430583a21740d6ba8d4701cbe159.zip
Added conflicting tests
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/ConflictTest.java16
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/compatible/SameResultEnv.java15
2 files changed, 21 insertions, 10 deletions
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 326af5b29..e45529e3a 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
@@ -6,6 +6,7 @@ package org.eclipse.team.tests.ccvs.core.compatible;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.connection.CVSServerException;
import org.eclipse.team.tests.ccvs.core.JUnitTestCase;
public class ConflictTest extends JUnitTestCase {
@@ -23,10 +24,6 @@ public class ConflictTest extends JUnitTestCase {
env2 = new SameResultEnv(arg, getFile("checkout2"));
}
- public static void main(String[] args) {
- run(ConflictTest.class);
- }
-
public void setUp() throws Exception {
env1.setUp();
env2.setUp();
@@ -43,6 +40,7 @@ public class ConflictTest extends JUnitTestCase {
public static Test suite() {
TestSuite suite = new TestSuite(ConflictTest.class);
+ //return new CompatibleTestSetup(new ConflictTest("testSimpleConflict"));
return new CompatibleTestSetup(suite);
}
@@ -62,11 +60,15 @@ public class ConflictTest extends JUnitTestCase {
// and submit the merge
env2.execute("update",EMPTY_ARGS,new String[]{"proj2"},"");
+ // commit must fail because we have a merged conflict which has not been
+ // edited.
+ env2.setIgnoreExceptions(true);
+ env2.execute("ci",new String[]{"-m","TestMessage"},new String[]{"proj2"},"");
+ env2.setIgnoreExceptions(false);
+
// Make a change to the file in order to let the cvs-client know
// that we solved the confilict
env2.appendToFile("proj2/f1/c.txt","That's allright");
-
env2.execute("ci",new String[]{"-m","TestMessage"},new String[]{"proj2"},"");
}
-}
-
+} \ No newline at end of file
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 25f6d6273..e5df2863b 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
@@ -48,6 +48,7 @@ public final class SameResultEnv extends JUnitTestCase {
private File referenceClientRoot;
private File eclipseClientRoot;
private boolean ignoreExceptions=false;
+ private boolean expectExceptions=false;
private CVSRepositoryLocation referenceClientRepository;
private CVSRepositoryLocation eclipseClientRepository;
@@ -202,6 +203,9 @@ public final class SameResultEnv extends JUnitTestCase {
assertNotNull(globalOptions1);
assertNotNull(globalOptions);
+ boolean referenceClientException = false;
+ boolean eclipseClientException = false;
+
localOptions = notNull(localOptions);
arguments = notNull(arguments);
if (rootExtention == null || rootExtention.equals(".")) {
@@ -217,6 +221,7 @@ public final class SameResultEnv extends JUnitTestCase {
new NullProgressMonitor(),
new PrintStream(new NullOutputStream()));
} catch (ReferenceException e) {
+ referenceClientException = true;
if (!ignoreExceptions) {
throw e;
}
@@ -231,10 +236,14 @@ public final class SameResultEnv extends JUnitTestCase {
new NullProgressMonitor(),
new PrintStream(new NullOutputStream()));
} catch (CVSServerException e) {
+ eclipseClientException = true;
if (!ignoreExceptions) {
throw e;
}
}
+ if(ignoreExceptions) {
+ assertEquals(referenceClientException == true, eclipseClientException == true);
+ }
assertConsistent();
}
@@ -353,7 +362,7 @@ public final class SameResultEnv extends JUnitTestCase {
File file2 = new File(eclipseClientRoot,relativeFileName);
// Wait a second so that the timestamp will change for sure
- //waitMsec(1100);
+ waitMsec(2000);
appendToFile(file1,txt);
appendToFile(file2,txt);
@@ -458,8 +467,8 @@ public final class SameResultEnv extends JUnitTestCase {
private static void assertTimestampEquals(String timestamp1, String timestamp2) {
try {
EntryFileDateFormat timestampFormat = new EntryFileDateFormat();
- boolean merge1 = timestamp1.indexOf(ResourceSyncInfo.RESULT_OF_MERGE) != -1;
- boolean merge2 = timestamp2.indexOf(ResourceSyncInfo.RESULT_OF_MERGE) != -1;
+ boolean merge1 = timestamp1.indexOf(ResourceSyncInfo.RESULT_OF_MERGE_CONFLICT) != -1;
+ boolean merge2 = timestamp2.indexOf(ResourceSyncInfo.RESULT_OF_MERGE_CONFLICT) != -1;
boolean dummy1 = timestamp1.indexOf(ResourceSyncInfo.DUMMY_TIMESTAMP) != -1;
boolean dummy2 = timestamp2.indexOf(ResourceSyncInfo.DUMMY_TIMESTAMP) != -1;
assertEquals("both timestamps should show same conflict state", merge1, merge2);

Back to the top