285604 - changed check to actually test in both scenarios.
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapterTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapterTests.java
index 570cdbb..feb41bd 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapterTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapterTests.java
@@ -446,32 +446,33 @@
}
public void testNewMarkerAnnotation24() throws Exception {
+ this.createAnnotationAndMembers("JoinColumn", "String name(); String text(); int num();");
+ this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
+ ICompilationUnit cu = this.createTestType("@annot.JoinColumn(text=\"blah\",num=42)");
- //This test should only run on WTP 3.2 builds for now (not 3.3)- see bug 285604
- //This condition should be removed and test updated after Dali 3.0 branches
+ //Use old formatting if jdt core version is 3.5 or below - see bug 285604
Version version = Platform.getBundle("org.eclipse.jdt.core").getVersion();
int majorVersion = version.getMajor();
int minorVersion = version.getMinor();
-
- //Don't run this test if jdt core version is above 3.5
+ //This condition should be removed and test updated after Dali 3.0 branches
+ String expected1;
if (majorVersion == 3 && minorVersion <= 5) {
- this.createAnnotationAndMembers("JoinColumn", "String name(); String text(); int num();");
- this.createAnnotationAndMembers("JoinColumns", "JoinColumn[] value();");
- ICompilationUnit cu = this.createTestType("@annot.JoinColumn(text=\"blah\",num=42)");
- String expected1 = "@JoinColumns( {";
- String expected2 = "@JoinColumn(text = \"blah\", num = 42), null,";
- String expected3 = "@JoinColumn " + CR + " })";
- this.assertSourceDoesNotContain(expected1, cu);
- this.assertSourceDoesNotContain(expected2, cu);
- this.assertSourceDoesNotContain(expected3, cu);
- DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
- "annot.JoinColumn", "annot.JoinColumns", "value", 2);
- AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
- aa.newMarkerAnnotation();
- this.assertSourceContains(expected1, cu);
- this.assertSourceContains(expected2, cu);
- this.assertSourceContains(expected3, cu);
+ expected1 = "@JoinColumns( {";
}
+ else expected1 = "@JoinColumns({";
+
+ String expected2 = "@JoinColumn(text = \"blah\", num = 42), null,";
+ String expected3 = "@JoinColumn " + CR + " })";
+ this.assertSourceDoesNotContain(expected1, cu);
+ this.assertSourceDoesNotContain(expected2, cu);
+ this.assertSourceDoesNotContain(expected3, cu);
+ DeclarationAnnotationAdapter daa = new CombinationIndexedDeclarationAnnotationAdapter(
+ "annot.JoinColumn", "annot.JoinColumns", "value", 2);
+ AnnotationAdapter aa = new MemberAnnotationAdapter(this.idField(cu), daa);
+ aa.newMarkerAnnotation();
+ this.assertSourceContains(expected1, cu);
+ this.assertSourceContains(expected2, cu);
+ this.assertSourceContains(expected3, cu);
}
public void testNewMarkerAnnotation25() throws Exception {