Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Monnier2014-12-08 14:21:42 +0000
committerGerrit Code Review @ Eclipse.org2014-12-08 14:21:42 +0000
commit8d3f91b689f62ccb460bf4d38b8446b3ba5c2d42 (patch)
tree30f73b546a7acd953856890446016e72e88d3106 /plugins
parentc34e3388b9035981bceb658b5682a64070de0edc (diff)
parentb50f4b0b335bd35f271d19c8a9d2c45eb13a78bc (diff)
downloadcdo-8d3f91b689f62ccb460bf4d38b8446b3ba5c2d42.tar.gz
cdo-8d3f91b689f62ccb460bf4d38b8446b3ba5c2d42.tar.xz
cdo-8d3f91b689f62ccb460bf4d38b8446b3ba5c2d42.zip
Merge "[435198] Add a test to Bugzilla_435198_Test on AbstractCDOView.getObject() call with a CDOResource's id"
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_435198_Test.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_435198_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_435198_Test.java
index d187d1a670..411bb7dffe 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_435198_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_435198_Test.java
@@ -22,6 +22,8 @@ import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.junit.Assert;
+
import javax.annotation.Resource;
/**
@@ -36,6 +38,8 @@ public class Bugzilla_435198_Test extends AbstractCDOTest
private CDOID companyID;
+ private CDOID resourceCDOID;
+
@Override
public void setUp() throws Exception
{
@@ -46,6 +50,7 @@ public class Bugzilla_435198_Test extends AbstractCDOTest
CDOResource resource = transaction.getOrCreateResource(getResourcePath(RESOURCE_NAME));
resource.getContents().add(getModel1Factory().createCompany());
transaction.commit();
+ resourceCDOID = resource.cdoID();
companyID = CDOUtil.getCDOObject(resource.getContents().get(0)).cdoID();
}
@@ -64,6 +69,23 @@ public class Bugzilla_435198_Test extends AbstractCDOTest
}
/**
+ * Test the simple working case, a {@link CDOView#getObject(CDOID)} with a CDOResource's id call add the {@link Resource} to the {@link ResourceSet}.
+ */
+ public void testAbstractCDOView_GetObjectWithCDOResourceId_ResourceSetAddition() throws Exception
+ {
+ CDOSession session = openSession();
+ CDOView view = session.openView();
+
+ CDOObject object = view.getObject(resourceCDOID);
+ Assert.assertTrue(object instanceof CDOResource);
+ CDOResource resource = (CDOResource)object;
+ EObject company = resource.getContents().get(0);
+
+ assertEquals(1, view.getResourceSet().getResources().size());
+ assertEquals(view.getResourceSet().getResources().get(0), company.eResource());
+ }
+
+ /**
* Test the simple working case, a {@link CDOView#getResource(String)} call add the {@link Resource} to the {@link ResourceSet}.
*/
public void testAbstractCDOView_GetResource_ResourceSetAddition() throws Exception

Back to the top