Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/CustomizerAnnotationTests.java')
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/CustomizerAnnotationTests.java99
1 files changed, 0 insertions, 99 deletions
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/CustomizerAnnotationTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/CustomizerAnnotationTests.java
deleted file mode 100644
index 3babb225d4..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/CustomizerAnnotationTests.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJPA;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class CustomizerAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public CustomizerAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestCustomizer() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLinkJPA.CUSTOMIZER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Customizer");
- }
- });
- }
-
- private ICompilationUnit createTestCustomizerWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLinkJPA.CUSTOMIZER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Customizer(Foo.class)");
- }
- });
- }
-
- public void testCustomizerAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestCustomizer();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- assertNotNull(typeResource.getAnnotation(EclipseLinkJPA.CUSTOMIZER));
-
- typeResource.removeAnnotation(EclipseLinkJPA.CUSTOMIZER);
- assertNull(typeResource.getAnnotation(EclipseLinkJPA.CUSTOMIZER));
-
- typeResource.addAnnotation(EclipseLinkJPA.CUSTOMIZER);
- assertNotNull(typeResource.getAnnotation(EclipseLinkJPA.CUSTOMIZER));
- }
-
- public void testGetConverterClass() throws Exception {
- ICompilationUnit cu = this.createTestCustomizerWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCustomizerAnnotation converter = (EclipseLinkCustomizerAnnotation) typeResource.getAnnotation(EclipseLinkJPA.CUSTOMIZER);
- assertEquals("Foo", converter.getValue());
- }
-
- public void testSetConverterClass() throws Exception {
- ICompilationUnit cu = this.createTestCustomizerWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCustomizerAnnotation converter = (EclipseLinkCustomizerAnnotation) typeResource.getAnnotation(EclipseLinkJPA.CUSTOMIZER);
- assertEquals("Foo", converter.getValue());
-
- converter.setValue("Bar");
- assertEquals("Bar", converter.getValue());
-
- assertSourceContains("@Customizer(Bar.class)", cu);
- }
-
- public void testSetConverterClassNull() throws Exception {
- ICompilationUnit cu = this.createTestCustomizerWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCustomizerAnnotation converter = (EclipseLinkCustomizerAnnotation) typeResource.getAnnotation(EclipseLinkJPA.CUSTOMIZER);
- assertEquals("Foo", converter.getValue());
-
- converter.setValue(null);
- assertNull(converter.getValue());
-
- assertSourceContains("@Customizer", cu);
- assertSourceDoesNotContain("Foo.class", cu);
- }
-}

Back to the top