Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jpa/tests/org.eclipse.jpt.core.tests')
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/AnnotationTestCase.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/AnnotationTestCase.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/AnnotationTestCase.java
index 4520c25877..e80584279f 100644
--- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/AnnotationTestCase.java
+++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/utility/jdt/AnnotationTestCase.java
@@ -137,6 +137,13 @@ public abstract class AnnotationTestCase extends TestCase {
return this.createTestPackageInfo(new DefaultAnnotationWriter());
}
+ /**
+ * create an un-annotated package-info in a package the given name
+ */
+ protected ICompilationUnit createTestPackageInfo(String packageName) throws CoreException {
+ return this.createTestPackageInfo(packageName, new DefaultAnnotationWriter());
+ }
+
/**
* shortcut for simply adding an annotation to the package declaration
*/
@@ -159,8 +166,12 @@ public abstract class AnnotationTestCase extends TestCase {
}
protected ICompilationUnit createTestPackageInfo(AnnotationWriter annotationWriter) throws CoreException {
+ return this.createTestPackageInfo(PACKAGE_NAME, annotationWriter);
+ }
+
+ protected ICompilationUnit createTestPackageInfo(String packageName, AnnotationWriter annotationWriter) throws CoreException {
return this.javaProject.createCompilationUnit(
- PACKAGE_NAME, PACKAGE_INFO_FILE_NAME, this.createSourceWriter(annotationWriter, null));
+ packageName, PACKAGE_INFO_FILE_NAME, this.createSourceWriter(annotationWriter, packageName, null));
}
@@ -214,6 +225,10 @@ public abstract class AnnotationTestCase extends TestCase {
return new AnnotatedSourceWriter(annotationWriter, typeName);
}
+ protected SourceWriter createSourceWriter(AnnotationWriter annotationWriter, String packageName, String typeName) {
+ return new AnnotatedSourceWriter(annotationWriter, packageName, typeName);
+ }
+
/**
* writes source for package-info java files
*/

Back to the top