diff options
Diffstat (limited to 'jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context')
16 files changed, 126 insertions, 126 deletions
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/ContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/ContextModelTestCase.java index 2a4f5b9b13..fb7593c93e 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/ContextModelTestCase.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/ContextModelTestCase.java @@ -115,7 +115,7 @@ public abstract class ContextModelTestCase extends AnnotationTestCase } protected OrmResource ormResource() { - return this.ormArtifactEdit.getResource(JptCorePlugin.ormXmlDeploymentURI(jpaProject().project())); + return this.ormArtifactEdit.getResource(JptCorePlugin.ormXmlDeploymentURI(jpaProject().getProject())); } protected XmlPersistence xmlPersistence() { @@ -131,7 +131,7 @@ public abstract class ContextModelTestCase extends AnnotationTestCase } protected PersistenceUnit persistenceUnit() { - return rootContext().persistenceXml().getPersistence().persistenceUnits().next(); + return rootContext().getPersistenceXml().getPersistence().persistenceUnits().next(); } protected ClassRef classRef() { @@ -169,7 +169,7 @@ public abstract class ContextModelTestCase extends AnnotationTestCase } protected JpaRootContextNode rootContext() { - return (JpaRootContextNode) getJavaProject().getJpaProject().rootContext(); + return (JpaRootContextNode) getJavaProject().getJpaProject().getRootContext(); } @Override diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaColumnTests.java index 18f9250fe6..130b7bcbce 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaColumnTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaColumnTests.java @@ -274,7 +274,7 @@ public class JavaColumnTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); BasicMapping basicMapping = (BasicMapping) javaPersistentType().attributes().next().getMapping(); - assertEquals(((Entity) basicMapping.typeMapping()).getName(), basicMapping.getColumn().getDefaultTable()); + assertEquals(((Entity) basicMapping.getTypeMapping()).getName(), basicMapping.getColumn().getDefaultTable()); assertEquals(TYPE_NAME, basicMapping.getColumn().getDefaultTable()); } diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEntityTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEntityTests.java index ab06777e7d..0c3c64521d 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEntityTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEntityTests.java @@ -1136,17 +1136,17 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); assertNull(javaEntity().getSequenceGenerator()); - assertEquals(0, CollectionTools.size(javaEntity().persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(javaEntity().getPersistenceUnit().allGenerators())); JavaResourcePersistentType typeResource = jpaProject().javaPersistentTypeResource(FULLY_QUALIFIED_TYPE_NAME); typeResource.addAnnotation(JPA.SEQUENCE_GENERATOR); assertNotNull(javaEntity().getSequenceGenerator()); assertEquals(1, typeResource.annotationsSize()); - assertEquals(0, CollectionTools.size(javaEntity().persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(javaEntity().getPersistenceUnit().allGenerators())); javaEntity().getSequenceGenerator().setName("foo"); - assertEquals(1, CollectionTools.size(javaEntity().persistenceUnit().allGenerators())); + assertEquals(1, CollectionTools.size(javaEntity().getPersistenceUnit().allGenerators())); } public void testAddSequenceGenerator() throws Exception { @@ -1197,17 +1197,17 @@ public class JavaEntityTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); assertNull(javaEntity().getTableGenerator()); - assertEquals(0, CollectionTools.size(javaEntity().persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(javaEntity().getPersistenceUnit().allGenerators())); JavaResourcePersistentType typeResource = jpaProject().javaPersistentTypeResource(FULLY_QUALIFIED_TYPE_NAME); typeResource.addAnnotation(JPA.TABLE_GENERATOR); assertNotNull(javaEntity().getTableGenerator()); assertEquals(1, typeResource.annotationsSize()); - assertEquals(0, CollectionTools.size(javaEntity().persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(javaEntity().getPersistenceUnit().allGenerators())); javaEntity().getTableGenerator().setName("foo"); - assertEquals(1, CollectionTools.size(javaEntity().persistenceUnit().allGenerators())); + assertEquals(1, CollectionTools.size(javaEntity().getPersistenceUnit().allGenerators())); } public void testAddTableGenerator() throws Exception { @@ -2612,7 +2612,7 @@ public class JavaEntityTests extends ContextModelTestCase Entity entity = javaEntity(); JavaResourcePersistentType typeResource = jpaProject().javaPersistentTypeResource(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(0, CollectionTools.size(entity.persistenceUnit().allQueries())); + assertEquals(0, CollectionTools.size(entity.getPersistenceUnit().allQueries())); ((NamedQueryAnnotation) typeResource.addAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME, NamedQueries.ANNOTATION_NAME)).setName("FOO"); ((NamedQueryAnnotation) typeResource.addAnnotation(1, NamedQueryAnnotation.ANNOTATION_NAME, NamedQueries.ANNOTATION_NAME)).setName("BAR"); @@ -2622,7 +2622,7 @@ public class JavaEntityTests extends ContextModelTestCase assertEquals("BAR", namedQueries.next().getName()); assertEquals("BAZ", namedQueries.next().getName()); assertFalse(namedQueries.hasNext()); - assertEquals(3, CollectionTools.size(entity.persistenceUnit().allQueries())); + assertEquals(3, CollectionTools.size(entity.getPersistenceUnit().allQueries())); typeResource.move(2, 0, NamedQueries.ANNOTATION_NAME); namedQueries = entity.namedQueries(); @@ -2643,18 +2643,18 @@ public class JavaEntityTests extends ContextModelTestCase assertEquals("BAZ", namedQueries.next().getName()); assertEquals("FOO", namedQueries.next().getName()); assertFalse(namedQueries.hasNext()); - assertEquals(2, CollectionTools.size(entity.persistenceUnit().allQueries())); + assertEquals(2, CollectionTools.size(entity.getPersistenceUnit().allQueries())); typeResource.removeAnnotation(1, NamedQueryAnnotation.ANNOTATION_NAME, NamedQueries.ANNOTATION_NAME); namedQueries = entity.namedQueries(); assertEquals("BAZ", namedQueries.next().getName()); assertFalse(namedQueries.hasNext()); - assertEquals(1, CollectionTools.size(entity.persistenceUnit().allQueries())); + assertEquals(1, CollectionTools.size(entity.getPersistenceUnit().allQueries())); typeResource.removeAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME, NamedQueries.ANNOTATION_NAME); namedQueries = entity.namedQueries(); assertFalse(namedQueries.hasNext()); - assertEquals(0, CollectionTools.size(entity.persistenceUnit().allQueries())); + assertEquals(0, CollectionTools.size(entity.getPersistenceUnit().allQueries())); } public void testNamedQueriesSize() throws Exception { @@ -2790,7 +2790,7 @@ public class JavaEntityTests extends ContextModelTestCase Entity entity = javaEntity(); JavaResourcePersistentType typeResource = jpaProject().javaPersistentTypeResource(FULLY_QUALIFIED_TYPE_NAME); - assertEquals(0, CollectionTools.size(entity.persistenceUnit().allQueries())); + assertEquals(0, CollectionTools.size(entity.getPersistenceUnit().allQueries())); ((NamedNativeQueryAnnotation) typeResource.addAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueries.ANNOTATION_NAME)).setName("FOO"); ((NamedNativeQueryAnnotation) typeResource.addAnnotation(1, NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueries.ANNOTATION_NAME)).setName("BAR"); @@ -2800,7 +2800,7 @@ public class JavaEntityTests extends ContextModelTestCase assertEquals("BAR", namedQueries.next().getName()); assertEquals("BAZ", namedQueries.next().getName()); assertFalse(namedQueries.hasNext()); - assertEquals(3, CollectionTools.size(entity.persistenceUnit().allQueries())); + assertEquals(3, CollectionTools.size(entity.getPersistenceUnit().allQueries())); typeResource.move(2, 0, NamedNativeQueries.ANNOTATION_NAME); namedQueries = entity.namedNativeQueries(); @@ -2821,18 +2821,18 @@ public class JavaEntityTests extends ContextModelTestCase assertEquals("BAZ", namedQueries.next().getName()); assertEquals("FOO", namedQueries.next().getName()); assertFalse(namedQueries.hasNext()); - assertEquals(2, CollectionTools.size(entity.persistenceUnit().allQueries())); + assertEquals(2, CollectionTools.size(entity.getPersistenceUnit().allQueries())); typeResource.removeAnnotation(1, NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueries.ANNOTATION_NAME); namedQueries = entity.namedNativeQueries(); assertEquals("BAZ", namedQueries.next().getName()); assertFalse(namedQueries.hasNext()); - assertEquals(1, CollectionTools.size(entity.persistenceUnit().allQueries())); + assertEquals(1, CollectionTools.size(entity.getPersistenceUnit().allQueries())); typeResource.removeAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME, NamedNativeQueries.ANNOTATION_NAME); namedQueries = entity.namedNativeQueries(); assertFalse(namedQueries.hasNext()); - assertEquals(0, CollectionTools.size(entity.persistenceUnit().allQueries())); + assertEquals(0, CollectionTools.size(entity.getPersistenceUnit().allQueries())); } public void testNamedNativeQueriesSize() throws Exception { diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaIdMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaIdMappingTests.java index 1d9dbf1495..56aadf6595 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaIdMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaIdMappingTests.java @@ -508,17 +508,17 @@ public class JavaIdMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping(); assertNull(idMapping.getSequenceGenerator()); - assertEquals(0, CollectionTools.size(idMapping.persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(idMapping.getPersistenceUnit().allGenerators())); JavaResourcePersistentType typeResource = jpaProject().javaPersistentTypeResource(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.attributes().next(); attributeResource.addAnnotation(JPA.SEQUENCE_GENERATOR); assertNotNull(idMapping.getSequenceGenerator()); assertEquals(1, attributeResource.annotationsSize()); - assertEquals(0, CollectionTools.size(idMapping.persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(idMapping.getPersistenceUnit().allGenerators())); idMapping.getSequenceGenerator().setName("foo"); - assertEquals(1, CollectionTools.size(idMapping.persistenceUnit().allGenerators())); + assertEquals(1, CollectionTools.size(idMapping.getPersistenceUnit().allGenerators())); } public void testAddSequenceGenerator() throws Exception { @@ -580,17 +580,17 @@ public class JavaIdMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = javaPersistentType().attributes().next(); IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping(); assertNull(idMapping.getTableGenerator()); - assertEquals(0, CollectionTools.size(idMapping.persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(idMapping.getPersistenceUnit().allGenerators())); JavaResourcePersistentType typeResource = jpaProject().javaPersistentTypeResource(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.attributes().next(); attributeResource.addAnnotation(JPA.TABLE_GENERATOR); assertNotNull(idMapping.getTableGenerator()); assertEquals(1, attributeResource.annotationsSize()); - assertEquals(0, CollectionTools.size(idMapping.persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(idMapping.getPersistenceUnit().allGenerators())); idMapping.getTableGenerator().setName("foo"); - assertEquals(1, CollectionTools.size(idMapping.persistenceUnit().allGenerators())); + assertEquals(1, CollectionTools.size(idMapping.getPersistenceUnit().allGenerators())); } public void testAddTableGenerator() throws Exception { diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPrimaryKeyJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPrimaryKeyJoinColumnTests.java index 01d0faba93..00a949eba2 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPrimaryKeyJoinColumnTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaPrimaryKeyJoinColumnTests.java @@ -296,7 +296,7 @@ public class JavaPrimaryKeyJoinColumnTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next(); - assertNull(specifiedPkJoinColumn.dbColumn()); + assertNull(specifiedPkJoinColumn.getDbColumn()); } public void testDbReferencedColumn() throws Exception { @@ -312,7 +312,7 @@ public class JavaPrimaryKeyJoinColumnTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); PrimaryKeyJoinColumn specifiedPkJoinColumn = javaEntity().specifiedPrimaryKeyJoinColumns().next(); - assertNull(specifiedPkJoinColumn.dbTable()); + assertNull(specifiedPkJoinColumn.getDbTable()); } } diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTableTests.java index cc165def67..b4ca898417 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTableTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaTableTests.java @@ -159,10 +159,10 @@ public class JavaTableTests extends ContextModelTestCase assertNull(javaEntity.getTable().getDefaultSchema()); - ormEntity.entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO"); + ormEntity.getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO"); assertEquals("FOO", javaEntity.getTable().getDefaultSchema()); - ormEntity.entityMappings().setSpecifiedSchema("BAR"); + ormEntity.getEntityMappings().setSpecifiedSchema("BAR"); assertEquals("BAR", javaEntity.getTable().getDefaultSchema()); ormEntity.getTable().setSpecifiedSchema("XML_SCHEMA"); @@ -276,10 +276,10 @@ public class JavaTableTests extends ContextModelTestCase assertNull(javaEntity.getTable().getDefaultCatalog()); - ormEntity.entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO"); + ormEntity.getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO"); assertEquals("FOO", javaEntity.getTable().getDefaultCatalog()); - ormEntity.entityMappings().setSpecifiedCatalog("BAR"); + ormEntity.getEntityMappings().setSpecifiedCatalog("BAR"); assertEquals("BAR", javaEntity.getTable().getDefaultCatalog()); ormEntity.getTable().setSpecifiedCatalog("XML_CATALOG"); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/EntityMappingsTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/EntityMappingsTests.java index 201b893232..cc8b88427b 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/EntityMappingsTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/EntityMappingsTests.java @@ -468,7 +468,7 @@ public class EntityMappingsTests extends ContextModelTestCase public void testUpdateTableGenerators() throws Exception { assertEquals(0, entityMappings().tableGeneratorsSize()); assertEquals(0, ormResource().getEntityMappings().getTableGenerators().size()); - assertEquals(0, CollectionTools.size(entityMappings().persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); XmlTableGenerator tableGeneratorResource = OrmFactory.eINSTANCE.createXmlTableGeneratorImpl(); ormResource().getEntityMappings().getTableGenerators().add(tableGeneratorResource); @@ -476,7 +476,7 @@ public class EntityMappingsTests extends ContextModelTestCase TableGenerator tableGenerator = entityMappings().tableGenerators().next(); assertEquals("FOO", tableGenerator.getName()); - assertEquals(1, CollectionTools.size(entityMappings().persistenceUnit().allGenerators())); + assertEquals(1, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); XmlTableGenerator tableGeneratorResource2 = OrmFactory.eINSTANCE.createXmlTableGeneratorImpl(); ormResource().getEntityMappings().getTableGenerators().add(0, tableGeneratorResource2); @@ -486,7 +486,7 @@ public class EntityMappingsTests extends ContextModelTestCase assertEquals("BAR", tableGenerators.next().getName()); assertEquals("FOO", tableGenerators.next().getName()); assertFalse(tableGenerators.hasNext()); - assertEquals(2, CollectionTools.size(entityMappings().persistenceUnit().allGenerators())); + assertEquals(2, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); XmlTableGenerator tableGeneratorResource3 = OrmFactory.eINSTANCE.createXmlTableGeneratorImpl(); ormResource().getEntityMappings().getTableGenerators().add(1, tableGeneratorResource3); @@ -497,7 +497,7 @@ public class EntityMappingsTests extends ContextModelTestCase assertEquals("BAZ", tableGenerators.next().getName()); assertEquals("FOO", tableGenerators.next().getName()); assertFalse(tableGenerators.hasNext()); - assertEquals(3, CollectionTools.size(entityMappings().persistenceUnit().allGenerators())); + assertEquals(3, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); ormResource().getEntityMappings().getTableGenerators().move(2, 0); tableGenerators = entityMappings().tableGenerators(); @@ -505,25 +505,25 @@ public class EntityMappingsTests extends ContextModelTestCase assertEquals("FOO", tableGenerators.next().getName()); assertEquals("BAR", tableGenerators.next().getName()); assertFalse(tableGenerators.hasNext()); - assertEquals(3, CollectionTools.size(entityMappings().persistenceUnit().allGenerators())); + assertEquals(3, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); ormResource().getEntityMappings().getTableGenerators().remove(0); tableGenerators = entityMappings().tableGenerators(); assertEquals("FOO", tableGenerators.next().getName()); assertEquals("BAR", tableGenerators.next().getName()); assertFalse(tableGenerators.hasNext()); - assertEquals(2, CollectionTools.size(entityMappings().persistenceUnit().allGenerators())); + assertEquals(2, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); ormResource().getEntityMappings().getTableGenerators().remove(1); tableGenerators = entityMappings().tableGenerators(); assertEquals("FOO", tableGenerators.next().getName()); assertFalse(tableGenerators.hasNext()); - assertEquals(1, CollectionTools.size(entityMappings().persistenceUnit().allGenerators())); + assertEquals(1, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); ormResource().getEntityMappings().getTableGenerators().clear(); tableGenerators = entityMappings().tableGenerators(); assertFalse(tableGenerators.hasNext()); - assertEquals(0, CollectionTools.size(entityMappings().persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); } public void testAddTableGenerator() throws Exception { @@ -637,7 +637,7 @@ public class EntityMappingsTests extends ContextModelTestCase public void testUpdateSequenceGenerators() throws Exception { assertEquals(0, entityMappings().sequenceGeneratorsSize()); assertEquals(0, ormResource().getEntityMappings().getSequenceGenerators().size()); - assertEquals(0, CollectionTools.size(entityMappings().persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); XmlSequenceGenerator sequenceGeneratorResource = OrmFactory.eINSTANCE.createXmlSequenceGeneratorImpl(); ormResource().getEntityMappings().getSequenceGenerators().add(sequenceGeneratorResource); @@ -645,7 +645,7 @@ public class EntityMappingsTests extends ContextModelTestCase SequenceGenerator sequenceGenerator = entityMappings().sequenceGenerators().next(); assertEquals("FOO", sequenceGenerator.getName()); - assertEquals(1, CollectionTools.size(entityMappings().persistenceUnit().allGenerators())); + assertEquals(1, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); XmlSequenceGenerator sequenceGeneratorResource2 = OrmFactory.eINSTANCE.createXmlSequenceGeneratorImpl(); ormResource().getEntityMappings().getSequenceGenerators().add(0, sequenceGeneratorResource2); @@ -655,7 +655,7 @@ public class EntityMappingsTests extends ContextModelTestCase assertEquals("BAR", sequenceGenerators.next().getName()); assertEquals("FOO", sequenceGenerators.next().getName()); assertFalse(sequenceGenerators.hasNext()); - assertEquals(2, CollectionTools.size(entityMappings().persistenceUnit().allGenerators())); + assertEquals(2, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); XmlSequenceGenerator sequenceGeneratorResource3 = OrmFactory.eINSTANCE.createXmlSequenceGeneratorImpl(); ormResource().getEntityMappings().getSequenceGenerators().add(1, sequenceGeneratorResource3); @@ -666,7 +666,7 @@ public class EntityMappingsTests extends ContextModelTestCase assertEquals("BAZ", sequenceGenerators.next().getName()); assertEquals("FOO", sequenceGenerators.next().getName()); assertFalse(sequenceGenerators.hasNext()); - assertEquals(3, CollectionTools.size(entityMappings().persistenceUnit().allGenerators())); + assertEquals(3, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); ormResource().getEntityMappings().getSequenceGenerators().move(2, 0); sequenceGenerators = entityMappings().sequenceGenerators(); @@ -680,18 +680,18 @@ public class EntityMappingsTests extends ContextModelTestCase assertEquals("FOO", sequenceGenerators.next().getName()); assertEquals("BAR", sequenceGenerators.next().getName()); assertFalse(sequenceGenerators.hasNext()); - assertEquals(2, CollectionTools.size(entityMappings().persistenceUnit().allGenerators())); + assertEquals(2, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); ormResource().getEntityMappings().getSequenceGenerators().remove(1); sequenceGenerators = entityMappings().sequenceGenerators(); assertEquals("FOO", sequenceGenerators.next().getName()); assertFalse(sequenceGenerators.hasNext()); - assertEquals(1, CollectionTools.size(entityMappings().persistenceUnit().allGenerators())); + assertEquals(1, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); ormResource().getEntityMappings().getSequenceGenerators().clear(); sequenceGenerators = entityMappings().sequenceGenerators(); assertFalse(sequenceGenerators.hasNext()); - assertEquals(0, CollectionTools.size(entityMappings().persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allGenerators())); } public void testAddSequenceGenerator() throws Exception { @@ -886,7 +886,7 @@ public class EntityMappingsTests extends ContextModelTestCase } public void testUpdateNamedQueries() throws Exception { - assertEquals(0, CollectionTools.size(entityMappings().persistenceUnit().allQueries())); + assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries())); ormResource().getEntityMappings().getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery()); ormResource().getEntityMappings().getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery()); @@ -901,7 +901,7 @@ public class EntityMappingsTests extends ContextModelTestCase assertEquals("BAR", namedQueries.next().getName()); assertEquals("BAZ", namedQueries.next().getName()); assertFalse(namedQueries.hasNext()); - assertEquals(3, CollectionTools.size(entityMappings().persistenceUnit().allQueries())); + assertEquals(3, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries())); ormResource().getEntityMappings().getNamedQueries().move(2, 0); namedQueries = entityMappings().namedQueries(); @@ -922,17 +922,17 @@ public class EntityMappingsTests extends ContextModelTestCase assertEquals("BAZ", namedQueries.next().getName()); assertEquals("FOO", namedQueries.next().getName()); assertFalse(namedQueries.hasNext()); - assertEquals(2, CollectionTools.size(entityMappings().persistenceUnit().allQueries())); + assertEquals(2, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries())); ormResource().getEntityMappings().getNamedQueries().remove(1); namedQueries = entityMappings().namedQueries(); assertEquals("BAZ", namedQueries.next().getName()); assertFalse(namedQueries.hasNext()); - assertEquals(1, CollectionTools.size(entityMappings().persistenceUnit().allQueries())); + assertEquals(1, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries())); ormResource().getEntityMappings().getNamedQueries().remove(0); assertFalse(entityMappings().namedQueries().hasNext()); - assertEquals(0, CollectionTools.size(entityMappings().persistenceUnit().allQueries())); + assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries())); } public void testAddNamedNativeQuery() throws Exception { @@ -1016,7 +1016,7 @@ public class EntityMappingsTests extends ContextModelTestCase } public void testUpdateNamedNativeQueries() throws Exception { - assertEquals(0, CollectionTools.size(entityMappings().persistenceUnit().allQueries())); + assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries())); ormResource().getEntityMappings().getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery()); ormResource().getEntityMappings().getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery()); @@ -1031,7 +1031,7 @@ public class EntityMappingsTests extends ContextModelTestCase assertEquals("BAR", namedNativeQueries.next().getName()); assertEquals("BAZ", namedNativeQueries.next().getName()); assertFalse(namedNativeQueries.hasNext()); - assertEquals(3, CollectionTools.size(entityMappings().persistenceUnit().allQueries())); + assertEquals(3, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries())); ormResource().getEntityMappings().getNamedNativeQueries().move(2, 0); namedNativeQueries = entityMappings().namedNativeQueries(); @@ -1052,16 +1052,16 @@ public class EntityMappingsTests extends ContextModelTestCase assertEquals("BAZ", namedNativeQueries.next().getName()); assertEquals("FOO", namedNativeQueries.next().getName()); assertFalse(namedNativeQueries.hasNext()); - assertEquals(2, CollectionTools.size(entityMappings().persistenceUnit().allQueries())); + assertEquals(2, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries())); ormResource().getEntityMappings().getNamedNativeQueries().remove(1); namedNativeQueries = entityMappings().namedNativeQueries(); assertEquals("BAZ", namedNativeQueries.next().getName()); assertFalse(namedNativeQueries.hasNext()); - assertEquals(1, CollectionTools.size(entityMappings().persistenceUnit().allQueries())); + assertEquals(1, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries())); ormResource().getEntityMappings().getNamedNativeQueries().remove(0); assertFalse(entityMappings().namedNativeQueries().hasNext()); - assertEquals(0, CollectionTools.size(entityMappings().persistenceUnit().allQueries())); + assertEquals(0, CollectionTools.size(entityMappings().getPersistenceUnit().allQueries())); } }
\ No newline at end of file diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmColumnTests.java index 4b14479fbf..76f8334d82 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmColumnTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmColumnTests.java @@ -704,7 +704,7 @@ public class OrmColumnTests extends ContextModelTestCase assertEquals(Column.DEFAULT_PRECISION, ormColumn.getSpecifiedPrecision()); assertEquals(Column.DEFAULT_SCALE, ormColumn.getSpecifiedScale()); - ormPersistentType.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + ormPersistentType.getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.FALSE); assertEquals("name", ormColumn.getSpecifiedName()); assertEquals(TYPE_NAME, ormColumn.getSpecifiedTable()); @@ -730,7 +730,7 @@ public class OrmColumnTests extends ContextModelTestCase assertEquals(Column.DEFAULT_SCALE, ormColumn.getSpecifiedScale()); //set metadata-complete false, orm.xml virtual column gets setting from java annotation - ormPersistentType.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); + ormPersistentType.getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); assertEquals("FOO", ormColumn.getSpecifiedName()); assertEquals("FOO_TABLE", ormColumn.getSpecifiedTable()); assertEquals("COLUMN_DEFINITION", ormColumn.getColumnDefinition()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEntityTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEntityTests.java index 96b313a10b..e0de313e23 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEntityTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEntityTests.java @@ -529,7 +529,7 @@ public class OrmEntityTests extends ContextModelTestCase ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE); assertEquals(InheritanceType.JOINED, ormEntity.getDefaultInheritanceStrategy()); - ormEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + ormEntity.getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); //this setting overrides the false meta-data complete found on ormEntity assertEquals(InheritanceType.SINGLE_TABLE, ormEntity.getDefaultInheritanceStrategy()); } @@ -560,7 +560,7 @@ public class OrmEntityTests extends ContextModelTestCase assertNull(parentXmlEntity.getSpecifiedInheritanceStrategy()); assertNull(childXmlEntity.getSpecifiedInheritanceStrategy()); - parentPersistentType.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + parentPersistentType.getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); assertEquals(InheritanceType.SINGLE_TABLE, parentXmlEntity.getDefaultInheritanceStrategy()); assertEquals(InheritanceType.SINGLE_TABLE, childXmlEntity.getDefaultInheritanceStrategy()); } @@ -988,21 +988,21 @@ public class OrmEntityTests extends ContextModelTestCase assertNull(ormEntity.getSequenceGenerator()); assertNull(entityResource.getSequenceGenerator()); - assertEquals(0, CollectionTools.size(ormEntity.persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(ormEntity.getPersistenceUnit().allGenerators())); entityResource.setSequenceGenerator(OrmFactory.eINSTANCE.createXmlSequenceGeneratorImpl()); assertNotNull(ormEntity.getSequenceGenerator()); assertNotNull(entityResource.getSequenceGenerator()); - assertEquals(0, CollectionTools.size(ormEntity.persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(ormEntity.getPersistenceUnit().allGenerators())); ormEntity.getSequenceGenerator().setName("foo"); - assertEquals(1, CollectionTools.size(ormEntity.persistenceUnit().allGenerators())); + assertEquals(1, CollectionTools.size(ormEntity.getPersistenceUnit().allGenerators())); entityResource.setSequenceGenerator(null); assertNull(ormEntity.getSequenceGenerator()); assertNull(entityResource.getSequenceGenerator()); - assertEquals(0, CollectionTools.size(ormEntity.persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(ormEntity.getPersistenceUnit().allGenerators())); } public void testAddTableGenerator() throws Exception { @@ -1060,21 +1060,21 @@ public class OrmEntityTests extends ContextModelTestCase assertNull(ormEntity.getTableGenerator()); assertNull(entityResource.getTableGenerator()); - assertEquals(0, CollectionTools.size(ormEntity.persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(ormEntity.getPersistenceUnit().allGenerators())); entityResource.setTableGenerator(OrmFactory.eINSTANCE.createXmlTableGeneratorImpl()); assertNotNull(ormEntity.getTableGenerator()); assertNotNull(entityResource.getTableGenerator()); - assertEquals(0, CollectionTools.size(ormEntity.persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(ormEntity.getPersistenceUnit().allGenerators())); ormEntity.getTableGenerator().setName("foo"); - assertEquals(1, CollectionTools.size(ormEntity.persistenceUnit().allGenerators())); + assertEquals(1, CollectionTools.size(ormEntity.getPersistenceUnit().allGenerators())); entityResource.setTableGenerator(null); assertNull(ormEntity.getTableGenerator()); assertNull(entityResource.getTableGenerator()); - assertEquals(0, CollectionTools.size(ormEntity.persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(ormEntity.getPersistenceUnit().allGenerators())); } public void testUpdateDiscriminatorColumn() throws Exception { @@ -1663,7 +1663,7 @@ public class OrmEntityTests extends ContextModelTestCase OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); - assertEquals(0, CollectionTools.size(ormEntity.persistenceUnit().allQueries())); + assertEquals(0, CollectionTools.size(ormEntity.getPersistenceUnit().allQueries())); XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); entityResource.getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery()); @@ -1678,7 +1678,7 @@ public class OrmEntityTests extends ContextModelTestCase assertEquals("BAR", namedQueries.next().getName()); assertEquals("BAZ", namedQueries.next().getName()); assertFalse(namedQueries.hasNext()); - assertEquals(3, CollectionTools.size(ormEntity.persistenceUnit().allQueries())); + assertEquals(3, CollectionTools.size(ormEntity.getPersistenceUnit().allQueries())); entityResource.getNamedQueries().move(2, 0); namedQueries = ormEntity.namedQueries(); @@ -1699,17 +1699,17 @@ public class OrmEntityTests extends ContextModelTestCase assertEquals("BAZ", namedQueries.next().getName()); assertEquals("FOO", namedQueries.next().getName()); assertFalse(namedQueries.hasNext()); - assertEquals(2, CollectionTools.size(ormEntity.persistenceUnit().allQueries())); + assertEquals(2, CollectionTools.size(ormEntity.getPersistenceUnit().allQueries())); entityResource.getNamedQueries().remove(1); namedQueries = ormEntity.namedQueries(); assertEquals("BAZ", namedQueries.next().getName()); assertFalse(namedQueries.hasNext()); - assertEquals(1, CollectionTools.size(ormEntity.persistenceUnit().allQueries())); + assertEquals(1, CollectionTools.size(ormEntity.getPersistenceUnit().allQueries())); entityResource.getNamedQueries().remove(0); assertFalse(ormEntity.namedQueries().hasNext()); - assertEquals(0, CollectionTools.size(ormEntity.persistenceUnit().allQueries())); + assertEquals(0, CollectionTools.size(ormEntity.getPersistenceUnit().allQueries())); } public void testAddNamedNativeQuery() throws Exception { @@ -1808,7 +1808,7 @@ public class OrmEntityTests extends ContextModelTestCase OrmPersistentType persistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); OrmEntity ormEntity = (OrmEntity) persistentType.getMapping(); - assertEquals(0, CollectionTools.size(ormEntity.persistenceUnit().allQueries())); + assertEquals(0, CollectionTools.size(ormEntity.getPersistenceUnit().allQueries())); XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0); entityResource.getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery()); @@ -1822,7 +1822,7 @@ public class OrmEntityTests extends ContextModelTestCase assertEquals("BAR", namedNativeQueries.next().getName()); assertEquals("BAZ", namedNativeQueries.next().getName()); assertFalse(namedNativeQueries.hasNext()); - assertEquals(3, CollectionTools.size(ormEntity.persistenceUnit().allQueries())); + assertEquals(3, CollectionTools.size(ormEntity.getPersistenceUnit().allQueries())); entityResource.getNamedNativeQueries().move(2, 0); namedNativeQueries = ormEntity.namedNativeQueries(); @@ -1843,17 +1843,17 @@ public class OrmEntityTests extends ContextModelTestCase assertEquals("BAZ", namedNativeQueries.next().getName()); assertEquals("FOO", namedNativeQueries.next().getName()); assertFalse(namedNativeQueries.hasNext()); - assertEquals(2, CollectionTools.size(ormEntity.persistenceUnit().allQueries())); + assertEquals(2, CollectionTools.size(ormEntity.getPersistenceUnit().allQueries())); entityResource.getNamedNativeQueries().remove(1); namedNativeQueries = ormEntity.namedNativeQueries(); assertEquals("BAZ", namedNativeQueries.next().getName()); assertFalse(namedNativeQueries.hasNext()); - assertEquals(1, CollectionTools.size(ormEntity.persistenceUnit().allQueries())); + assertEquals(1, CollectionTools.size(ormEntity.getPersistenceUnit().allQueries())); entityResource.getNamedNativeQueries().remove(0); assertFalse(ormEntity.namedNativeQueries().hasNext()); - assertEquals(0, CollectionTools.size(ormEntity.persistenceUnit().allQueries())); + assertEquals(0, CollectionTools.size(ormEntity.getPersistenceUnit().allQueries())); } public void testUpdateIdClass() throws Exception { diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmIdMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmIdMappingTests.java index 881d1f9769..1805ba3712 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmIdMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmIdMappingTests.java @@ -306,20 +306,20 @@ public class OrmIdMappingTests extends ContextModelTestCase assertNull(ormIdMapping.getSequenceGenerator()); assertNull(idResource.getSequenceGenerator()); - assertEquals(0, CollectionTools.size(ormIdMapping.persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(ormIdMapping.getPersistenceUnit().allGenerators())); idResource.setSequenceGenerator(OrmFactory.eINSTANCE.createXmlSequenceGeneratorImpl()); assertNotNull(ormIdMapping.getSequenceGenerator()); assertNotNull(idResource.getSequenceGenerator()); - assertEquals(0, CollectionTools.size(ormIdMapping.persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(ormIdMapping.getPersistenceUnit().allGenerators())); ormIdMapping.getSequenceGenerator().setName("foo"); - assertEquals(1, CollectionTools.size(ormIdMapping.persistenceUnit().allGenerators())); + assertEquals(1, CollectionTools.size(ormIdMapping.getPersistenceUnit().allGenerators())); idResource.setSequenceGenerator(null); assertNull(ormIdMapping.getSequenceGenerator()); assertNull(idResource.getSequenceGenerator()); - assertEquals(0, CollectionTools.size(ormIdMapping.persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(ormIdMapping.getPersistenceUnit().allGenerators())); } public void testAddTableGenerator() throws Exception { @@ -380,20 +380,20 @@ public class OrmIdMappingTests extends ContextModelTestCase assertNull(ormIdMapping.getTableGenerator()); assertNull(idResource.getTableGenerator()); - assertEquals(0, CollectionTools.size(ormIdMapping.persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(ormIdMapping.getPersistenceUnit().allGenerators())); idResource.setTableGenerator(OrmFactory.eINSTANCE.createXmlTableGeneratorImpl()); assertNotNull(ormIdMapping.getTableGenerator()); assertNotNull(idResource.getTableGenerator()); - assertEquals(0, CollectionTools.size(ormIdMapping.persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(ormIdMapping.getPersistenceUnit().allGenerators())); ormIdMapping.getTableGenerator().setName("foo"); - assertEquals(1, CollectionTools.size(ormIdMapping.persistenceUnit().allGenerators())); + assertEquals(1, CollectionTools.size(ormIdMapping.getPersistenceUnit().allGenerators())); idResource.setTableGenerator(null); assertNull(ormIdMapping.getTableGenerator()); assertNull(idResource.getTableGenerator()); - assertEquals(0, CollectionTools.size(ormIdMapping.persistenceUnit().allGenerators())); + assertEquals(0, CollectionTools.size(ormIdMapping.getPersistenceUnit().allGenerators())); } public void testAddGeneratedValue() throws Exception { diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmSecondaryTableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmSecondaryTableTests.java index ff1ad074fd..f000a1e32b 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmSecondaryTableTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmSecondaryTableTests.java @@ -253,10 +253,10 @@ public class OrmSecondaryTableTests extends ContextModelTestCase ormSecondaryTable.setSpecifiedName("FOO"); assertNull(ormSecondaryTable.getDefaultSchema()); - ormEntity.entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO"); + ormEntity.getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO"); assertEquals("FOO", ormSecondaryTable.getDefaultSchema()); - ormEntity.entityMappings().setSpecifiedSchema("BAR"); + ormEntity.getEntityMappings().setSpecifiedSchema("BAR"); assertEquals("BAR", ormSecondaryTable.getDefaultSchema()); SecondaryTable javaSecondaryTable = ormEntity.javaEntity().addSpecifiedSecondaryTable(0); @@ -264,10 +264,10 @@ public class OrmSecondaryTableTests extends ContextModelTestCase javaSecondaryTable.setSpecifiedSchema("JAVA_SCHEMA"); assertEquals("BAR", ormSecondaryTable.getDefaultSchema()); //schema is not defaulted from underlying java - ormEntity.entityMappings().setSpecifiedSchema(null); + ormEntity.getEntityMappings().setSpecifiedSchema(null); assertEquals("FOO", ormSecondaryTable.getDefaultSchema()); - ormEntity.entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema(null); + ormEntity.getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema(null); assertNull(ormSecondaryTable.getDefaultSchema()); } @@ -346,10 +346,10 @@ public class OrmSecondaryTableTests extends ContextModelTestCase ormSecondaryTable.setSpecifiedName("FOO"); assertNull(ormSecondaryTable.getDefaultCatalog()); - ormEntity.entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO"); + ormEntity.getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO"); assertEquals("FOO", ormSecondaryTable.getDefaultCatalog()); - ormEntity.entityMappings().setSpecifiedCatalog("BAR"); + ormEntity.getEntityMappings().setSpecifiedCatalog("BAR"); assertEquals("BAR", ormSecondaryTable.getDefaultCatalog()); SecondaryTable javaSecondaryTable = ormEntity.javaEntity().addSpecifiedSecondaryTable(0); @@ -357,10 +357,10 @@ public class OrmSecondaryTableTests extends ContextModelTestCase javaSecondaryTable.setSpecifiedCatalog("JAVA_CATALOG"); assertEquals("BAR", ormSecondaryTable.getDefaultCatalog()); //schema is not defaulted from underlying java - ormEntity.entityMappings().setSpecifiedCatalog(null); + ormEntity.getEntityMappings().setSpecifiedCatalog(null); assertEquals("FOO", ormSecondaryTable.getDefaultCatalog()); - ormEntity.entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog(null); + ormEntity.getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog(null); assertNull(ormSecondaryTable.getDefaultCatalog()); } diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTableTests.java index 844b126b81..e5b527e69c 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTableTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmTableTests.java @@ -147,14 +147,14 @@ public class OrmTableTests extends ContextModelTestCase ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE); assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName()); - ormEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + ormEntity.getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE); assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName()); ormEntity.setSpecifiedMetadataComplete(null); assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName()); - ormEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); + ormEntity.getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); assertEquals("Foo", ormEntity.getTable().getDefaultName()); ormEntity.getTable().setSpecifiedName("Bar"); @@ -231,14 +231,14 @@ public class OrmTableTests extends ContextModelTestCase ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE); assertNull(ormEntity.getTable().getDefaultSchema()); - ormEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + ormEntity.getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE); assertNull(ormEntity.getTable().getDefaultSchema()); ormEntity.setSpecifiedMetadataComplete(null); assertNull(ormEntity.getTable().getDefaultSchema()); - ormEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); + ormEntity.getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); assertEquals("Foo", ormEntity.getTable().getDefaultSchema()); ormEntity.getTable().setSpecifiedName("Bar"); @@ -281,10 +281,10 @@ public class OrmTableTests extends ContextModelTestCase OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); assertNull(ormEntity.getTable().getDefaultSchema()); - ormEntity.entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO"); + ormEntity.getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO"); assertEquals("FOO", ormEntity.getTable().getDefaultSchema()); - ormEntity.entityMappings().setSpecifiedSchema("BAR"); + ormEntity.getEntityMappings().setSpecifiedSchema("BAR"); assertEquals("BAR", ormEntity.getTable().getDefaultSchema()); ormEntity.javaEntity().getTable().setSpecifiedSchema("JAVA_SCHEMA"); @@ -295,10 +295,10 @@ public class OrmTableTests extends ContextModelTestCase assertEquals("BAR", ormEntity.getTable().getDefaultSchema()); - ormEntity.entityMappings().setSpecifiedSchema(null); + ormEntity.getEntityMappings().setSpecifiedSchema(null); assertEquals("FOO", ormEntity.getTable().getDefaultSchema()); - ormEntity.entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema(null); + ormEntity.getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema(null); assertNull(ormEntity.getTable().getDefaultSchema()); ormEntity.getTable().setSpecifiedName(null); @@ -384,14 +384,14 @@ public class OrmTableTests extends ContextModelTestCase ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE); assertNull(ormEntity.getTable().getDefaultCatalog()); - ormEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); + ormEntity.getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true); ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE); assertNull(ormEntity.getTable().getDefaultCatalog()); ormEntity.setSpecifiedMetadataComplete(null); assertNull(ormEntity.getTable().getDefaultCatalog()); - ormEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); + ormEntity.getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false); assertEquals("Foo", ormEntity.getTable().getDefaultCatalog()); ormEntity.getTable().setSpecifiedName("Bar"); @@ -434,10 +434,10 @@ public class OrmTableTests extends ContextModelTestCase OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping(); assertNull(ormEntity.getTable().getDefaultCatalog()); - ormEntity.entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO"); + ormEntity.getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO"); assertEquals("FOO", ormEntity.getTable().getDefaultCatalog()); - ormEntity.entityMappings().setSpecifiedCatalog("BAR"); + ormEntity.getEntityMappings().setSpecifiedCatalog("BAR"); assertEquals("BAR", ormEntity.getTable().getDefaultCatalog()); ormEntity.javaEntity().getTable().setSpecifiedCatalog("JAVA_CATALOG"); @@ -448,10 +448,10 @@ public class OrmTableTests extends ContextModelTestCase assertEquals("BAR", ormEntity.getTable().getDefaultCatalog()); - ormEntity.entityMappings().setSpecifiedCatalog(null); + ormEntity.getEntityMappings().setSpecifiedCatalog(null); assertEquals("FOO", ormEntity.getTable().getDefaultCatalog()); - ormEntity.entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog(null); + ormEntity.getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog(null); assertNull(ormEntity.getTable().getDefaultCatalog()); ormEntity.getTable().setSpecifiedName(null); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmXmlTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmXmlTests.java index 4fb870471a..c210d14c5d 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmXmlTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmXmlTests.java @@ -36,7 +36,7 @@ public class OrmXmlTests extends ContextModelTestCase } protected PersistenceXml persistenceXml() { - return rootContext().persistenceXml(); + return rootContext().getPersistenceXml(); } protected OrmXml ormXml() { diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceTests.java index 90910f79df..4dc384a858 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceTests.java @@ -24,13 +24,13 @@ public class PersistenceTests extends ContextModelTestCase } protected Persistence persistence() { - return rootContext().persistenceXml().getPersistence(); + return rootContext().getPersistenceXml().getPersistence(); } public void testUpdateAddPersistenceUnit() throws Exception { PersistenceResource prm = persistenceResource(); XmlPersistence xmlPersistence = prm.getPersistence(); - Persistence persistence = rootContext().persistenceXml().getPersistence(); + Persistence persistence = rootContext().getPersistenceXml().getPersistence(); // clear xml persistence units, test that it's clear in context xmlPersistence.getPersistenceUnits().clear(); @@ -80,7 +80,7 @@ public class PersistenceTests extends ContextModelTestCase public void testUpdateRemovePersistenceUnit() throws Exception { PersistenceResource prm = persistenceResource(); XmlPersistence xmlPersistence = prm.getPersistence(); - Persistence persistence = rootContext().persistenceXml().getPersistence(); + Persistence persistence = rootContext().getPersistenceXml().getPersistence(); // add a persistence unit and test that there are two existing xml and // one context persistence unit diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceXmlTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceXmlTests.java index 29154e4891..343f7f2ca6 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceXmlTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/PersistenceXmlTests.java @@ -22,7 +22,7 @@ public class PersistenceXmlTests extends ContextModelTestCase } protected PersistenceXml persistenceXml() { - return rootContext().persistenceXml(); + return rootContext().getPersistenceXml(); } public void testUpdateAddPersistence() throws Exception { diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/RootContextTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/RootContextTests.java index 01bbe1ded5..6e719084f2 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/RootContextTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/persistence/RootContextTests.java @@ -27,12 +27,12 @@ public class RootContextTests extends ContextModelTestCase assertFalse(pr.exists()); - JpaRootContextNode baseJpaContent = getJavaProject().getJpaProject().rootContext(); - assertNull(baseJpaContent.persistenceXml()); + JpaRootContextNode baseJpaContent = getJavaProject().getJpaProject().getRootContext(); + assertNull(baseJpaContent.getPersistenceXml()); baseJpaContent.addPersistenceXml(); - assertNotNull(baseJpaContent.persistenceXml()); + assertNotNull(baseJpaContent.getPersistenceXml()); boolean exceptionThrown = false; try { @@ -46,14 +46,14 @@ public class RootContextTests extends ContextModelTestCase } public void testModifyRemovePersistenceXml() throws Exception { - JpaRootContextNode baseJpaContent = getJavaProject().getJpaProject().rootContext(); + JpaRootContextNode baseJpaContent = getJavaProject().getJpaProject().getRootContext(); - assertNotNull(baseJpaContent.persistenceXml()); + assertNotNull(baseJpaContent.getPersistenceXml()); baseJpaContent.removePersistenceXml(); waitForWorkspaceJobs(); - assertNull(baseJpaContent.persistenceXml()); + assertNull(baseJpaContent.getPersistenceXml()); boolean exceptionThrown = false; try { @@ -72,22 +72,22 @@ public class RootContextTests extends ContextModelTestCase assertFalse(pr.exists()); - JpaRootContextNode baseJpaContent = getJavaProject().getJpaProject().rootContext(); - assertNull(baseJpaContent.persistenceXml()); + JpaRootContextNode baseJpaContent = getJavaProject().getJpaProject().getRootContext(); + assertNull(baseJpaContent.getPersistenceXml()); pr.getContents().add(PersistenceFactory.eINSTANCE.createXmlPersistence()); pr.save(null); - assertNotNull(baseJpaContent.persistenceXml()); + assertNotNull(baseJpaContent.getPersistenceXml()); } public void testUpdateRemovePersistenceXml() throws Exception { PersistenceResource pr = persistenceResource(); - JpaRootContextNode baseJpaContent = getJavaProject().getJpaProject().rootContext(); + JpaRootContextNode baseJpaContent = getJavaProject().getJpaProject().getRootContext(); - assertNotNull(baseJpaContent.persistenceXml()); + assertNotNull(baseJpaContent.getPersistenceXml()); deleteResource(pr); - assertNull(baseJpaContent.persistenceXml()); + assertNull(baseJpaContent.getPersistenceXml()); } } |