diff options
author | pfullbright | 2012-07-13 16:31:19 +0000 |
---|---|---|
committer | pfullbright | 2012-07-13 16:31:19 +0000 |
commit | 143484958f62e64983946a00e4922421e7110766 (patch) | |
tree | 8f7352535c9059f1dd9caaf20939dbd71089df0e /jpa_diagram_editor | |
parent | 296e9a86d7e134c4538f1724a83c6a66fda41dda (diff) | |
download | webtools.dali-143484958f62e64983946a00e4922421e7110766.tar.gz webtools.dali-143484958f62e64983946a00e4922421e7110766.tar.xz webtools.dali-143484958f62e64983946a00e4922421e7110766.zip |
Changed API to use TypeBinding
Diffstat (limited to 'jpa_diagram_editor')
12 files changed, 149 insertions, 209 deletions
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RefactorEntityFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RefactorEntityFeature.java index 490688c104..671b32e3fe 100644 --- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RefactorEntityFeature.java +++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RefactorEntityFeature.java @@ -288,7 +288,7 @@ public abstract class RefactorEntityFeature extends AbstractCustomFeature { return; JavaResourceCompilationUnit jrcu = (JavaResourceCompilationUnit)rm; JavaResourceAbstractType jrt = jrcu.getPrimaryType(); - newJptName = jrt.getQualifiedName(); + newJptName = jrt.getTypeBinding().getQualifiedName(); s.release(); if ((ats == null) || hasNameAnnotation) return; diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPAEditorUtil.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPAEditorUtil.java index 9d51a5f531..cc76c9e8b2 100644 --- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPAEditorUtil.java +++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPAEditorUtil.java @@ -34,7 +34,6 @@ import java.util.Properties; import java.util.Set; import java.util.jar.JarEntry; import java.util.jar.JarFile; - import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IProject; @@ -202,11 +201,11 @@ public class JPAEditorUtil { } public static String getAttributeTypeName(JavaResourceAttribute at) { - return at.getTypeName(); + return at.getTypeBinding().getQualifiedName(); } public static List<String> getAttributeTypeTypeNames(JavaResourceAttribute at) { - ListIterator<String> tt = at.getTypeTypeArgumentNames().iterator(); + ListIterator<String> tt = at.getTypeBinding().getTypeArgumentNames().iterator(); if ((tt == null) || !tt.hasNext()) return null; LinkedList<String> res = new LinkedList<String>(); @@ -222,7 +221,7 @@ public class JPAEditorUtil { public static String getAttributeTypeNameWithGenerics(JavaResourceAttribute at) { StringBuilder res = new StringBuilder(getAttributeTypeName(at)); - ListIterator<String> it = at.getTypeTypeArgumentNames().iterator(); + ListIterator<String> it = at.getTypeBinding().getTypeArgumentNames().iterator(); if ((it != null) && it.hasNext()) { res.append('<'); res.append(createCommaSeparatedListOfFullTypeNames(it)); diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPASolver.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPASolver.java index 190ba6cb14..01bf8f8d49 100644 --- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPASolver.java +++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPASolver.java @@ -25,7 +25,6 @@ import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.WeakHashMap; - import org.eclipse.core.internal.resources.File; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IMarkerDelta; @@ -1033,7 +1032,7 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver { continue; JavaResourceCompilationUnit jrcu = (JavaResourceCompilationUnit)jrm; JavaResourceAbstractType jrat = jrcu.getPrimaryType(); - String name = jrat.getQualifiedName(); + String name = jrat.getTypeBinding().getQualifiedName(); JpaProject jpaProject = jpaFile.getJpaProject(); PersistenceUnit pu = JpaArtifactFactory.instance().getPersistenceUnit(jpaProject); diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JpaArtifactFactory.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JpaArtifactFactory.java index 0dcea3288f..923523498f 100644 --- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JpaArtifactFactory.java +++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JpaArtifactFactory.java @@ -27,7 +27,6 @@ import java.util.ListIterator; import java.util.Locale; import java.util.Properties; import java.util.Set; - import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; @@ -907,7 +906,7 @@ public class JpaArtifactFactory { new String[0]); if (!getAttributeMethod.exists()) { JavaPersistentAttribute jpa = jpt.getAttributeNamed(attributeName); - String typeName = jpa.getResourceAttribute().getTypeName(); + String typeName = jpa.getResourceAttribute().getTypeBinding().getQualifiedName(); if ("boolean".equals(typeName)) { //$NON-NLS-1$ getterPrefix = "is"; //$NON-NLS-1$ methodName = getterPrefix + attrNameWithCapitalLetter; @@ -1376,7 +1375,7 @@ public class JpaArtifactFactory { JavaResourceAbstractType jrt = jrcu.getPrimaryType(); if (jrt == null) continue; - String name = jrt.getQualifiedName(); + String name = jrt.getTypeBinding().getQualifiedName(); JavaPersistentType jpt1 = (JavaPersistentType) pu .getPersistentType(name); if (jpt1 == null) @@ -2196,8 +2195,8 @@ public class JpaArtifactFactory { JavaResourceAttribute jra) { String relTypeName = null; try { - boolean isMap = jra.getTypeName().equals(JPAEditorConstants.MAP_TYPE); - relTypeName = jra.getTypeTypeArgumentName(isMap ? 1 : 0); + boolean isMap = jra.getTypeBinding().getQualifiedName().equals(JPAEditorConstants.MAP_TYPE); + relTypeName = jra.getTypeBinding().getTypeArgumentName(isMap ? 1 : 0); } catch (Exception e) {} if (relTypeName == null) relTypeName = an.getFullyQualifiedTargetEntityClassName(); diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/CreateRelationFeaturesTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/CreateRelationFeaturesTest.java index 2406595dd6..eb6ad28af1 100644 --- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/CreateRelationFeaturesTest.java +++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/CreateRelationFeaturesTest.java @@ -15,14 +15,8 @@ *******************************************************************************/ package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.replay; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - +import static org.easymock.EasyMock.*; +import static org.junit.Assert.*; import org.easymock.EasyMock; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IncrementalProjectBuilder; @@ -35,11 +29,7 @@ import org.eclipse.graphiti.mm.pictograms.ContainerShape; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType; -import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable; -import org.eclipse.jpt.jpa.core.JpaFile; import org.eclipse.jpt.jpa.core.JpaProject; -import org.eclipse.jpt.jpa.core.JpaStructureNode; -import org.eclipse.jpt.jpa.core.JptJpaCorePlugin; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType; import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CreateManyToManyBiDirRelationFeature; @@ -96,15 +86,15 @@ public class CreateRelationFeaturesTest { JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.test.Address"); assertNotNull(addressType); - JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (t1 == null) { Thread.sleep(200); - t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } - JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); while (t2 == null) { Thread.sleep(200); - t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); } @@ -170,15 +160,15 @@ public class CreateRelationFeaturesTest { JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.test.Address"); assertNotNull(addressType); - JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (t1 == null) { Thread.sleep(200); - t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } - JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); while (t2 == null) { Thread.sleep(200); - t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); } @@ -237,15 +227,15 @@ public class CreateRelationFeaturesTest { JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.test.Address"); assertNotNull(addressType); - JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (t1 == null) { Thread.sleep(200); - t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } - JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); while (t2 == null) { Thread.sleep(200); - t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); } @@ -303,15 +293,15 @@ public class CreateRelationFeaturesTest { JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.test.Address"); assertNotNull(addressType); - JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (t1 == null) { Thread.sleep(200); - t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } - JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); while (t2 == null) { Thread.sleep(200); - t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); } @@ -369,15 +359,15 @@ public class CreateRelationFeaturesTest { JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.test.Address"); assertNotNull(addressType); - JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (t1 == null) { Thread.sleep(200); - t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } - JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); while (t2 == null) { Thread.sleep(200); - t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); } @@ -434,15 +424,15 @@ public class CreateRelationFeaturesTest { JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.test.Address"); assertNotNull(addressType); - JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (t1 == null) { Thread.sleep(200); - t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } - JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); while (t2 == null) { Thread.sleep(200); - t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); } @@ -499,15 +489,15 @@ public class CreateRelationFeaturesTest { JavaResourceAbstractType addressType = jpaProject.getJavaResourceType("com.test.Address"); assertNotNull(addressType); - JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (t1 == null) { Thread.sleep(200); - t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } - JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); while (t2 == null) { Thread.sleep(200); - t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); } diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/SaveEntityFeatureTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/SaveEntityFeatureTest.java index 2e90717f4f..b39bde15ec 100644 --- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/SaveEntityFeatureTest.java +++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/SaveEntityFeatureTest.java @@ -15,12 +15,8 @@ *******************************************************************************/ package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.feature; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.isA; -import static org.easymock.EasyMock.replay; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - +import static org.easymock.EasyMock.*; +import static org.junit.Assert.*; import org.easymock.EasyMock; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IncrementalProjectBuilder; @@ -30,11 +26,7 @@ import org.eclipse.graphiti.mm.pictograms.PictogramElement; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType; -import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable; -import org.eclipse.jpt.jpa.core.JpaFile; import org.eclipse.jpt.jpa.core.JpaProject; -import org.eclipse.jpt.jpa.core.JpaStructureNode; -import org.eclipse.jpt.jpa.core.JptJpaCorePlugin; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType; import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.SaveEntityFeature; import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider; @@ -72,11 +64,11 @@ public class SaveEntityFeatureTest { assertNotNull(customerType); - JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); int cnt = 0; while ((cnt < 25) && (t1 == null)) { Thread.sleep(200); - t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); cnt++; } if (t1 == null) diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationAttributesTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationAttributesTest.java index d2cc65a4d5..1149ffe48d 100644 --- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationAttributesTest.java +++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationAttributesTest.java @@ -15,13 +15,8 @@ *******************************************************************************/ package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.relation; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.isA; -import static org.easymock.EasyMock.replay; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - +import static org.easymock.EasyMock.*; +import static org.junit.Assert.*; import org.easymock.EasyMock; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IncrementalProjectBuilder; @@ -30,11 +25,7 @@ import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType; -import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable; -import org.eclipse.jpt.jpa.core.JpaFile; import org.eclipse.jpt.jpa.core.JpaProject; -import org.eclipse.jpt.jpa.core.JpaStructureNode; -import org.eclipse.jpt.jpa.core.JptJpaCorePlugin; import org.eclipse.jpt.jpa.core.context.AttributeMapping; import org.eclipse.jpt.jpa.core.context.PersistentType; import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute; @@ -98,10 +89,10 @@ public class CreateRelationAttributesTest { assertNotNull(customerType); - PersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + PersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (t1 == null) { Thread.sleep(200); - t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } assertTrue(addressFile.exists()); @@ -109,10 +100,10 @@ public class CreateRelationAttributesTest { assertNotNull(customerType); - PersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + PersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); while (t2 == null) { Thread.sleep(200); - t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); } JavaPersistentAttribute attr = JpaArtifactFactory.instance(). @@ -141,10 +132,10 @@ public class CreateRelationAttributesTest { assertNotNull(customerType); - PersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + PersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (t1 == null) { Thread.sleep(200); - t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } assertTrue(addressFile.exists()); @@ -152,10 +143,10 @@ public class CreateRelationAttributesTest { assertNotNull(customerType); - PersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + PersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); while (t2 == null) { Thread.sleep(200); - t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); } JavaPersistentAttribute attr = JpaArtifactFactory.instance(). @@ -166,10 +157,10 @@ public class CreateRelationAttributesTest { JpaArtifactFactory.instance().addOneToOneUnidirectionalRelation(featureProvider, (JavaPersistentType)t1, attr); - PersistentType pt = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + PersistentType pt = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (pt == null) { Thread.sleep(200); - pt = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + pt = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); } ReadOnlyPersistentAttribute cPersistentAttribute = pt.resolveAttribute("address"); @@ -192,10 +183,10 @@ public class CreateRelationAttributesTest { assertNotNull(customerType); - PersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + PersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (t1 == null) { Thread.sleep(200); - t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } assertTrue(creditCardFile.exists()); @@ -203,10 +194,10 @@ public class CreateRelationAttributesTest { assertNotNull(creditCardFile); - PersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, creditCardType.getQualifiedName()); + PersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, creditCardType.getTypeBinding().getQualifiedName()); while (t2 == null) { Thread.sleep(200); - t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, creditCardType.getQualifiedName()); + t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, creditCardType.getTypeBinding().getQualifiedName()); } JavaPersistentAttribute attr = JpaArtifactFactory.instance(). @@ -223,10 +214,10 @@ public class CreateRelationAttributesTest { JpaArtifactFactory.instance().addOneToOneBidirectionalRelation(featureProvider, (JavaPersistentType)t1, attr, (JavaPersistentType)t2, attr2); - PersistentType ownerPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + PersistentType ownerPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (ownerPersistentType == null) { Thread.sleep(200); - ownerPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + ownerPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } ReadOnlyPersistentAttribute ownerPersistentAttribute = ownerPersistentType.resolveAttribute("creditCard"); @@ -238,10 +229,10 @@ public class CreateRelationAttributesTest { assertTrue(((JavaOneToOneMapping)ownerSideMapping).isRelationshipOwner()); - PersistentType inversePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, creditCardType.getQualifiedName()); + PersistentType inversePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, creditCardType.getTypeBinding().getQualifiedName()); while (inversePersistentType == null) { Thread.sleep(200); - inversePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, creditCardType.getQualifiedName()); + inversePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, creditCardType.getTypeBinding().getQualifiedName()); } ReadOnlyPersistentAttribute inversePersistentAttribute = inversePersistentType.resolveAttribute("customer"); @@ -269,10 +260,10 @@ public class CreateRelationAttributesTest { assertNotNull(customerType); - PersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + PersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (t1 == null) { Thread.sleep(200); - t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } assertTrue(phoneFile.exists()); @@ -280,10 +271,10 @@ public class CreateRelationAttributesTest { assertNotNull(customerType); - PersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, phoneType.getQualifiedName()); + PersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, phoneType.getTypeBinding().getQualifiedName()); while (t2 == null) { Thread.sleep(200); - t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, phoneType.getQualifiedName()); + t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, phoneType.getTypeBinding().getQualifiedName()); } JavaPersistentAttribute attr = JpaArtifactFactory.instance().addAttribute(featureProvider, (JavaPersistentType)t1, (JavaPersistentType)t2, "phones", "phones", true, @@ -293,10 +284,10 @@ public class CreateRelationAttributesTest { JpaArtifactFactory.instance().addOneToManyUnidirectionalRelation(featureProvider, (JavaPersistentType)t1, attr, false); - PersistentType pt = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + PersistentType pt = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (pt == null) { Thread.sleep(200); - pt = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, phoneType.getQualifiedName()); + pt = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, phoneType.getTypeBinding().getQualifiedName()); } ReadOnlyPersistentAttribute cPersistentAttribute = pt.resolveAttribute("phones"); @@ -323,10 +314,10 @@ public class CreateRelationAttributesTest { assertNotNull(cruiseType); - PersistentType singleSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cruiseType.getQualifiedName()); + PersistentType singleSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cruiseType.getTypeBinding().getQualifiedName()); while (singleSidePersistentType == null) { Thread.sleep(200); - singleSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cruiseType.getQualifiedName()); + singleSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cruiseType.getTypeBinding().getQualifiedName()); } assertTrue(reservationFile.exists()); @@ -334,10 +325,10 @@ public class CreateRelationAttributesTest { assertNotNull(reservationFile); - PersistentType manySidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName()); + PersistentType manySidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getTypeBinding().getQualifiedName()); while (manySidePersistentType == null) { Thread.sleep(200); - manySidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName()); + manySidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getTypeBinding().getQualifiedName()); } JavaPersistentAttribute singleSideAttribute = JpaArtifactFactory.instance(). @@ -355,10 +346,10 @@ public class CreateRelationAttributesTest { JpaArtifactFactory.instance().addOneToManyBidirectionalRelation(featureProvider, (JavaPersistentType)singleSidePersistentType, singleSideAttribute, (JavaPersistentType)manySidePersistentType, manySideAttribute, false); // In one-to-many bidirectional relation many side is ALWAYS owner - PersistentType inversePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cruiseType.getQualifiedName()); + PersistentType inversePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cruiseType.getTypeBinding().getQualifiedName()); while (inversePersistentType == null) { Thread.sleep(200); - inversePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cruiseType.getQualifiedName()); + inversePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cruiseType.getTypeBinding().getQualifiedName()); } ReadOnlyPersistentAttribute inversePersistentAttribute = inversePersistentType.resolveAttribute("reservations"); @@ -371,11 +362,11 @@ public class CreateRelationAttributesTest { assertFalse(((JavaOneToManyMapping)inverseSideMapping).isRelationshipOwner()); // In one-to-many bidirectional relation many side is ALWAYS owner - PersistentType ownerPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName()); + PersistentType ownerPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getTypeBinding().getQualifiedName()); int c = 0; while ((ownerPersistentType == null) && (c < 50)) { Thread.sleep(200); - ownerPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName()); + ownerPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getTypeBinding().getQualifiedName()); c++; } assertNotNull(ownerPersistentType); @@ -418,10 +409,10 @@ public class CreateRelationAttributesTest { JavaResourceAbstractType cruiseType = jpaProject.getJavaResourceType("com.Cruise"); assertNotNull(cruiseType); - PersistentType manySidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cruiseType.getQualifiedName()); + PersistentType manySidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cruiseType.getTypeBinding().getQualifiedName()); while (manySidePersistentType == null) { Thread.sleep(200); - manySidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cruiseType.getQualifiedName()); + manySidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cruiseType.getTypeBinding().getQualifiedName()); } assertTrue(shipFile.exists()); @@ -429,10 +420,10 @@ public class CreateRelationAttributesTest { assertNotNull(cruiseType); - PersistentType singleSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, shipType.getQualifiedName()); + PersistentType singleSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, shipType.getTypeBinding().getQualifiedName()); while (singleSidePersistentType == null) { Thread.sleep(200); - singleSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, shipType.getQualifiedName()); + singleSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, shipType.getTypeBinding().getQualifiedName()); } JavaPersistentAttribute mappedAttribute = JpaArtifactFactory.instance(). @@ -443,10 +434,10 @@ public class CreateRelationAttributesTest { JpaArtifactFactory.instance().addManyToOneUnidirectionalRelation(featureProvider, (JavaPersistentType)manySidePersistentType, mappedAttribute); - PersistentType pt = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cruiseType.getQualifiedName()); + PersistentType pt = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cruiseType.getTypeBinding().getQualifiedName()); while (pt == null) { Thread.sleep(200); - pt = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, shipType.getQualifiedName()); + pt = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, shipType.getTypeBinding().getQualifiedName()); } ReadOnlyPersistentAttribute cPersistentAttribute = pt.resolveAttribute("ship"); @@ -484,10 +475,10 @@ public class CreateRelationAttributesTest { JavaResourceAbstractType reservationType = jpaProject.getJavaResourceType("com.Reservation"); assertNotNull(reservationType); - PersistentType ownerSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName()); + PersistentType ownerSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getTypeBinding().getQualifiedName()); while (ownerSidePersistentType == null) { Thread.sleep(200); - ownerSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName()); + ownerSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getTypeBinding().getQualifiedName()); } assertTrue(customerFile.exists()); @@ -495,10 +486,10 @@ public class CreateRelationAttributesTest { assertNotNull(customerFile); - PersistentType inverseSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + PersistentType inverseSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (inverseSidePersistentType == null) { Thread.sleep(200); - inverseSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + inverseSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } JavaPersistentAttribute ownerSideAttribute = JpaArtifactFactory.instance(). @@ -514,10 +505,10 @@ public class CreateRelationAttributesTest { JpaArtifactFactory.instance().addManyToManyBidirectionalRelation(featureProvider, (JavaPersistentType)ownerSidePersistentType, ownerSideAttribute, (JavaPersistentType)inverseSidePersistentType, inverseSideAttributes, false); - PersistentType ownerPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName()); + PersistentType ownerPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getTypeBinding().getQualifiedName()); while (ownerPersistentType == null) { Thread.sleep(200); - ownerPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName()); + ownerPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getTypeBinding().getQualifiedName()); } ReadOnlyPersistentAttribute ownerPersistentAttribute = ownerPersistentType.resolveAttribute("customers"); @@ -529,10 +520,10 @@ public class CreateRelationAttributesTest { assertTrue(((JavaManyToManyMapping)ownerSideMapping).isRelationshipOwner()); - PersistentType inversePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + PersistentType inversePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (inversePersistentType == null) { Thread.sleep(200); - inversePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + inversePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } ReadOnlyPersistentAttribute inversePersistentAttribute = inversePersistentType.resolveAttribute("reservations"); @@ -557,10 +548,10 @@ public class CreateRelationAttributesTest { JavaResourceAbstractType reservationType = jpaProject.getJavaResourceType("com.Reservation"); assertNotNull(reservationType); - PersistentType annotatedPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName()); + PersistentType annotatedPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getTypeBinding().getQualifiedName()); while (annotatedPersistentType == null) { Thread.sleep(200); - annotatedPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName()); + annotatedPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getTypeBinding().getQualifiedName()); } assertTrue(cabinFile.exists()); @@ -568,10 +559,10 @@ public class CreateRelationAttributesTest { assertNotNull(cabinFile); - PersistentType referencedPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cabinType.getQualifiedName()); + PersistentType referencedPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cabinType.getTypeBinding().getQualifiedName()); while (referencedPersistentType == null) { Thread.sleep(200); - referencedPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cabinType.getQualifiedName()); + referencedPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cabinType.getTypeBinding().getQualifiedName()); } JavaPersistentAttribute annotatedSideAttribute = JpaArtifactFactory.instance(). @@ -582,10 +573,10 @@ public class CreateRelationAttributesTest { JpaArtifactFactory.instance().addManyToManyUnidirectionalRelation(featureProvider, (JavaPersistentType)annotatedPersistentType, annotatedSideAttribute, false); - PersistentType persistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName()); + PersistentType persistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getTypeBinding().getQualifiedName()); while (persistentType == null) { Thread.sleep(200); - persistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getQualifiedName()); + persistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getTypeBinding().getQualifiedName()); } ReadOnlyPersistentAttribute persistentAttribute = persistentType.resolveAttribute("cabins"); diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsInFieldAnnotatedEntitiesTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsInFieldAnnotatedEntitiesTest.java index f313512e5d..cf15d56f59 100644 --- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsInFieldAnnotatedEntitiesTest.java +++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsInFieldAnnotatedEntitiesTest.java @@ -15,17 +15,9 @@ *******************************************************************************/ package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.relation; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.isA; -import static org.easymock.EasyMock.replay; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; - +import static org.easymock.EasyMock.*; +import static org.junit.Assert.*; import java.util.Set; - import org.easymock.EasyMock; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IncrementalProjectBuilder; @@ -35,11 +27,7 @@ import org.eclipse.jdt.core.IField; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType; -import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable; -import org.eclipse.jpt.jpa.core.JpaFile; import org.eclipse.jpt.jpa.core.JpaProject; -import org.eclipse.jpt.jpa.core.JpaStructureNode; -import org.eclipse.jpt.jpa.core.JptJpaCorePlugin; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType; import org.eclipse.jpt.jpa.core.resource.java.OwnableRelationshipMappingAnnotation; @@ -98,10 +86,10 @@ public class CreateRelationsInFieldAnnotatedEntitiesTest { assertNotNull(customerType); - JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (t1 == null) { Thread.sleep(200); - t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } assertTrue(addressFile.exists()); @@ -109,10 +97,10 @@ public class CreateRelationsInFieldAnnotatedEntitiesTest { assertNotNull(customerType); - JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); while (t2 == null) { Thread.sleep(200); - t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); } ICompilationUnit cu1 = createCompilationUnitFrom((IFile)t1.getResource()); AbstractRelation rel = new OneToOneUniDirRelation(featureProvider, t1, t2, "address", @@ -150,10 +138,10 @@ public class CreateRelationsInFieldAnnotatedEntitiesTest { assertNotNull(customerType); - JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (t1 == null) { Thread.sleep(200); - t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } assertTrue(addressFile.exists()); @@ -161,10 +149,10 @@ public class CreateRelationsInFieldAnnotatedEntitiesTest { assertNotNull(customerType); - JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); while (t2 == null) { Thread.sleep(200); - t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); } ICompilationUnit cu1 = createCompilationUnitFrom((IFile)t1.getResource()); ICompilationUnit cu2 = createCompilationUnitFrom((IFile)t2.getResource()); @@ -214,10 +202,10 @@ public class CreateRelationsInFieldAnnotatedEntitiesTest { assertNotNull(customerType); - JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (t1 == null) { Thread.sleep(200); - t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } assertTrue(addressFile.exists()); @@ -225,10 +213,10 @@ public class CreateRelationsInFieldAnnotatedEntitiesTest { assertNotNull(customerType); - JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); while (t2 == null) { Thread.sleep(200); - t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); } ICompilationUnit cu1 = createCompilationUnitFrom((IFile)t1.getResource()); AbstractRelation rel = new OneToManyUniDirRelation(featureProvider, t1, t2, "address", @@ -267,10 +255,10 @@ public class CreateRelationsInFieldAnnotatedEntitiesTest { assertNotNull(customerType); - JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (t1 == null) { Thread.sleep(200); - t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } assertTrue(addressFile.exists()); @@ -278,10 +266,10 @@ public class CreateRelationsInFieldAnnotatedEntitiesTest { assertNotNull(customerType); - JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); while (t2 == null) { Thread.sleep(200); - t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); } ICompilationUnit cu1 = createCompilationUnitFrom((IFile)t1.getResource()); AbstractRelation rel = new ManyToOneUniDirRelation(featureProvider, t1, t2, "address", @@ -320,10 +308,10 @@ public class CreateRelationsInFieldAnnotatedEntitiesTest { assertNotNull(customerType); - JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (t1 == null) { Thread.sleep(200); - t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } assertTrue(addressFile.exists()); @@ -331,10 +319,10 @@ public class CreateRelationsInFieldAnnotatedEntitiesTest { assertNotNull(customerType); - JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); while (t2 == null) { Thread.sleep(200); - t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); } ICompilationUnit cu1 = createCompilationUnitFrom((IFile)t1.getResource()); ICompilationUnit cu2 = createCompilationUnitFrom((IFile)t2.getResource()); @@ -383,10 +371,10 @@ public class CreateRelationsInFieldAnnotatedEntitiesTest { assertNotNull(customerType); - JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (t1 == null) { Thread.sleep(200); - t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } assertTrue(addressFile.exists()); @@ -394,10 +382,10 @@ public class CreateRelationsInFieldAnnotatedEntitiesTest { assertNotNull(customerType); - JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); while (t2 == null) { Thread.sleep(200); - t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); } ICompilationUnit cu1 = createCompilationUnitFrom((IFile)t1.getResource()); AbstractRelation rel = new ManyToManyUniDirRelation(featureProvider, t1, t2, "address", @@ -436,10 +424,10 @@ public class CreateRelationsInFieldAnnotatedEntitiesTest { assertNotNull(customerType); - JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (t1 == null) { Thread.sleep(200); - t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } assertTrue(addressFile.exists()); @@ -447,10 +435,10 @@ public class CreateRelationsInFieldAnnotatedEntitiesTest { assertNotNull(customerType); - JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); while (t2 == null) { Thread.sleep(200); - t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); } ICompilationUnit cu1 = createCompilationUnitFrom((IFile)t1.getResource()); ICompilationUnit cu2 = createCompilationUnitFrom((IFile)t2.getResource()); diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsTest.java index 7f420ed395..cac35627da 100644 --- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsTest.java +++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsTest.java @@ -15,14 +15,8 @@ *******************************************************************************/ package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.relation; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.isA; -import static org.easymock.EasyMock.replay; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; +import static org.easymock.EasyMock.*; +import static org.junit.Assert.*; import java.util.Iterator; import java.util.Properties; import org.easymock.EasyMock; @@ -104,7 +98,7 @@ public class CreateRelationsTest { assertNotNull(customerType); - t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); expect(featureProvider.getPictogramElementForBusinessObject(t1)).andStubReturn(isA(Shape.class)); cu1 = JavaCore.createCompilationUnitFrom(customerFile); @@ -115,7 +109,7 @@ public class CreateRelationsTest { assertNotNull(customerType); - t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getQualifiedName()); + t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); expect(featureProvider.getPictogramElementForBusinessObject(t2)).andStubReturn(isA(Shape.class)); cu2 = JavaCore.createCompilationUnitFrom(addressFile); @@ -300,7 +294,7 @@ public class CreateRelationsTest { JavaResourceAbstractType customerType = jpa20Project.getJavaResourceType("com.test.Customer"); assertNotNull(customerType); - JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, customerType.getQualifiedName()); + JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, customerType.getTypeBinding().getQualifiedName()); expect(featureProvider20.getPictogramElementForBusinessObject(t1)).andStubReturn(isA(Shape.class)); ICompilationUnit cu1 = JavaCore.createCompilationUnitFrom(customerFile); @@ -311,7 +305,7 @@ public class CreateRelationsTest { assertNotNull(customerType); - JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, addressType.getQualifiedName()); + JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, addressType.getTypeBinding().getQualifiedName()); expect(featureProvider20.getPictogramElementForBusinessObject(t2)).andStubReturn(isA(Shape.class)); ICompilationUnit cu2 = JavaCore.createCompilationUnitFrom(addressFile); @@ -366,7 +360,7 @@ public class CreateRelationsTest { JavaResourceAbstractType employeeType = jpa20Project.getJavaResourceType("com.test.Employee"); assertNotNull(employeeType); - JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, employeeType.getQualifiedName()); + JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, employeeType.getTypeBinding().getQualifiedName()); expect(featureProvider20.getPictogramElementForBusinessObject(t1)).andStubReturn(isA(Shape.class)); ICompilationUnit cu1 = JavaCore.createCompilationUnitFrom(employeeFile); @@ -377,7 +371,7 @@ public class CreateRelationsTest { assertNotNull(employeeType); - JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, projectType.getQualifiedName()); + JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, projectType.getTypeBinding().getQualifiedName()); expect(featureProvider20.getPictogramElementForBusinessObject(t2)).andStubReturn(isA(Shape.class)); ICompilationUnit cu2 = JavaCore.createCompilationUnitFrom(projectFile); @@ -425,7 +419,7 @@ public class CreateRelationsTest { assertNotNull(employeeType); - JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, employeeType.getQualifiedName()); + JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, employeeType.getTypeBinding().getQualifiedName()); expect(featureProvider20.getPictogramElementForBusinessObject(t1)).andStubReturn(isA(Shape.class)); ICompilationUnit cu1 = JavaCore.createCompilationUnitFrom(employeeFile); @@ -440,7 +434,7 @@ public class CreateRelationsTest { assertNotNull(employeeType); - JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, projectType.getQualifiedName()); + JavaPersistentType t2 = JpaArtifactFactory.instance().getContextPersistentType(jpa20Project, projectType.getTypeBinding().getQualifiedName()); expect(featureProvider20.getPictogramElementForBusinessObject(t2)).andStubReturn(isA(Shape.class)); ICompilationUnit cu2 = JavaCore.createCompilationUnitFrom(projectFile); diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/CreateDeleteEntity.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/CreateDeleteEntity.java index 668cf6eb16..d9acdb512d 100644 --- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/CreateDeleteEntity.java +++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/CreateDeleteEntity.java @@ -15,10 +15,7 @@ *******************************************************************************/ package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.util; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.NullProgressMonitor; @@ -92,11 +89,11 @@ public class CreateDeleteEntity { c++; } assertNotNull(persistenceType); - PersistentType t = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, persistenceType.getQualifiedName()); + PersistentType t = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, persistenceType.getTypeBinding().getQualifiedName()); c = 0; while ((t == null) && (c < 100)) { Thread.sleep(500); - t = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, persistenceType.getQualifiedName()); + t = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, persistenceType.getTypeBinding().getQualifiedName()); c++; } JpaArtifactFactory.instance().deletePersistenceTypeResource(t); diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JPAEditorUtilTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JPAEditorUtilTest.java index 27896cb773..8a324b4e6e 100644 --- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JPAEditorUtilTest.java +++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JPAEditorUtilTest.java @@ -15,15 +15,9 @@ *******************************************************************************/ package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.util; -import static org.easymock.EasyMock.createMock; -import static org.easymock.EasyMock.expect; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - +import static org.easymock.EasyMock.*; +import static org.junit.Assert.*; import java.util.List; - import org.easymock.EasyMock; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IncrementalProjectBuilder; @@ -181,7 +175,7 @@ public class JPAEditorUtilTest { ICompilationUnit cu = createCompilationUnitFrom(customerFile); Thread.sleep(2000); JavaPersistentType jpt = JPAEditorUtil.getJPType(cu); - assertEquals(customerType.getQualifiedName(), jpt.getName()); + assertEquals(customerType.getTypeBinding().getQualifiedName(), jpt.getName()); } @Test @@ -270,11 +264,11 @@ public class JPAEditorUtilTest { JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer"); assertNotNull(customerType); - JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); int cnt = 0; while ((cnt < 25) && (t1 == null)) { Thread.sleep(200); - t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); cnt++; } if (t1 == null) diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JpaArtifactFactoryTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JpaArtifactFactoryTest.java index cae7c866ce..336ba1e09d 100644 --- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JpaArtifactFactoryTest.java +++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JpaArtifactFactoryTest.java @@ -15,11 +15,8 @@ *******************************************************************************/ package org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.util; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.replay; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - +import static org.easymock.EasyMock.*; +import static org.junit.Assert.*; import org.easymock.EasyMock; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IncrementalProjectBuilder; @@ -154,10 +151,10 @@ public class JpaArtifactFactoryTest { JavaResourceAbstractType customerType = jpaProject.getJavaResourceType("com.test.Customer"); assertNotNull(customerType); - JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + JavaPersistentType t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); while (t1 == null) { Thread.sleep(200); - t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getQualifiedName()); + t1 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } ICompilationUnit cu1 = createCompilationUnitFrom(customerFile); expect(featureProvider.getCompilationUnit(t1)).andStubReturn(cu1); |