Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-08-25 07:04:18 +0000
committerEike Stepper2012-08-25 07:04:18 +0000
commit3bf63e0d76d131a8ac991c21336cd405cd214479 (patch)
tree936aecae8689b15fec645f5923efc4c9e1071fc9 /plugins
parent0513c46d0b1db92945cb675305b77395c93b8282 (diff)
downloadcdo-3bf63e0d76d131a8ac991c21336cd405cd214479.tar.gz
cdo-3bf63e0d76d131a8ac991c21336cd405cd214479.tar.xz
cdo-3bf63e0d76d131a8ac991c21336cd405cd214479.zip
Don't iterate infinitely when no quick fixes apply anymore
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.version.tests/src/org/eclipse/emf/cdo/releng/version/tests/VersionBuilderTest.java30
1 files changed, 18 insertions, 12 deletions
diff --git a/plugins/org.eclipse.emf.cdo.releng.version.tests/src/org/eclipse/emf/cdo/releng/version/tests/VersionBuilderTest.java b/plugins/org.eclipse.emf.cdo.releng.version.tests/src/org/eclipse/emf/cdo/releng/version/tests/VersionBuilderTest.java
index 80a8b46129..bb90e79208 100644
--- a/plugins/org.eclipse.emf.cdo.releng.version.tests/src/org/eclipse/emf/cdo/releng/version/tests/VersionBuilderTest.java
+++ b/plugins/org.eclipse.emf.cdo.releng.version.tests/src/org/eclipse/emf/cdo/releng/version/tests/VersionBuilderTest.java
@@ -95,15 +95,21 @@ public class VersionBuilderTest extends TestCase
MSG.println(" Update workspace");
updateWorkspace(phase);
IMarker[] markers = buildWorkspace(phase, clean);
- processMarkers(phase, markers, "build.markers");
+ String lastContents = processMarkers(phase, markers, "build.markers");
int fixAttempt = 0;
- while (markers.length != 0) // TODO Can be inifinite?
+ while (markers.length != 0)
{
MSG.println(" Fix workspace (attempt " + ++fixAttempt + ")");
fixWorkspace(phase, markers);
markers = buildWorkspace(phase, false);
- processMarkers(phase, markers, "fix" + fixAttempt + ".markers");
+ String contents = processMarkers(phase, markers, "fix" + fixAttempt + ".markers");
+ if (contents.equals(lastContents))
+ {
+ break;
+ }
+
+ lastContents = contents;
}
}
@@ -259,33 +265,33 @@ public class VersionBuilderTest extends TestCase
}
}
- private void processMarkers(BundleFile phase, IMarker[] markers, String fileName) throws Throwable
+ private String processMarkers(BundleFile phase, IMarker[] markers, String fileName) throws Throwable
{
BundleFile markersFile = phase.getChild(fileName);
if (markersFile != null)
{
MSG.println(" Check markers");
- checkMarkers(phase, markers, markersFile);
- }
- else
- {
- MSG.println(" Generate markers");
- generateMarkers(phase, markers, fileName);
+ return checkMarkers(phase, markers, markersFile);
}
+
+ MSG.println(" Generate markers");
+ return generateMarkers(phase, markers, fileName);
}
- private void checkMarkers(BundleFile phase, IMarker[] markers, BundleFile markersFile) throws Throwable
+ private String checkMarkers(BundleFile phase, IMarker[] markers, BundleFile markersFile) throws Throwable
{
String expected = markersFile.getContents();
String actual = createMarkers(markers);
assertEquals("After " + phase.getName() + " build", expected, actual);
+ return actual;
}
- private void generateMarkers(BundleFile phase, IMarker[] markers, String fileName) throws Throwable
+ private String generateMarkers(BundleFile phase, IMarker[] markers, String fileName) throws Throwable
{
String contents = createMarkers(markers);
BundleFile resultsFile = phase.addChild(fileName, false);
resultsFile.setContents(contents);
+ return contents;
}
private static String createMarkers(IMarker[] markers) throws Throwable

Back to the top