Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0JpaMetadataConversionTests.java10
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_2JpaMetadataConversionTests.java23
2 files changed, 16 insertions, 17 deletions
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0JpaMetadataConversionTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0JpaMetadataConversionTests.java
index 4296247f9b..8e84da3f7c 100644
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0JpaMetadataConversionTests.java
+++ b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0JpaMetadataConversionTests.java
@@ -247,7 +247,7 @@ public class Generic2_0JpaMetadataConversionTests extends
Collection<OrmNamedNativeQuery> namedNativeQueries = CollectionTools.collection(entityMappings.getQueryContainer().getNamedNativeQueries());
// test the first mapping file query
- OrmNamedNativeQuery nnq1 = this.selectNodeNamed(namedNativeQueries, "nnq1");
+ OrmNamedNativeQuery nnq1 = selectNodeNamed(namedNativeQueries, "nnq1");
assertEquals("nnq1", (nnq1.getName()));
assertEquals("abcd", (nnq1.getQuery()));
assertEquals("foo1", nnq1.getResultClass());
@@ -268,7 +268,7 @@ public class Generic2_0JpaMetadataConversionTests extends
assertEquals("bbb", nnq1hint2.getValue());
// test the second mapping file query
- OrmNamedNativeQuery nnq2 = this.selectNodeNamed(namedNativeQueries, "nnq2");
+ OrmNamedNativeQuery nnq2 = selectNodeNamed(namedNativeQueries, "nnq2");
assertEquals("nnq2", (nnq2.getName()));
assertEquals("efgh", (nnq2.getQuery()));
assertEquals("foo2", nnq2.getResultClass());
@@ -284,7 +284,7 @@ public class Generic2_0JpaMetadataConversionTests extends
}
- private <N extends JpaNamedContextNode> N selectNodeNamed(Iterable<N> nodes, String name) {
+ public static <N extends JpaNamedContextNode> N selectNodeNamed(Iterable<N> nodes, String name) {
for (N node : nodes) {
if (node.getName().equals(name)) {
return node;
@@ -410,7 +410,7 @@ public class Generic2_0JpaMetadataConversionTests extends
Collection<OrmNamedNativeQuery> namedNativeQueries = CollectionTools.collection(entityMappings.getQueryContainer().getNamedNativeQueries());
// test the first mapping file query
- OrmNamedNativeQuery nnq1 = this.selectNodeNamed(namedNativeQueries, "nnq1");
+ OrmNamedNativeQuery nnq1 = selectNodeNamed(namedNativeQueries, "nnq1");
assertEquals("nnq1", (nnq1.getName()));
assertEquals("abcd", (nnq1.getQuery()));
assertEquals("foo1", nnq1.getResultClass());
@@ -431,7 +431,7 @@ public class Generic2_0JpaMetadataConversionTests extends
assertEquals("bbb", nnq1hint2.getValue());
// test the second mapping file query
- OrmNamedNativeQuery nnq2 = this.selectNodeNamed(namedNativeQueries, "nnq2");
+ OrmNamedNativeQuery nnq2 = selectNodeNamed(namedNativeQueries, "nnq2");
assertEquals("nnq2", (nnq2.getName()));
assertEquals("efgh", (nnq2.getQuery()));
assertEquals("foo2", nnq2.getResultClass());
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_2JpaMetadataConversionTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_2JpaMetadataConversionTests.java
index 17e02bfab6..0eecf5c287 100644
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_2JpaMetadataConversionTests.java
+++ b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_2JpaMetadataConversionTests.java
@@ -9,6 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
+import java.util.Collection;
import java.util.Iterator;
import java.util.ListIterator;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -22,6 +23,7 @@ import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
import org.eclipse.jpt.jpa.core.resource.java.JPA;
+import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.persistence.Generic2_0JpaMetadataConversionTests;
import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConversionValue;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvertibleMapping;
@@ -39,6 +41,7 @@ import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkC
import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_2ContextModelTestCase;
+@SuppressWarnings("nls")
public class EclipseLink2_2JpaMetadataConversionTests extends EclipseLink2_2ContextModelTestCase {
private IProgressMonitor progressMonitor;
@@ -446,17 +449,13 @@ public class EclipseLink2_2JpaMetadataConversionTests extends EclipseLink2_2Cont
assertEquals(mapping.getConverterContainer().getConvertersSize(), 0);
// test the mapping file converter have correct values
- Iterator<OrmEclipseLinkCustomConverter> it = entityMappings.getConverterContainer().getCustomConverters().iterator();
- if (it.hasNext()) {
- EclipseLinkCustomConverter custom1 = it.next();
- assertEquals("custom1", custom1.getName());
- assertEquals("foo1", custom1.getConverterClass());
- }
- if (it.hasNext()) {
- EclipseLinkCustomConverter custom2 = it.next();
- assertEquals("custom2", custom2.getName());
- assertEquals("foo2", custom2.getConverterClass());
- }
+ Collection<OrmEclipseLinkCustomConverter> customConverters = CollectionTools.collection(entityMappings.getConverterContainer().getCustomConverters());
+ EclipseLinkCustomConverter custom1 = Generic2_0JpaMetadataConversionTests.selectNodeNamed(customConverters, "custom1");
+ assertEquals("custom1", custom1.getName());
+ assertEquals("foo1", custom1.getConverterClass());
+ EclipseLinkCustomConverter custom2 = Generic2_0JpaMetadataConversionTests.selectNodeNamed(customConverters, "custom2");
+ assertEquals("custom2", custom2.getName());
+ assertEquals("foo2", custom2.getConverterClass());
}
public void testConvertConvertersOnCollectionMapping() throws Exception {
@@ -486,7 +485,7 @@ public class EclipseLink2_2JpaMetadataConversionTests extends EclipseLink2_2Cont
// TODO test converting converter on map key - not supported yet
}
- public void testConvertOverridenConverters() throws Exception {
+ public void testConvertOverriddenConverters() throws Exception {
createTestEntityWithDuplicateConvertersOfDiffTypes();
addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);

Back to the top