Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTran Le2015-05-22 14:17:45 +0000
committerTran Le2015-05-22 14:17:45 +0000
commit93c2c69a1ff09fa011814c5552b02621a5303dbb (patch)
tree59b516beba43f34713f82134f5f1ed38f7b2d31d
parent2d0308886b9dcbfd50cb6e044e828b3fa12e6a17 (diff)
downloadwebtools.dali-93c2c69a1ff09fa011814c5552b02621a5303dbb.tar.gz
webtools.dali-93c2c69a1ff09fa011814c5552b02621a5303dbb.tar.xz
webtools.dali-93c2c69a1ff09fa011814c5552b02621a5303dbb.zip
465989 - JptJpaCoreResourceModelTests test bucket reported 41 Junit
failures on WTP builds
-rw-r--r--common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/AnnotationTestCase.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/AnnotationTestCase.java b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/AnnotationTestCase.java
index 5ff1e5b90b..bec8b214d7 100644
--- a/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/AnnotationTestCase.java
+++ b/common/tests/org.eclipse.jpt.common.core.tests/src/org/eclipse/jpt/common/core/tests/internal/utility/jdt/AnnotationTestCase.java
@@ -461,26 +461,30 @@ public abstract class AnnotationTestCase
return ASTTools.buildASTRoot(cu);
}
+ protected boolean compilationUnitContains(String s, ICompilationUnit cu) throws JavaModelException {
+ String source = this.getSource(cu).replaceAll("\\s+","");
+ return !(source.indexOf(s.replaceAll("\\s+","")) == -1);
+ }
+
// ********** test validation **********
protected void assertSourceContains(String s, ICompilationUnit cu) throws JavaModelException {
- String source = this.getSource(cu);
- boolean found = source.indexOf(s) > -1;
+ boolean found = this.compilationUnitContains(s, cu);
if ( ! found) {
String msg = "source does not contain the expected string: " + s + " (see System console)";
System.out.println("*** " + this.getName() + " ****");
System.out.println(msg);
- System.out.println(source);
+ System.out.println(this.getSource(cu));
System.out.println();
fail(msg);
}
}
protected void assertSourceDoesNotContain(String s, ICompilationUnit cu) throws JavaModelException {
- String source = this.getSource(cu);
- int pos = source.indexOf(s);
- if (pos != -1) {
+ if (this.compilationUnitContains(s, cu)) {
+ String source = this.getSource(cu);
+ int pos = source.indexOf(s);
String msg = "unexpected string in source (position: " + pos + "): " + s + " (see System console)";
System.out.println("*** " + this.getName() + " ****");
System.out.println(msg);

Back to the top