Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2008-09-23 23:22:53 -0400
committerkmoore2008-09-23 23:22:53 -0400
commit463067d8c1f4728ad4e44e33b78aa39624e40ec5 (patch)
tree1919e55bfb3a71b5efc0054e7efae7e6db3be373
parentb34a5959fde9fac7fec13f8d5204efe896b2e2c2 (diff)
downloadwebtools.dali-463067d8c1f4728ad4e44e33b78aa39624e40ec5.tar.gz
webtools.dali-463067d8c1f4728ad4e44e33b78aa39624e40ec5.tar.xz
webtools.dali-463067d8c1f4728ad4e44e33b78aa39624e40ec5.zip
removed creation of annotation classes in java resource model tests
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/JptCoreTests.java2
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJpaProject.java10
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AssociationOverrideTests.java20
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AssociationOverridesTests.java29
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AttributeOverrideTests.java24
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AttributeOverridesTests.java30
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/BasicTests.java4
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ColumnTests.java20
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/DiscriminatorColumnTests.java16
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/DiscriminatorValueTests.java2
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddableTests.java3
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddedIdTests.java1
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddedTests.java1
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EntityTests.java4
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EnumeratedTests.java4
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/GeneratedValueTests.java12
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/IdClassTests.java6
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/IdTests.java1
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/InheritanceTests.java4
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourceModelTestCase.java13
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourcePersistentAttributeTests.java44
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourcePersistentTypeTests.java76
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinColumnTests.java18
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinColumnsTests.java25
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinTableTests.java30
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JpaCompilationUnitTests.java7
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/LobTests.java1
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ManyToManyTests.java13
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ManyToOneTests.java12
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/MapKeyTests.java2
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/MappedSuperclassTests.java3
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedNativeQueriesTests.java24
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedNativeQueryTests.java17
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedQueriesTests.java22
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedQueryTests.java15
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OneToManyTests.java12
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OneToOneTests.java13
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OrderByTests.java2
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/PrimaryKeyJoinColumnTests.java11
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/PrimaryKeyJoinColumnsTests.java18
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/QueryHintTests.java13
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SecondaryTableTests.java26
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SecondaryTablesTests.java31
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SequenceGeneratorTests.java14
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TableGeneratorTests.java21
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TableTests.java14
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TemporalTests.java4
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TransientTests.java1
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/VersionTests.java1
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/JptEclipseLinkCoreTests.java2
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/EclipseLinkJavaResourceModelTestCase.java4
51 files changed, 28 insertions, 674 deletions
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/JptCoreTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/JptCoreTests.java
index 9112d16371..a8d78e4627 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/JptCoreTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/JptCoreTests.java
@@ -27,7 +27,7 @@ import org.eclipse.jpt.core.tests.internal.utility.jdt.JptCoreUtilityJdtTests;
* until jpa.jar is checked into CVS.
*/
public class JptCoreTests {
- private static final String JPA_JAR_PROPERTY = TestJpaProject.JAR_NAME_SYSTEM_PROPERTY;
+ private static final String JPA_JAR_PROPERTY = TestJpaProject.JPA_JAR_NAME_SYSTEM_PROPERTY;
public static Test suite() {
return suite(false);
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJpaProject.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJpaProject.java
index 9a46addafb..539421cf53 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJpaProject.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/projects/TestJpaProject.java
@@ -25,7 +25,7 @@ import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
public class TestJpaProject extends TestJavaProject {
private final JpaProject jpaProject;
- public static final String JAR_NAME_SYSTEM_PROPERTY = "org.eclipse.jpt.jpa.jar";
+ public static final String JPA_JAR_NAME_SYSTEM_PROPERTY = "org.eclipse.jpt.jpa.jar";
// ********** builders **********
@@ -54,15 +54,15 @@ public class TestJpaProject extends TestJavaProject {
super(projectName, autoBuild);
this.installFacet("jst.utility", "1.0");
this.installFacet("jpt.jpa", "1.0", jpaConfig);
- this.addJar(this.jarName());
+ this.addJar(jpaJarName());
this.jpaProject = JptCorePlugin.getJpaProject(this.getProject());
this.jpaProject.setUpdater(new SynchronousJpaProjectUpdater(this.jpaProject));
}
- protected String jarName() {
- String jarName = System.getProperty(JAR_NAME_SYSTEM_PROPERTY);
+ public static String jpaJarName() {
+ String jarName = System.getProperty(JPA_JAR_NAME_SYSTEM_PROPERTY);
if (jarName == null) {
- throw new RuntimeException("missing Java system property: \"" + JAR_NAME_SYSTEM_PROPERTY + "\"");
+ throw new RuntimeException("missing Java system property: \"" + JPA_JAR_NAME_SYSTEM_PROPERTY + "\"");
}
return jarName;
}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AssociationOverrideTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AssociationOverrideTests.java
index eb2ee78333..97dd363619 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AssociationOverrideTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AssociationOverrideTests.java
@@ -27,26 +27,7 @@ public class AssociationOverrideTests extends JavaResourceModelTestCase {
super(name);
}
- private void createAssociationOverrideAnnotation() throws Exception {
- createJoinColumnAnnotation();
- this.createAnnotationAndMembers("AssociationOverride",
- "String name(); " +
- "JoinColumn[] joinColumns(); ");
- }
-
- private void createJoinColumnAnnotation() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name() default \"\";" +
- "String referencedColumnName() default \"\";" +
- "boolean unique() default false;" +
- "boolean nullable() default true;" +
- "boolean insertable() default true;" +
- "boolean updatable() default true;" +
- "String columnDefinition() default \"\";" +
- "String table() default \"\";");
- }
-
private ICompilationUnit createTestAssociationOverrideOnField() throws Exception {
- createAssociationOverrideAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -60,7 +41,6 @@ public class AssociationOverrideTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestAssociationOverrideWithJoinColumns() throws Exception {
- createAssociationOverrideAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AssociationOverridesTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AssociationOverridesTests.java
index 2703566784..f29bc099b2 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AssociationOverridesTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AssociationOverridesTests.java
@@ -28,34 +28,8 @@ public class AssociationOverridesTests extends JavaResourceModelTestCase {
public AssociationOverridesTests(String name) {
super(name);
}
-
- private void createAssociationOverrideAnnotation() throws Exception {
- createJoinColumnAnnotation();
- this.createAnnotationAndMembers("AssociationOverride",
- "String name(); " +
- "Column column(); ");
- }
-
- private void createAssociationOverridesAnnotation() throws Exception {
- createAssociationOverrideAnnotation();
- this.createAnnotationAndMembers("AssociationOverrides",
- "AssociationOverride[] value();");
- }
-
- private void createJoinColumnAnnotation() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name() default \"\";" +
- "String referencedColumnName() default \"\";" +
- "boolean unique() default false;" +
- "boolean nullable() default true;" +
- "boolean insertable() default true;" +
- "boolean updatable() default true;" +
- "String columnDefinition() default \"\";" +
- "String table() default \"\";");
-
- }
private ICompilationUnit createTestAssociationOverrideOnField() throws Exception {
- createAssociationOverridesAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -67,8 +41,8 @@ public class AssociationOverridesTests extends JavaResourceModelTestCase {
}
});
}
+
private ICompilationUnit createTestAssociationOverrideWithJoinColumns() throws Exception {
- createAssociationOverridesAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -82,7 +56,6 @@ public class AssociationOverridesTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestAssociationOverride() throws Exception {
- createAssociationOverridesAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AttributeOverrideTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AttributeOverrideTests.java
index e09c06b77f..b8b237e2af 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AttributeOverrideTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AttributeOverrideTests.java
@@ -26,30 +26,8 @@ public class AttributeOverrideTests extends JavaResourceModelTestCase {
public AttributeOverrideTests(String name) {
super(name);
}
-
- private void createAttributeOverrideAnnotation() throws Exception {
- this.createAnnotationAndMembers("AttributeOverride",
- "String name(); " +
- "Column column(); ");
- }
-
- private void createColumnAnnotation() throws Exception {
- this.createAnnotationAndMembers("Column",
- "String name() default \"\"; " +
- "boolean unique() default false; " +
- "boolean nullable() default true; " +
- "boolean insertable() default true; " +
- "boolean updatable() default true; " +
- "String columnDefinition() default \"\"; " +
- "String table() default \"\"; " +
- "int length() default 255; " +
- "int precision() default 0; " +
- "int scale() default 0;");
- }
private ICompilationUnit createTestAttributeOverrideOnField() throws Exception {
- createAttributeOverrideAnnotation();
- createColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -63,8 +41,6 @@ public class AttributeOverrideTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestAttributeOverrideWithColumnOnField() throws Exception {
- createAttributeOverrideAnnotation();
- createColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AttributeOverridesTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AttributeOverridesTests.java
index 1712d914ba..54484f58e7 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AttributeOverridesTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/AttributeOverridesTests.java
@@ -29,36 +29,8 @@ public class AttributeOverridesTests extends JavaResourceModelTestCase {
public AttributeOverridesTests(String name) {
super(name);
}
-
- private void createAttributeOverrideAnnotation() throws Exception {
- createColumnAnnotation();
- this.createAnnotationAndMembers("AttributeOverride",
- "String name(); " +
- "Column column(); ");
- }
-
- private void createAttributeOverridesAnnotation() throws Exception {
- createAttributeOverrideAnnotation();
- this.createAnnotationAndMembers("AttributeOverrides",
- "AttributeOverride[] value();");
- }
-
- private void createColumnAnnotation() throws Exception {
- this.createAnnotationAndMembers("Column",
- "String name() default \"\"; " +
- "boolean unique() default false; " +
- "boolean nullable() default true; " +
- "boolean insertable() default true; " +
- "boolean updatable() default true; " +
- "String columnDefinition() default \"\"; " +
- "String table() default \"\"; " +
- "int length() default 255; " +
- "int precision() default 0; " +
- "int scale() default 0;");
- }
private ICompilationUnit createTestAttributeOverrideOnField() throws Exception {
- createAttributeOverridesAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -72,7 +44,6 @@ public class AttributeOverridesTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestAttributeOverrideWithColumnOnField() throws Exception {
- createAttributeOverridesAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -86,7 +57,6 @@ public class AttributeOverridesTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestAttributeOverride() throws Exception {
- createAttributeOverridesAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/BasicTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/BasicTests.java
index 608c6ef248..7466cedd90 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/BasicTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/BasicTests.java
@@ -25,7 +25,6 @@ public class BasicTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestBasic() throws Exception {
- this.createAnnotationAndMembers("Basic", "boolean optional() default true;");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -39,7 +38,6 @@ public class BasicTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestBasicWithOptional() throws Exception {
- this.createAnnotationAndMembers("Basic", "boolean optional() default true;");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -53,8 +51,6 @@ public class BasicTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestBasicWithFetch() throws Exception {
- this.createAnnotationAndMembers("Basic", "boolean optional() default true; FetchType fetch() default FetchType.EAGER;");
- this.createEnumAndMembers("FetchType", "EAGER, LAZY");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ColumnTests.java
index a812d8438f..3f83b794b0 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ColumnTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ColumnTests.java
@@ -27,22 +27,7 @@ public class ColumnTests extends JavaResourceModelTestCase {
super(name);
}
- private void createColumnAnnotation() throws Exception {
- this.createAnnotationAndMembers("Column",
- "String name() default \"\"; " +
- "boolean unique() default false; " +
- "boolean nullable() default true; " +
- "boolean insertable() default true; " +
- "boolean updatable() default true; " +
- "String columnDefinition() default \"\"; " +
- "String table() default \"\"; " +
- "int length() default 255; " +
- "int precision() default 0; " +
- "int scale() default 0;");
- }
-
private ICompilationUnit createTestColumn() throws Exception {
- createColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -56,7 +41,6 @@ public class ColumnTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestColumnWithName() throws Exception {
- createColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -70,7 +54,6 @@ public class ColumnTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestColumnWithTable() throws Exception {
- createColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -84,7 +67,6 @@ public class ColumnTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestColumnWithColumnDefinition() throws Exception {
- createColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -98,7 +80,6 @@ public class ColumnTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestColumnWithBooleanElement(final String booleanElement) throws Exception {
- createColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -112,7 +93,6 @@ public class ColumnTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestColumnWithIntElement(final String intElement) throws Exception {
- createColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/DiscriminatorColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/DiscriminatorColumnTests.java
index 8aa31a5cfa..3861f1517c 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/DiscriminatorColumnTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/DiscriminatorColumnTests.java
@@ -25,18 +25,8 @@ public class DiscriminatorColumnTests extends JavaResourceModelTestCase {
public DiscriminatorColumnTests(String name) {
super(name);
}
-
- private void createDiscriminatorColumnAnnotation() throws Exception {
- this.createEnumAndMembers("DiscriminatorType", "STRING, CHAR, INTEGER");
- this.createAnnotationAndMembers("DiscriminatorColumn",
- "String name() default \"DTYPE\"; " +
- "DiscriminatorType discriminatorType() default STRING; " +
- "String columnDefinition() default \"\"; " +
- "int length() default 31;");
- }
-
+
private ICompilationUnit createTestDiscriminatorColumn() throws Exception {
- createDiscriminatorColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -50,7 +40,6 @@ public class DiscriminatorColumnTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestDiscriminatorColumnWithName() throws Exception {
- createDiscriminatorColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -64,7 +53,6 @@ public class DiscriminatorColumnTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestDiscriminatorColumnWithColumnDefinition() throws Exception {
- createDiscriminatorColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -78,7 +66,6 @@ public class DiscriminatorColumnTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestDiscriminatorColumnWithDiscriminatorType() throws Exception {
- createDiscriminatorColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -92,7 +79,6 @@ public class DiscriminatorColumnTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestColumnWithIntElement(final String intElement) throws Exception {
- createDiscriminatorColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/DiscriminatorValueTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/DiscriminatorValueTests.java
index db386b45e3..d0f324c909 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/DiscriminatorValueTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/DiscriminatorValueTests.java
@@ -23,7 +23,6 @@ public class DiscriminatorValueTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestDiscriminatorValue() throws Exception {
- this.createAnnotationAndMembers("DiscriminatorValue", "String value() default \"\";");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -37,7 +36,6 @@ public class DiscriminatorValueTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestDiscriminatorValueWithValue() throws Exception {
- this.createAnnotationAndMembers("DiscriminatorValue", "String value() default \"\";");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddableTests.java
index f4ab8532d0..c3b08cf132 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddableTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddableTests.java
@@ -25,7 +25,6 @@ public class EmbeddableTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestEmbeddable() throws Exception {
- this.createAnnotationAndMembers("Embeddable", "");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -39,8 +38,6 @@ public class EmbeddableTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestEmbeddableAndEntity() throws Exception {
- this.createAnnotationAndMembers("Embeddable", "");
- this.createAnnotationAndMembers("Entity", "");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddedIdTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddedIdTests.java
index c5b90335b7..59cf920031 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddedIdTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddedIdTests.java
@@ -26,7 +26,6 @@ public class EmbeddedIdTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestEmbeddedId() throws Exception {
- this.createAnnotationAndMembers("EmbeddedId", "");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddedTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddedTests.java
index db922e4ca2..bf4af0369b 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddedTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EmbeddedTests.java
@@ -26,7 +26,6 @@ public class EmbeddedTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestEmbedded() throws Exception {
- this.createAnnotationAndMembers("Embedded", "");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EntityTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EntityTests.java
index b2fcc69c28..1cb16ee1bc 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EntityTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EntityTests.java
@@ -28,7 +28,6 @@ public class EntityTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestEntity() throws Exception {
- this.createAnnotationAndMembers("Entity", "String name();");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -42,7 +41,6 @@ public class EntityTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestEntityWithName() throws Exception {
- this.createAnnotationAndMembers("Entity", "String name();");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -56,8 +54,6 @@ public class EntityTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestMappedSuperclassAndEntity() throws Exception {
- this.createAnnotationAndMembers("MappedSuperclass", "");
- this.createAnnotationAndMembers("Entity", "String name();");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EnumeratedTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EnumeratedTests.java
index 6c477083c9..3320eba968 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EnumeratedTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/EnumeratedTests.java
@@ -25,8 +25,6 @@ public class EnumeratedTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestEnumerated() throws Exception {
- this.createAnnotationAndMembers("Enumerated", "EnumType value();");
- this.createEnumAndMembers("EnumType", "ORDINAL, STRING");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -40,8 +38,6 @@ public class EnumeratedTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestEnumeratedWithValue() throws Exception {
- this.createAnnotationAndMembers("Enumerated", "EnumType value();");
- this.createEnumAndMembers("EnumType", "ORDINAL, STRING");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/GeneratedValueTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/GeneratedValueTests.java
index 7420cddd33..2f9051f27d 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/GeneratedValueTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/GeneratedValueTests.java
@@ -24,18 +24,8 @@ public class GeneratedValueTests extends JavaResourceModelTestCase {
public GeneratedValueTests(String name) {
super(name);
}
-
- private void createGenerationTypeEnum() throws Exception {
- this.createEnumAndMembers("GenerationType", "TABLE, SEQUENCE, IDENTITY, AUTO;");
- }
-
- private void createGeneratedValueAnnotation() throws Exception {
- this.createAnnotationAndMembers("GeneratedValue", "GenerationType strategy() default AUTO; String generator() default \"\"");
- createGenerationTypeEnum();
- }
private ICompilationUnit createTestGeneratedValue() throws Exception {
- createGeneratedValueAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -49,7 +39,6 @@ public class GeneratedValueTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestGeneratedValueWithGenerator() throws Exception {
- createGeneratedValueAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -63,7 +52,6 @@ public class GeneratedValueTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestGeneratedValueWithStrategy() throws Exception {
- createGeneratedValueAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/IdClassTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/IdClassTests.java
index d88f43bd6b..5c27438137 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/IdClassTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/IdClassTests.java
@@ -23,13 +23,8 @@ public class IdClassTests extends JavaResourceModelTestCase {
public IdClassTests(String name) {
super(name);
}
-
- private void createIdClassAnnotation() throws Exception {
- this.createAnnotationAndMembers("IdClass", "Class value();");
- }
private ICompilationUnit createTestIdClass() throws Exception {
- createIdClassAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -43,7 +38,6 @@ public class IdClassTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestIdClassWithValue() throws Exception {
- createIdClassAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/IdTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/IdTests.java
index 721454d21c..6f72af1f62 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/IdTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/IdTests.java
@@ -25,7 +25,6 @@ public class IdTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestId() throws Exception {
- this.createAnnotationAndMembers("Id", "");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/InheritanceTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/InheritanceTests.java
index a2058e6d22..cd6cc72c50 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/InheritanceTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/InheritanceTests.java
@@ -24,8 +24,6 @@ public class InheritanceTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestInheritance() throws Exception {
- this.createAnnotationAndMembers("Inheritance", "InheritanceType strategy() default SINGLE_TABLE;");
- this.createEnumAndMembers("InheritanceType", "SINGLE_TABLE, JOINED, TABLE_PER_CLASS");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -39,8 +37,6 @@ public class InheritanceTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestInheritanceWithStrategy() throws Exception {
- this.createAnnotationAndMembers("Inheritance", "InheritanceType strategy() default SINGLE_TABLE;");
- this.createEnumAndMembers("InheritanceType", "SINGLE_TABLE, JOINED, TABLE_PER_CLASS");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourceModelTestCase.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourceModelTestCase.java
index 56b713cf5b..2982a31b7e 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourceModelTestCase.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourceModelTestCase.java
@@ -14,10 +14,13 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResourceProxy;
import org.eclipse.core.resources.IResourceProxyVisitor;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.ElementChangedEvent;
+import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IElementChangedListener;
import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jpt.core.JpaProject;
import org.eclipse.jpt.core.JptCorePlugin;
import org.eclipse.jpt.core.context.JpaRootContextNode;
@@ -29,6 +32,7 @@ import org.eclipse.jpt.core.resource.java.JavaResourceModel;
import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
import org.eclipse.jpt.core.tests.internal.utility.jdt.AnnotationTestCase;
import org.eclipse.jpt.utility.CommandExecutorProvider;
+import org.eclipse.jpt.utility.internal.CollectionTools;
import org.eclipse.jpt.utility.internal.StringTools;
public class JavaResourceModelTestCase extends AnnotationTestCase
@@ -97,8 +101,17 @@ public class JavaResourceModelTestCase extends AnnotationTestCase
protected TestJpaProject(JpaProject.Config config) throws CoreException {
super(config);
this.setUpdater(Updater.Null.instance());// ignore all updates, since there is no context model
+ this.addJar(org.eclipse.jpt.core.tests.internal.projects.TestJpaProject.jpaJarName());
}
+ protected void addJar(String jarPath) throws JavaModelException {
+ this.addClasspathEntry(JavaCore.newLibraryEntry(new Path(jarPath), null, null));
+ }
+
+ private void addClasspathEntry(IClasspathEntry entry) throws JavaModelException {
+ getJavaProject().setRawClasspath(CollectionTools.add(getJavaProject().getRawClasspath(), entry), null);
+ }
+
@Override
protected IResourceProxyVisitor buildInitialResourceProxyVisitor() {
return new IResourceProxyVisitor() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourcePersistentAttributeTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourcePersistentAttributeTests.java
index b14feb7030..35462ca1cc 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourcePersistentAttributeTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourcePersistentAttributeTests.java
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.core.tests.internal.resource.java;
-import java.util.Collection;
import java.util.Iterator;
import java.util.List;
@@ -40,8 +39,6 @@ public class JavaResourcePersistentAttributeTests extends JavaResourceModelTestC
}
private ICompilationUnit createTestEntity() throws Exception {
- this.createAnnotationAndMembers("Entity", "String name();");
-
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -55,8 +52,6 @@ public class JavaResourcePersistentAttributeTests extends JavaResourceModelTestC
}
private ICompilationUnit createTestEntityWithNonResolvingField() throws Exception {
- this.createAnnotationAndMembers("Entity", "String name();");
-
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -75,8 +70,6 @@ public class JavaResourcePersistentAttributeTests extends JavaResourceModelTestC
});
}
private ICompilationUnit createTestEntityWithNonResolvingMethod() throws Exception {
- this.createAnnotationAndMembers("Entity", "String name();");
-
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -109,9 +102,6 @@ public class JavaResourcePersistentAttributeTests extends JavaResourceModelTestC
}
private ICompilationUnit createTestEntityMultipleVariableDeclarationsPerLine() throws Exception {
- this.createAnnotationAndMembers("Entity", "String name();");
- this.createAnnotationAndMembers("Column", "String name();");
-
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -137,9 +127,6 @@ public class JavaResourcePersistentAttributeTests extends JavaResourceModelTestC
}
private ICompilationUnit createTestEntityWithIdAndBasic() throws Exception {
- this.createAnnotationAndMembers("Entity", "String name();");
- this.createAnnotationAndMembers("Id", "");
- this.createAnnotationAndMembers("Basic", "");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -160,10 +147,6 @@ public class JavaResourcePersistentAttributeTests extends JavaResourceModelTestC
}
private ICompilationUnit createTestEntityAnnotatedField() throws Exception {
- this.createAnnotationAndMembers("Entity", "String name();");
- this.createAnnotationAndMembers("Column", "String name();");
- this.createAnnotationAndMembers("Id", "String name();");
-
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -185,8 +168,6 @@ public class JavaResourcePersistentAttributeTests extends JavaResourceModelTestC
}
private ICompilationUnit createTestEntityWithColumn() throws Exception {
- this.createAnnotationAndMembers("Entity", "String name();");
- this.createAnnotationAndMembers("Column", "String name(); String table();");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -205,10 +186,6 @@ public class JavaResourcePersistentAttributeTests extends JavaResourceModelTestC
}
private ICompilationUnit createTestEntityWithIdColumnGeneratedValue() throws Exception {
- this.createAnnotationAndMembers("Entity", "String name();");
- this.createAnnotationAndMembers("Column", "String name(); String table();");
- this.createAnnotationAndMembers("GeneratedValue", "");
- this.createAnnotationAndMembers("Id", "");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -231,8 +208,6 @@ public class JavaResourcePersistentAttributeTests extends JavaResourceModelTestC
private ICompilationUnit createTestEntityMultipleColumns() throws Exception {
- this.createAnnotationAndMembers("Entity", "String name();");
- this.createAnnotationAndMembers("Column", "String name();");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -253,8 +228,6 @@ public class JavaResourcePersistentAttributeTests extends JavaResourceModelTestC
}
private ICompilationUnit createTestEmbeddedWithAttributeOverride() throws Exception {
- this.createAnnotationAndMembers("Embedded", "String name();");
- this.createAnnotationAndMembers("AttributeOverride", "String name();");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -269,9 +242,6 @@ public class JavaResourcePersistentAttributeTests extends JavaResourceModelTestC
});
}
private ICompilationUnit createTestEmbeddedWithAttributeOverrides() throws Exception {
- this.createAnnotationAndMembers("Embedded", "String name();");
- this.createAnnotationAndMembers("AttributeOverride", "String name();");
- this.createAnnotationAndMembers("AttributeOverrides", "AttributeOverride[] value();");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -286,8 +256,6 @@ public class JavaResourcePersistentAttributeTests extends JavaResourceModelTestC
});
}
private ICompilationUnit createTestEmbeddedWithAttributeOverridesEmpty() throws Exception {
- this.createAnnotationAndMembers("Embedded", "String name();");
- this.createAnnotationAndMembers("AttributeOverrides", "AttributeOverride[] value();");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -303,9 +271,6 @@ public class JavaResourcePersistentAttributeTests extends JavaResourceModelTestC
}
private ICompilationUnit createTestEmbeddedWith2AttributeOverrides() throws Exception {
- this.createAnnotationAndMembers("Embedded", "String name();");
- this.createAnnotationAndMembers("AttributeOverride", "String name();");
- this.createAnnotationAndMembers("AttributeOverrides", "AttributeOverride[] value();");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -321,9 +286,6 @@ public class JavaResourcePersistentAttributeTests extends JavaResourceModelTestC
}
private ICompilationUnit createTestEmbeddedWithAttributeOverrideAndAttributeOverrides() throws Exception {
- this.createAnnotationAndMembers("Embedded", "String name();");
- this.createAnnotationAndMembers("AttributeOverride", "String name();");
- this.createAnnotationAndMembers("AttributeOverrides", "AttributeOverride[] value();");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -448,7 +410,6 @@ public class JavaResourcePersistentAttributeTests extends JavaResourceModelTestC
assertSourceContains("@Basic", cu);
assertSourceContains("@Id", cu);
- this.createAnnotationAndMembers("OneToMany", "");
attributeResource.setMappingAnnotation(JPA.ONE_TO_MANY);
assertEquals(1, attributeResource.mappingAnnotationsSize());
javaAttributeMappingAnnotation = attributeResource.getMappingAnnotation();
@@ -464,7 +425,6 @@ public class JavaResourcePersistentAttributeTests extends JavaResourceModelTestC
JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
assertEquals(0, attributeResource.mappingAnnotationsSize());
- this.createAnnotationAndMembers("Id", "");
attributeResource.setMappingAnnotation(JPA.ID);
assertTrue(attributeResource.getMappingAnnotation() instanceof IdAnnotation);
assertSourceContains("@Id", cu);
@@ -476,7 +436,6 @@ public class JavaResourcePersistentAttributeTests extends JavaResourceModelTestC
JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
assertNull(attributeResource.getMappingAnnotation());
- this.createAnnotationAndMembers("Id", "");
attributeResource.setMappingAnnotation(JPA.ID);
assertTrue(attributeResource.getMappingAnnotation() instanceof IdAnnotation);
@@ -490,7 +449,6 @@ public class JavaResourcePersistentAttributeTests extends JavaResourceModelTestC
JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
assertTrue(attributeResource.getMappingAnnotation() instanceof IdAnnotation);
- this.createAnnotationAndMembers("Basic", "");
attributeResource.setMappingAnnotation(JPA.BASIC);
assertTrue(attributeResource.getMappingAnnotation() instanceof BasicAnnotation);
@@ -545,7 +503,6 @@ public class JavaResourcePersistentAttributeTests extends JavaResourceModelTestC
}
});
- this.createAnnotationAndMembers("OneToOne", "");
cu.createImport("javax.persistence.OneToOne", null, new NullProgressMonitor());
idField(cu).edit(new Editor() {
@@ -614,7 +571,6 @@ public class JavaResourcePersistentAttributeTests extends JavaResourceModelTestC
// @AttributeOverride(name="FOO") @AttributeOverrides({@AttributeOverride(name="FOO"), @AttributeOverride(name="BAR")})
public void testAddJavaAttributeAnnotationNestableContainer2() throws Exception {
ICompilationUnit cu = createTestEmbeddedWithAttributeOverride();
- this.createAnnotationAndMembers("AttributeOverrides", "String name();");
JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourcePersistentTypeTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourcePersistentTypeTests.java
index ac64ff8f55..d96e0db0fa 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourcePersistentTypeTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JavaResourcePersistentTypeTests.java
@@ -37,30 +37,7 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
super(name);
}
- private void createEntityAnnotation() throws Exception{
- this.createAnnotationAndMembers("Entity", "String name() default \"\";");
- }
-
- private void createEmbeddableAnnotation() throws Exception{
- this.createAnnotationAndMembers("Embeddable", "");
- }
-
- private void createMappedSuperclassAnnotation() throws Exception{
- this.createAnnotationAndMembers("MappedSuperclass", "");
- }
-
- private void createSecondaryTableAnnotation() throws Exception{
- this.createAnnotationAndMembers("SecondaryTable", "String name();");
- }
-
- private void createSecondaryTablesAnnotation() throws Exception{
- this.createAnnotationAndMembers("SecondaryTables", "");
- }
-
-
private ICompilationUnit createTestEntity() throws Exception {
- createEntityAnnotation();
-
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -74,8 +51,6 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestInvalidAnnotations() throws Exception {
- this.createAnnotationAndMembers("Foo", "String name();");
-
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -94,9 +69,6 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestEntityWithMemberEmbeddable() throws Exception {
- createEntityAnnotation();
- createEmbeddableAnnotation();
-
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -118,8 +90,6 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestEntityDuplicates() throws Exception {
- createEntityAnnotation();
-
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -134,8 +104,6 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestEntityWithEmbeddable() throws Exception {
- createEntityAnnotation();
- createEmbeddableAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -151,9 +119,6 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestEntityAnnotatedField() throws Exception {
- createEntityAnnotation();
- this.createAnnotationAndMembers("Id", "");
-
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -172,9 +137,6 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestEntityAnnotatedMethod() throws Exception {
- createEntityAnnotation();
- this.createAnnotationAndMembers("Id", "");
-
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -191,10 +153,8 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
}
});
}
+
private ICompilationUnit createTestEntityAnnotatedFieldAndMethod() throws Exception {
- createEntityAnnotation();
- this.createAnnotationAndMembers("Id", "");
-
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -218,9 +178,6 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestEntityAnnotatedNonPersistableMethod() throws Exception {
- createEntityAnnotation();
- this.createAnnotationAndMembers("Id", "");
-
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -238,10 +195,6 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestEntityAnnotatedPersistableMethodNonPersistableField() throws Exception {
- createEntityAnnotation();
- this.createAnnotationAndMembers("Id", "");
- this.createAnnotationAndMembers("Column", "");
-
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -266,8 +219,6 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
});
}
private ICompilationUnit createTestEntityNoPersistableFields() throws Exception {
- createEntityAnnotation();
-
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -332,8 +283,6 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
private ICompilationUnit createTestEntityWithTable() throws Exception {
- createEntityAnnotation();
- this.createAnnotationAndMembers("Table", "String name(); String schema();");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -370,8 +319,6 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
//
private ICompilationUnit createTestEntityMultipleTables() throws Exception {
- createEntityAnnotation();
- this.createAnnotationAndMembers("Table", "String name(); String schema();");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -389,8 +336,6 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestEntityWithSecondaryTable() throws Exception {
- createEntityAnnotation();
- createSecondaryTableAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -405,9 +350,6 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
});
}
private ICompilationUnit createTestEntityWithEmptySecondaryTables() throws Exception {
- createEntityAnnotation();
- this.createAnnotationAndMembers("SecondaryTable", "String name();");
- this.createAnnotationAndMembers("SecondaryTables", "SecondaryTable[] value();");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -423,9 +365,6 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestEntityWithSecondaryTables() throws Exception {
- createEntityAnnotation();
- this.createAnnotationAndMembers("SecondaryTable", "String name();");
- this.createAnnotationAndMembers("SecondaryTables", "SecondaryTable[] value();");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -441,9 +380,6 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestEntityWith2SecondaryTables() throws Exception {
- createEntityAnnotation();
- this.createAnnotationAndMembers("SecondaryTable", "String name();");
- this.createAnnotationAndMembers("SecondaryTables", "SecondaryTable[] value();");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -459,9 +395,6 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestEntityWithSecondaryTableAndSecondaryTables() throws Exception {
- createEntityAnnotation();
- this.createAnnotationAndMembers("SecondaryTable", "String name();");
- this.createAnnotationAndMembers("SecondaryTables", "SecondaryTable[] value();");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -479,8 +412,6 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestEntityWithMemberTypes() throws Exception {
- createEntityAnnotation();
-
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -553,7 +484,6 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
public void testMultipleTypeMappings() throws Exception {
ICompilationUnit cu = this.createTestEntityWithEmbeddable();
- createMappedSuperclassAnnotation();
JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
@@ -577,7 +507,6 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
}
public void testSetJavaTypeMappingAnnotation() throws Exception {
- createEntityAnnotation();
ICompilationUnit cu = createTestType();
JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
assertEquals(0, typeResource.mappingAnnotationsSize());
@@ -589,7 +518,6 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
public void testSetJavaTypeMappingAnnotation2() throws Exception {
ICompilationUnit cu = createTestEntityWithTable();
- createEmbeddableAnnotation();
JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
assertTrue(typeResource.getMappingAnnotation() instanceof EntityAnnotation);
@@ -629,7 +557,6 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
}
});
- this.createAnnotationAndMembers("Embeddable", "String name();");
cu.createImport("javax.persistence.Embeddable", null, new NullProgressMonitor());
this.testType(cu).edit(new Editor() {
@@ -695,7 +622,6 @@ public class JavaResourcePersistentTypeTests extends JavaResourceModelTestCase {
// @SecondaryTable(name="FOO") @SecondaryTables({@SecondaryTable(name="FOO"), @SecondaryTable(name="BAR")})
public void testAddJavaTypeAnnotationNestableContainer2() throws Exception {
ICompilationUnit cu = createTestEntityWithSecondaryTable();
- createSecondaryTablesAnnotation();
JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
SecondaryTableAnnotation secondaryTableResource = (SecondaryTableAnnotation) typeResource.addAnnotation(1, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinColumnTests.java
index 1f4a193f60..46e6764b91 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinColumnTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinColumnTests.java
@@ -27,21 +27,8 @@ public class JoinColumnTests extends JavaResourceModelTestCase {
public JoinColumnTests(String name) {
super(name);
}
-
- private void createJoinColumnAnnotation() throws Exception {
- this.createAnnotationAndMembers("JoinColumn",
- "String name() default \"\"; " +
- "String referencedColumnName() default \"\"; " +
- "boolean unique() default false; " +
- "boolean nullable() default true; " +
- "boolean insertable() default true; " +
- "boolean updatable() default true; " +
- "String columnDefinition() default \"\"; " +
- "String table() default \"\"; ");
- }
private ICompilationUnit createTestJoinColumn() throws Exception {
- createJoinColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -55,7 +42,6 @@ public class JoinColumnTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestJoinColumnWithName() throws Exception {
- createJoinColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -69,7 +55,6 @@ public class JoinColumnTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestJoinColumnWithTable() throws Exception {
- createJoinColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -83,7 +68,6 @@ public class JoinColumnTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestJoinColumnWithReferencedColumnName() throws Exception {
- createJoinColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -97,7 +81,6 @@ public class JoinColumnTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestJoinColumnWithColumnDefinition() throws Exception {
- createJoinColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -111,7 +94,6 @@ public class JoinColumnTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestJoinColumnWithBooleanElement(final String booleanElement) throws Exception {
- createJoinColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinColumnsTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinColumnsTests.java
index e7c734357b..4c4d427153 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinColumnsTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinColumnsTests.java
@@ -29,27 +29,8 @@ public class JoinColumnsTests extends JavaResourceModelTestCase {
public JoinColumnsTests(String name) {
super(name);
}
-
- private void createJoinColumnAnnotation() throws Exception {
- this.createAnnotationAndMembers("JoinColumn",
- "String name() default \"\"; " +
- "String referencedColumnName() default \"\"; " +
- "boolean unique() default false; " +
- "boolean nullable() default true; " +
- "boolean insertable() default true; " +
- "boolean updatable() default true; " +
- "String columnDefinition() default \"\"; " +
- "String table() default \"\"; ");
- }
-
- private void createJoinColumnsAnnotation() throws Exception {
- createJoinColumnAnnotation();
- this.createAnnotationAndMembers("JoinColumns",
- "JoinColumn[] value();");
- }
private ICompilationUnit createTestJoinColumns() throws Exception {
- createJoinColumnsAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -63,7 +44,6 @@ public class JoinColumnsTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestJoinColumnWithName() throws Exception {
- createJoinColumnsAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -77,7 +57,6 @@ public class JoinColumnsTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestJoinColumnWithTable() throws Exception {
- createJoinColumnsAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -91,7 +70,6 @@ public class JoinColumnsTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestJoinColumnWithReferencedColumnName() throws Exception {
- createJoinColumnsAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -105,7 +83,6 @@ public class JoinColumnsTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestJoinColumnWithColumnDefinition() throws Exception {
- createJoinColumnsAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -119,7 +96,6 @@ public class JoinColumnsTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestJoinColumnWithBooleanElement(final String booleanElement) throws Exception {
- createJoinColumnsAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -133,7 +109,6 @@ public class JoinColumnsTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestJoinColumn() throws Exception {
- createJoinColumnsAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinTableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinTableTests.java
index 6f7b41f8c1..565f2334a9 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinTableTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JoinTableTests.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.core.tests.internal.resource.java;
import java.util.Iterator;
-import java.util.ListIterator;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jpt.core.resource.java.JPA;
import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
@@ -28,31 +27,8 @@ public class JoinTableTests extends JavaResourceModelTestCase {
public JoinTableTests(String name) {
super(name);
}
-
- private void createJoinColumnAnnotation() throws Exception {
- this.createAnnotationAndMembers("JoinColumn", "String name() default \"\";" +
- "String referencedColumnName() default \"\";" +
- "boolean unique() default false;" +
- "boolean nullable() default true;" +
- "boolean insertable() default true;" +
- "boolean updatable() default true;" +
- "String columnDefinition() default \"\";" +
- "String table() default \"\";");
-
- }
-
- private void createUniqueConstraintAnnotation() throws Exception {
- this.createAnnotationAndMembers("UniqueConstraint", "String[] columnNames();");
- }
-
- private void createJoinTableAnnotation() throws Exception {
- createJoinColumnAnnotation();
- createUniqueConstraintAnnotation();
- this.createAnnotationAndMembers("JoinTable", "String name() default \"\"; String catalog() default \"\"; String schema() default \"\";JoinColumn[] joinColumns() default {}; JoinColumn[] inverseJoinColumns() default {}; UniqueConstraint[] uniqueConstraints() default {};");
- }
private ICompilationUnit createTestJoinTable() throws Exception {
- createJoinTableAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -66,7 +42,6 @@ public class JoinTableTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestJoinTableWithName() throws Exception {
- createJoinTableAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -80,7 +55,6 @@ public class JoinTableTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestJoinTableWithSchema() throws Exception {
- createJoinTableAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -95,7 +69,6 @@ public class JoinTableTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestJoinTableWithCatalog() throws Exception {
- createJoinTableAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -109,7 +82,6 @@ public class JoinTableTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestJoinTableWithUniqueConstraints() throws Exception {
- createJoinTableAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -123,7 +95,6 @@ public class JoinTableTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestJoinTableWithJoinColumns() throws Exception {
- createJoinTableAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -137,7 +108,6 @@ public class JoinTableTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestJoinTableWithInverseJoinColumns() throws Exception {
- createJoinTableAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JpaCompilationUnitTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JpaCompilationUnitTests.java
index 955fd27e8e..997850823d 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JpaCompilationUnitTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/JpaCompilationUnitTests.java
@@ -13,7 +13,6 @@ import java.util.Iterator;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jpt.core.JpaFile;
import org.eclipse.jpt.core.JpaProject;
import org.eclipse.jpt.core.resource.java.EntityAnnotation;
@@ -36,13 +35,7 @@ public class JpaCompilationUnitTests extends AnnotationTestCase {
return new TestJpaProject(projectName, autoBuild); // false = no auto-build
}
- private void createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception {
- this.javaProject.createCompilationUnit("javax.persistence", annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }");
- }
-
private ICompilationUnit createTestEntity() throws Exception {
- this.createAnnotationAndMembers("Entity", "String name();");
-
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/LobTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/LobTests.java
index da2298d6aa..b4dd739360 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/LobTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/LobTests.java
@@ -24,7 +24,6 @@ public class LobTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestLob() throws Exception {
- this.createAnnotationAndMembers("Lob", "");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ManyToManyTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ManyToManyTests.java
index fd6b1a3c2a..179d399f2e 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ManyToManyTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ManyToManyTests.java
@@ -25,8 +25,6 @@ public class ManyToManyTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestManyToMany() throws Exception {
- this.createAnnotationAndMembers("ManyToMany", "FetchType fetch() default FetchType.LAZY; CascadeType[] cascade() default = {};");
- this.createEnumAndMembers("CascadeType", "ALL, PERSIST, MERGE, REMOVE, REFRESH");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -40,8 +38,6 @@ public class ManyToManyTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestManyToManyWithFetch() throws Exception {
- this.createAnnotationAndMembers("ManyToMany", "FetchType fetch() default FetchType.LAZY;");
- this.createEnumAndMembers("FetchType", "EAGER, LAZY");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -55,7 +51,6 @@ public class ManyToManyTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestManyToManyWithTargetEntity() throws Exception {
- this.createAnnotationAndMembers("ManyToMany", "Class targetEntity() default void.class; ");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -69,8 +64,6 @@ public class ManyToManyTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestManyToManyWithMappedBy() throws Exception {
- this.createAnnotationAndMembers("ManyToMany", "String mappedBy() default\"\";");
- this.createEnumAndMembers("CascadeType", "ALL, PERSIST, MERGE, REMOVE, REFRESH");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -84,8 +77,6 @@ public class ManyToManyTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestManyToManyWithCascade() throws Exception {
- this.createAnnotationAndMembers("ManyToMany", "CascadeType[] cascade() default = {};");
- this.createEnumAndMembers("CascadeType", "ALL, PERSIST, MERGE, REMOVE, REFRESH");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -99,8 +90,6 @@ public class ManyToManyTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestManyToManyWithMultipleCascade() throws Exception {
- this.createAnnotationAndMembers("ManyToMany", "CascadeType[] cascade() default = {};");
- this.createEnumAndMembers("CascadeType", "ALL, PERSIST, MERGE, REMOVE, REFRESH");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -114,8 +103,6 @@ public class ManyToManyTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestManyToManyWithDuplicateCascade() throws Exception {
- this.createAnnotationAndMembers("ManyToMany", "CascadeType[] cascade() default = {};");
- this.createEnumAndMembers("CascadeType", "ALL, PERSIST, MERGE, REMOVE, REFRESH");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ManyToOneTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ManyToOneTests.java
index 5355950212..9adfeca2e7 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ManyToOneTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/ManyToOneTests.java
@@ -25,8 +25,6 @@ public class ManyToOneTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestManyToOne() throws Exception {
- this.createAnnotationAndMembers("ManyToOne", "FetchType fetch() default FetchType.LAZY; CascadeType[] cascade() default = {};");
- this.createEnumAndMembers("CascadeType", "ALL, PERSIST, MERGE, REMOVE, REFRESH");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -40,8 +38,6 @@ public class ManyToOneTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestManyToOneWithFetch() throws Exception {
- this.createAnnotationAndMembers("ManyToOne", "FetchType fetch() default FetchType.LAZY;");
- this.createEnumAndMembers("FetchType", "EAGER, LAZY");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -55,7 +51,6 @@ public class ManyToOneTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestManyToOneWithTargetEntity() throws Exception {
- this.createAnnotationAndMembers("ManyToOne", "Class targetEntity() default void.class;");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -69,7 +64,6 @@ public class ManyToOneTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestManyToOneWithOptional() throws Exception {
- this.createAnnotationAndMembers("ManyToOne", "boolean optional() default true;");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -83,8 +77,6 @@ public class ManyToOneTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestManyToOneWithCascade() throws Exception {
- this.createAnnotationAndMembers("ManyToOne", "CascadeType[] cascade() default = {};");
- this.createEnumAndMembers("CascadeType", "ALL, PERSIST, MERGE, REMOVE, REFRESH");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -98,8 +90,6 @@ public class ManyToOneTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestManyToOneWithMultipleCascade() throws Exception {
- this.createAnnotationAndMembers("ManyToOne", "CascadeType[] cascade() default = {};");
- this.createEnumAndMembers("CascadeType", "ALL, PERSIST, MERGE, REMOVE, REFRESH");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -113,8 +103,6 @@ public class ManyToOneTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestManyToOneWithDuplicateCascade() throws Exception {
- this.createAnnotationAndMembers("ManyToOne", "CascadeType[] cascade() default = {};");
- this.createEnumAndMembers("CascadeType", "ALL, PERSIST, MERGE, REMOVE, REFRESH");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/MapKeyTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/MapKeyTests.java
index 3c8c893276..e03bcba4a4 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/MapKeyTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/MapKeyTests.java
@@ -24,7 +24,6 @@ public class MapKeyTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestMapKey() throws Exception {
- this.createAnnotationAndMembers("MapKey", "String name() default \"\";");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -38,7 +37,6 @@ public class MapKeyTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestMapKeyWithName() throws Exception {
- this.createAnnotationAndMembers("MapKey", "String name() default \"\";");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/MappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/MappedSuperclassTests.java
index 4fa66cf2cc..9ab47ea88d 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/MappedSuperclassTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/MappedSuperclassTests.java
@@ -25,7 +25,6 @@ public class MappedSuperclassTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestMappedSuperclass() throws Exception {
- this.createAnnotationAndMembers("MappedSuperclass", "");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -39,8 +38,6 @@ public class MappedSuperclassTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestMappedSuperclassAndEntity() throws Exception {
- this.createAnnotationAndMembers("MappedSuperclass", "");
- this.createAnnotationAndMembers("Entity", "");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedNativeQueriesTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedNativeQueriesTests.java
index 0afd0c7bf1..e1dd692af7 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedNativeQueriesTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedNativeQueriesTests.java
@@ -29,27 +29,8 @@ public class NamedNativeQueriesTests extends JavaResourceModelTestCase {
public NamedNativeQueriesTests(String name) {
super(name);
}
-
- private void createNamedNativeQueryAnnotation() throws Exception {
- createQueryHintAnnotation();
- this.createAnnotationAndMembers("NamedNativeQuery", "String name(); " +
- "String query();" +
- "QueryHint[] hints() default{};");
- }
-
- private void createNamedNativeQueriesAnnotation() throws Exception {
- createNamedNativeQueryAnnotation();
- this.createAnnotationAndMembers("NamedNativeQueries",
- "NamedNativeQuery[] value();");
- }
-
- private void createQueryHintAnnotation() throws Exception {
- this.createAnnotationAndMembers("QueryHint", "String name(); " +
- "String value();");
- }
private ICompilationUnit createTestNamedNativeQueries() throws Exception {
- createNamedNativeQueriesAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -76,7 +57,6 @@ public class NamedNativeQueriesTests extends JavaResourceModelTestCase {
private ICompilationUnit createTestNamedNativeQueryWithStringElement(final String elementName, final String value) throws Exception {
- createNamedNativeQueriesAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -90,7 +70,6 @@ public class NamedNativeQueriesTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestNamedNativeQueryWithResultClass() throws Exception {
- createNamedNativeQueriesAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -102,8 +81,8 @@ public class NamedNativeQueriesTests extends JavaResourceModelTestCase {
}
});
}
+
private ICompilationUnit createTestNamedNativeQueryWithQueryHints() throws Exception {
- createNamedNativeQueriesAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -117,7 +96,6 @@ public class NamedNativeQueriesTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestNamedNativeQuery() throws Exception {
- createNamedNativeQueriesAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedNativeQueryTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedNativeQueryTests.java
index 00529df8d2..83e68b2ed8 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedNativeQueryTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedNativeQueryTests.java
@@ -26,21 +26,8 @@ public class NamedNativeQueryTests extends JavaResourceModelTestCase {
public NamedNativeQueryTests(String name) {
super(name);
}
-
- private void createNamedNativeQueryAnnotation() throws Exception {
- createQueryHintAnnotation();
- this.createAnnotationAndMembers("NamedNativeQuery", "String name(); " +
- "String query();" +
- "QueryHint[] hints() default{};");
- }
-
- private void createQueryHintAnnotation() throws Exception {
- this.createAnnotationAndMembers("QueryHint", "String name(); " +
- "String value();");
- }
private ICompilationUnit createTestNamedNativeQuery() throws Exception {
- createNamedNativeQueryAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -67,7 +54,6 @@ public class NamedNativeQueryTests extends JavaResourceModelTestCase {
private ICompilationUnit createTestNamedNativeQueryWithStringElement(final String elementName, final String value) throws Exception {
- createNamedNativeQueryAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -81,7 +67,6 @@ public class NamedNativeQueryTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestNamedNativeQueryWithResultClass() throws Exception {
- createNamedNativeQueryAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -93,8 +78,8 @@ public class NamedNativeQueryTests extends JavaResourceModelTestCase {
}
});
}
+
private ICompilationUnit createTestNamedNativeQueryWithQueryHints() throws Exception {
- createNamedNativeQueryAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedQueriesTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedQueriesTests.java
index 77208998b3..f90c518fe0 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedQueriesTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedQueriesTests.java
@@ -27,27 +27,8 @@ public class NamedQueriesTests extends JavaResourceModelTestCase {
public NamedQueriesTests(String name) {
super(name);
}
-
- private void createNamedQueryAnnotation() throws Exception {
- createQueryHintAnnotation();
- this.createAnnotationAndMembers("NamedQuery", "String name(); " +
- "String query();" +
- "QueryHint[] hints() default{};");
- }
-
- private void createNamedQueriesAnnotation() throws Exception {
- createNamedQueryAnnotation();
- this.createAnnotationAndMembers("NamedQueries",
- "NamedQuery[] value();");
- }
-
- private void createQueryHintAnnotation() throws Exception {
- this.createAnnotationAndMembers("QueryHint", "String name(); " +
- "String value();");
- }
private ICompilationUnit createTestNamedQueries() throws Exception {
- createNamedQueriesAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -69,7 +50,6 @@ public class NamedQueriesTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestNamedQueryWithStringElement(final String elementName, final String value) throws Exception {
- createNamedQueriesAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -83,7 +63,6 @@ public class NamedQueriesTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestNamedQueryWithQueryHints() throws Exception {
- createNamedQueriesAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -98,7 +77,6 @@ public class NamedQueriesTests extends JavaResourceModelTestCase {
private ICompilationUnit createTestNamedQuery() throws Exception {
- createNamedQueriesAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedQueryTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedQueryTests.java
index 51fd90e940..a5ee2b052a 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedQueryTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/NamedQueryTests.java
@@ -26,21 +26,8 @@ public class NamedQueryTests extends JavaResourceModelTestCase {
public NamedQueryTests(String name) {
super(name);
}
-
- private void createNamedQueryAnnotation() throws Exception {
- createQueryHintAnnotation();
- this.createAnnotationAndMembers("NamedQuery", "String name(); " +
- "String query();" +
- "QueryHint[] hints() default{};");
- }
-
- private void createQueryHintAnnotation() throws Exception {
- this.createAnnotationAndMembers("QueryHint", "String name(); " +
- "String value();");
- }
private ICompilationUnit createTestNamedQuery() throws Exception {
- createNamedQueryAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -62,7 +49,6 @@ public class NamedQueryTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestNamedQueryWithStringElement(final String elementName, final String value) throws Exception {
- createNamedQueryAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -76,7 +62,6 @@ public class NamedQueryTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestNamedQueryWithQueryHints() throws Exception {
- createNamedQueryAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OneToManyTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OneToManyTests.java
index eda0b0e0e6..fa348fc10e 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OneToManyTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OneToManyTests.java
@@ -25,8 +25,6 @@ public class OneToManyTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestOneToMany() throws Exception {
- this.createAnnotationAndMembers("OneToMany", "FetchType fetch() default FetchType.LAZY; CascadeType[] cascade() default = {};");
- this.createEnumAndMembers("CascadeType", "ALL, PERSIST, MERGE, REMOVE, REFRESH");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -40,8 +38,6 @@ public class OneToManyTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestOneToManyWithFetch() throws Exception {
- this.createAnnotationAndMembers("OneToMany", "FetchType fetch() default FetchType.LAZY;");
- this.createEnumAndMembers("FetchType", "EAGER, LAZY");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -55,7 +51,6 @@ public class OneToManyTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestOneToManyWithTargetEntity() throws Exception {
- this.createAnnotationAndMembers("OneToMany", "Class targetEntity() default void.class;");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -69,7 +64,6 @@ public class OneToManyTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestOneToManyWithMappedBy() throws Exception {
- this.createAnnotationAndMembers("OneToMany", "String mappedBy() default\"\";");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -83,8 +77,6 @@ public class OneToManyTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestOneToManyWithCascade() throws Exception {
- this.createAnnotationAndMembers("OneToMany", "CascadeType[] cascade() default = {};");
- this.createEnumAndMembers("CascadeType", "ALL, PERSIST, MERGE, REMOVE, REFRESH");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -98,8 +90,6 @@ public class OneToManyTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestOneToManyWithMultipleCascade() throws Exception {
- this.createAnnotationAndMembers("OneToMany", "CascadeType[] cascade() default = {};");
- this.createEnumAndMembers("CascadeType", "ALL, PERSIST, MERGE, REMOVE, REFRESH");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -113,8 +103,6 @@ public class OneToManyTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestOneToManyWithDuplicateCascade() throws Exception {
- this.createAnnotationAndMembers("OneToMany", "CascadeType[] cascade() default = {};");
- this.createEnumAndMembers("CascadeType", "ALL, PERSIST, MERGE, REMOVE, REFRESH");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OneToOneTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OneToOneTests.java
index dd0e044629..c671e4f25a 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OneToOneTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OneToOneTests.java
@@ -25,8 +25,6 @@ public class OneToOneTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestOneToOne() throws Exception {
- this.createAnnotationAndMembers("OneToOne", "FetchType fetch() default FetchType.LAZY; CascadeType[] cascade() default = {};");
- this.createEnumAndMembers("CascadeType", "ALL, PERSIST, MERGE, REMOVE, REFRESH");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -40,8 +38,6 @@ public class OneToOneTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestOneToOneWithFetch() throws Exception {
- this.createAnnotationAndMembers("OneToOne", "FetchType fetch() default FetchType.LAZY;");
- this.createEnumAndMembers("FetchType", "EAGER, LAZY");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -55,7 +51,6 @@ public class OneToOneTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestOneToOneWithTargetEntity() throws Exception {
- this.createAnnotationAndMembers("OneToOne", "Class targetEntity() default void.class;");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -69,7 +64,6 @@ public class OneToOneTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestOneToOneWithOptional() throws Exception {
- this.createAnnotationAndMembers("OneToOne", "boolean optional() default true;");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -83,7 +77,6 @@ public class OneToOneTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestOneToOneWithMappedBy() throws Exception {
- this.createAnnotationAndMembers("OneToOne", "String mappedBy() default\"\";");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -97,8 +90,6 @@ public class OneToOneTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestOneToOneWithCascade() throws Exception {
- this.createAnnotationAndMembers("OneToOne", "CascadeType[] cascade() default = {};");
- this.createEnumAndMembers("CascadeType", "ALL, PERSIST, MERGE, REMOVE, REFRESH");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -112,8 +103,6 @@ public class OneToOneTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestOneToOneWithMultipleCascade() throws Exception {
- this.createAnnotationAndMembers("OneToOne", "CascadeType[] cascade() default = {};");
- this.createEnumAndMembers("CascadeType", "ALL, PERSIST, MERGE, REMOVE, REFRESH");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -127,8 +116,6 @@ public class OneToOneTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestOneToOneWithDuplicateCascade() throws Exception {
- this.createAnnotationAndMembers("OneToOne", "CascadeType[] cascade() default = {};");
- this.createEnumAndMembers("CascadeType", "ALL, PERSIST, MERGE, REMOVE, REFRESH");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OrderByTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OrderByTests.java
index e0c6799995..6ba6f86d12 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OrderByTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/OrderByTests.java
@@ -24,7 +24,6 @@ public class OrderByTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestOrderBy() throws Exception {
- this.createAnnotationAndMembers("OrderBy", "String value() default \"\";");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -38,7 +37,6 @@ public class OrderByTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestOrderByWithValue() throws Exception {
- this.createAnnotationAndMembers("OrderBy", "String value() default \"\";");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/PrimaryKeyJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/PrimaryKeyJoinColumnTests.java
index 40819510d0..b04b371342 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/PrimaryKeyJoinColumnTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/PrimaryKeyJoinColumnTests.java
@@ -26,16 +26,8 @@ public class PrimaryKeyJoinColumnTests extends JavaResourceModelTestCase {
public PrimaryKeyJoinColumnTests(String name) {
super(name);
}
-
- private void createPrimaryKeyJoinColumnAnnotation() throws Exception {
- this.createAnnotationAndMembers("PrimaryKeyJoinColumn",
- "String name() default \"\"; " +
- "String referencedColumnName() default \"\"; " +
- "String columnDefinition() default \"\"; ");
- }
private ICompilationUnit createTestPrimaryKeyJoinColumn() throws Exception {
- createPrimaryKeyJoinColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -49,7 +41,6 @@ public class PrimaryKeyJoinColumnTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestPrimaryKeyJoinColumnWithName() throws Exception {
- createPrimaryKeyJoinColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -63,7 +54,6 @@ public class PrimaryKeyJoinColumnTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestPrimaryKeyJoinColumnWithReferencedColumnName() throws Exception {
- createPrimaryKeyJoinColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -77,7 +67,6 @@ public class PrimaryKeyJoinColumnTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestPrimaryKeyJoinColumnWithColumnDefinition() throws Exception {
- createPrimaryKeyJoinColumnAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/PrimaryKeyJoinColumnsTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/PrimaryKeyJoinColumnsTests.java
index a0a2d00e71..30017aafd0 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/PrimaryKeyJoinColumnsTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/PrimaryKeyJoinColumnsTests.java
@@ -29,21 +29,7 @@ public class PrimaryKeyJoinColumnsTests extends JavaResourceModelTestCase {
super(name);
}
- private void createPrimaryKeyJoinColumnAnnotation() throws Exception {
- this.createAnnotationAndMembers("PrimaryKeyJoinColumn",
- "String name() default \"\"; " +
- "String referencedColumnName() default \"\"; " +
- "String columnDefinition() default \"\";");
- }
-
- private void createPrimaryKeyJoinColumnsAnnotation() throws Exception {
- createPrimaryKeyJoinColumnAnnotation();
- this.createAnnotationAndMembers("PrimaryKeyJoinColumns",
- "PrimaryKeyJoinColumn[] value();");
- }
-
private ICompilationUnit createTestPrimaryKeyJoinColumns() throws Exception {
- createPrimaryKeyJoinColumnsAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -57,7 +43,6 @@ public class PrimaryKeyJoinColumnsTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestPrimaryKeyJoinColumnWithName() throws Exception {
- createPrimaryKeyJoinColumnsAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -71,7 +56,6 @@ public class PrimaryKeyJoinColumnsTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestPrimaryKeyJoinColumnWithReferencedColumnName() throws Exception {
- createPrimaryKeyJoinColumnsAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -85,7 +69,6 @@ public class PrimaryKeyJoinColumnsTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestPrimaryKeyJoinColumnWithColumnDefinition() throws Exception {
- createPrimaryKeyJoinColumnsAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -99,7 +82,6 @@ public class PrimaryKeyJoinColumnsTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestPrimaryKeyJoinColumn() throws Exception {
- createPrimaryKeyJoinColumnsAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/QueryHintTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/QueryHintTests.java
index 65d72116c9..894a98631e 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/QueryHintTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/QueryHintTests.java
@@ -25,21 +25,8 @@ public class QueryHintTests extends JavaResourceModelTestCase {
public QueryHintTests(String name) {
super(name);
}
-
- private void createNamedQueryAnnotation() throws Exception {
- createQueryHintAnnotation();
- this.createAnnotationAndMembers("NamedQuery", "String name(); " +
- "String query();" +
- "QueryHint[] hints() default{};");
- }
-
- private void createQueryHintAnnotation() throws Exception {
- this.createAnnotationAndMembers("QueryHint", "String name(); " +
- "String value();");
- }
private ICompilationUnit createTestNamedQueryWithQueryHints() throws Exception {
- createNamedQueryAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SecondaryTableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SecondaryTableTests.java
index 9128356b53..f031477d2d 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SecondaryTableTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SecondaryTableTests.java
@@ -28,26 +28,7 @@ public class SecondaryTableTests extends JavaResourceModelTestCase {
super(name);
}
- private void createUniqueConstraintAnnotation() throws Exception {
- this.createAnnotationAndMembers("UniqueConstraint", "String[] columnNames();");
- }
-
- private void createPrimaryKeyJoinColumnAnnotation() throws Exception {
- this.createAnnotationAndMembers("PrimaryKeyJoinColumn", "String name() default \"\"; String referencedColumnName() default \"\";String columnDefinition() default \"\";");
- }
-
- private void createSecondaryTableAnnotation() throws Exception {
- createPrimaryKeyJoinColumnAnnotation();
- createUniqueConstraintAnnotation();
- this.createAnnotationAndMembers("SecondaryTable", "String name() default \"\"; " +
- "String catalog() default \"\";" +
- "String schema() default \"\";" +
- "PrimaryKeyJoinColumn[] pkJoinColumns() default {};" +
- "UniqueConstraint[] uniqueConstraints() default {};");
- }
-
private ICompilationUnit createTestSecondaryTable() throws Exception {
- createSecondaryTableAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -61,7 +42,6 @@ public class SecondaryTableTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestSecondaryTableWithName() throws Exception {
- createSecondaryTableAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -75,7 +55,6 @@ public class SecondaryTableTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestSecondaryTableWithSchema() throws Exception {
- createSecondaryTableAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -87,8 +66,8 @@ public class SecondaryTableTests extends JavaResourceModelTestCase {
}
});
}
+
private ICompilationUnit createTestSecondaryTableWithCatalog() throws Exception {
- createSecondaryTableAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -100,10 +79,8 @@ public class SecondaryTableTests extends JavaResourceModelTestCase {
}
});
}
-
private ICompilationUnit createTestSecondaryTableWithUniqueConstraints() throws Exception {
- createSecondaryTableAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -117,7 +94,6 @@ public class SecondaryTableTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestSecondaryTableWithPkJoinColumns() throws Exception {
- createSecondaryTableAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SecondaryTablesTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SecondaryTablesTests.java
index 807daefd6e..933b0bab29 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SecondaryTablesTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SecondaryTablesTests.java
@@ -29,33 +29,8 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase {
public SecondaryTablesTests(String name) {
super(name);
}
-
-
- private void createUniqueConstraintAnnotation() throws Exception {
- this.createAnnotationAndMembers("UniqueConstraint", "String[] columnNames();");
- }
-
- private void createPrimaryKeyJoinColumnAnnotation() throws Exception {
- this.createAnnotationAndMembers("PrimaryKeyJoinColumn", "String name() default \"\"; String referencedColumnName() default \"\";String columnDefinition() default \"\";");
- }
-
- private void createSecondaryTableAnnotation() throws Exception {
- createPrimaryKeyJoinColumnAnnotation();
- createUniqueConstraintAnnotation();
- this.createAnnotationAndMembers("SecondaryTable", "String name() default \"\"; " +
- "String catalog() default \"\"; " +
- "String schema() default \"\";" +
- "PrimaryKeyJoinColumn[] pkJoinColumns() default {};" +
- "UniqueConstraint[] uniqueConstraints() default {};");
-
- }
- private void createSecondaryTablesAnnotation() throws Exception {
- createSecondaryTableAnnotation();
- this.createAnnotationAndMembers("SecondaryTables", "SecondaryTable[] value()");
- }
private ICompilationUnit createTestSecondaryTables() throws Exception {
- createSecondaryTablesAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -69,7 +44,6 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestSecondaryTableWithName() throws Exception {
- createSecondaryTablesAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -83,7 +57,6 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestSecondaryTableWithSchema() throws Exception {
- createSecondaryTablesAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -96,7 +69,6 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase {
});
}
private ICompilationUnit createTestSecondaryTableWithCatalog() throws Exception {
- createSecondaryTablesAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -111,7 +83,6 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase {
private ICompilationUnit createTestSecondaryTableWithUniqueConstraints() throws Exception {
- createSecondaryTablesAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -125,7 +96,6 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestSecondaryTable() throws Exception {
- createSecondaryTablesAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -141,7 +111,6 @@ public class SecondaryTablesTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestSecondaryTablesWithPkJoinColumns() throws Exception {
- createSecondaryTablesAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SequenceGeneratorTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SequenceGeneratorTests.java
index e209c4cd53..3abff9fb15 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SequenceGeneratorTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/SequenceGeneratorTests.java
@@ -27,16 +27,8 @@ public class SequenceGeneratorTests extends JavaResourceModelTestCase {
public SequenceGeneratorTests(String name) {
super(name);
}
-
- private void createSequenceGeneratorAnnotation() throws Exception {
- this.createAnnotationAndMembers("SequenceGenerator", "String name(); " +
- "String sequenceName() default \"\"" +
- "int initialValue() default 1" +
- "int allocationSize() default 50");
- }
private ICompilationUnit createTestSequenceGeneratorOnField() throws Exception {
- createSequenceGeneratorAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -50,7 +42,6 @@ public class SequenceGeneratorTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestSequenceGeneratorOnType() throws Exception {
- createSequenceGeneratorAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -71,9 +62,7 @@ public class SequenceGeneratorTests extends JavaResourceModelTestCase {
return createTestSequenceGeneratorWithStringElement("sequenceName", GENERATOR_SEQUENCE_NAME);
}
- private ICompilationUnit createTestSequenceGeneratorWithStringElement(final String elementName, final String value) throws Exception {
- createSequenceGeneratorAnnotation();
- return this.createTestType(new DefaultAnnotationWriter() {
+ private ICompilationUnit createTestSequenceGeneratorWithStringElement(final String elementName, final String value) throws Exception { return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
return new ArrayIterator<String>(JPA.SEQUENCE_GENERATOR);
@@ -94,7 +83,6 @@ public class SequenceGeneratorTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestSequenceGeneratorWithIntElement(final String elementName, final int value) throws Exception {
- createSequenceGeneratorAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TableGeneratorTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TableGeneratorTests.java
index b12c6387f8..6c3e108cc8 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TableGeneratorTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TableGeneratorTests.java
@@ -32,22 +32,8 @@ public class TableGeneratorTests extends JavaResourceModelTestCase {
public TableGeneratorTests(String name) {
super(name);
}
-
- private void createTableGeneratorAnnotation() throws Exception {
- this.createAnnotationAndMembers("TableGenerator", "String name(); " +
- "String table() default \"\"" +
- "String catalog() default \"\"" +
- "String schema() default \"\"" +
- "String pkColumnName() default \"\"" +
- "String valueColumnName() default \"\"" +
- "String pkColumnValue() default \"\"" +
- "int initialValue() default 0" +
- "int allocationSize() default 50" +
- "UniqueConstraint[] uniqueConstraints() default{}");
- }
private ICompilationUnit createTestTableGeneratorOnField() throws Exception {
- createTableGeneratorAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -61,7 +47,6 @@ public class TableGeneratorTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestTableGeneratorOnType() throws Exception {
- createTableGeneratorAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -102,7 +87,6 @@ public class TableGeneratorTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestTableGeneratorWithStringElement(final String elementName, final String value) throws Exception {
- createTableGeneratorAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -124,7 +108,6 @@ public class TableGeneratorTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestTableGeneratorWithIntElement(final String elementName, final int value) throws Exception {
- createTableGeneratorAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -138,8 +121,6 @@ public class TableGeneratorTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestTableGeneratorWithUniqueConstraints() throws Exception {
- createTableGeneratorAnnotation();
- this.createAnnotationAndMembers("UniqueConstraint", "String[] columnNames();");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -437,7 +418,6 @@ public class TableGeneratorTests extends JavaResourceModelTestCase {
public void testUniqueConstraints2() throws Exception {
ICompilationUnit cu = this.createTestTableGeneratorOnField();
- this.createAnnotationAndMembers("UniqueConstraint", "String[] columnNames();");
JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
@@ -461,7 +441,6 @@ public class TableGeneratorTests extends JavaResourceModelTestCase {
public void testAddUniqueConstraint() throws Exception {
ICompilationUnit cu = this.createTestTableGeneratorOnField();
- this.createAnnotationAndMembers("UniqueConstraint", "String[] columnNames();");
JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TableTests.java
index 5495c4dbe6..d36ba723e3 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TableTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TableTests.java
@@ -26,18 +26,8 @@ public class TableTests extends JavaResourceModelTestCase {
public TableTests(String name) {
super(name);
}
-
- private void createTableAnnotation() throws Exception {
- createUniqueConstraintAnnotation();
- this.createAnnotationAndMembers("Table", "String name() default \"\"; String catalog() default \"\"; String schema() default \"\"; UniqueConstraint[] uniqueConstraints() default {};");
- }
-
- private void createUniqueConstraintAnnotation() throws Exception {
- createAnnotationAndMembers("UniqueConstraint", "String[] columnNames();");
- }
private ICompilationUnit createTestTable() throws Exception {
- createTableAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -51,7 +41,6 @@ public class TableTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestTableWithName() throws Exception {
- createTableAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -65,7 +54,6 @@ public class TableTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestTableWithSchema() throws Exception {
- createTableAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -79,7 +67,6 @@ public class TableTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestTableWithCatalog() throws Exception {
- createTableAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -93,7 +80,6 @@ public class TableTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestTableWithUniqueConstraints() throws Exception {
- createTableAnnotation();
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TemporalTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TemporalTests.java
index 9aca8780ac..13f84e8513 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TemporalTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TemporalTests.java
@@ -25,8 +25,6 @@ public class TemporalTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestTemporal() throws Exception {
- this.createAnnotationAndMembers("Temporal", "TemporalType value();");
- this.createEnumAndMembers("TemporalType", "DATE, TIME, TIMESTAMP");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
@@ -40,8 +38,6 @@ public class TemporalTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestTemporalWithValue() throws Exception {
- this.createAnnotationAndMembers("Temporal", "TemporalType value();");
- this.createEnumAndMembers("TemporalType", "DATE, TIME, TIMESTAMP");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TransientTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TransientTests.java
index 89c7db53d4..912877343a 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TransientTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/TransientTests.java
@@ -25,7 +25,6 @@ public class TransientTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestTransient() throws Exception {
- this.createAnnotationAndMembers("Transient", "");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/VersionTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/VersionTests.java
index eef64e99f0..7e43758f03 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/VersionTests.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/resource/java/VersionTests.java
@@ -25,7 +25,6 @@ public class VersionTests extends JavaResourceModelTestCase {
}
private ICompilationUnit createTestVersion() throws Exception {
- this.createAnnotationAndMembers("Version", "");
return this.createTestType(new DefaultAnnotationWriter() {
@Override
public Iterator<String> imports() {
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/JptEclipseLinkCoreTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/JptEclipseLinkCoreTests.java
index 75f078286c..38ea54e8d1 100644
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/JptEclipseLinkCoreTests.java
+++ b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/JptEclipseLinkCoreTests.java
@@ -27,7 +27,7 @@ import org.eclipse.jpt.eclipselink.core.tests.internal.schema.generation.JptEcli
*/
public class JptEclipseLinkCoreTests
{
- private static final String JPA_JAR_PROPERTY = TestJpaProject.JAR_NAME_SYSTEM_PROPERTY;
+ private static final String JPA_JAR_PROPERTY = TestJpaProject.JPA_JAR_NAME_SYSTEM_PROPERTY;
public static Test suite() {
TestSuite suite = new TestSuite(JptEclipseLinkCoreTests.class.getPackage().getName());
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/EclipseLinkJavaResourceModelTestCase.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/EclipseLinkJavaResourceModelTestCase.java
index 2341d05f63..da8d1f57cb 100644
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/EclipseLinkJavaResourceModelTestCase.java
+++ b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/EclipseLinkJavaResourceModelTestCase.java
@@ -26,12 +26,10 @@ public class EclipseLinkJavaResourceModelTestCase extends JavaResourceModelTestC
super(name);
}
- @Override
protected ICompilationUnit createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception {
return createAnnotationAndMembers(ECLIPSELINK_ANNOTATIONS_PACKAGE_NAME, annotationName, annotationBody);
}
-
- @Override
+
protected ICompilationUnit createEnumAndMembers(String enumName, String enumBody) throws Exception {
return createEnumAndMembers(ECLIPSELINK_ANNOTATIONS_PACKAGE_NAME, enumName, enumBody);
}

Back to the top