Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2011-08-03 07:09:11 -0400
committerEike Stepper2011-08-03 07:09:11 -0400
commit2f5b2ed250dd171547eacac11e26f4bc8ad0d72e (patch)
tree0aa6daf8c127692df1216935810a351f4eba5d18
parent731c4dd1fe5aa23bd7f613ce0e71e1e93cd89313 (diff)
downloadcdo-2f5b2ed250dd171547eacac11e26f4bc8ad0d72e.tar.gz
cdo-2f5b2ed250dd171547eacac11e26f4bc8ad0d72e.tar.xz
cdo-2f5b2ed250dd171547eacac11e26f4bc8ad0d72e.zip
[Tests] test model loaded incorrectly
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/GeneratedEcoreTest.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PackageRegistryTest.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_303466_Test.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/util/TestEMFUtil.java8
4 files changed, 14 insertions, 14 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/GeneratedEcoreTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/GeneratedEcoreTest.java
index 7f430a271c..600ed21102 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/GeneratedEcoreTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/GeneratedEcoreTest.java
@@ -40,7 +40,7 @@ public class GeneratedEcoreTest extends AbstractCDOTest
CDOTransaction transaction1 = session1.openTransaction();
CDOResource res1 = transaction1.createResource("/res");
- EPackage root1 = (EPackage)TestEMFUtil.loadEcore("model1.ecore", session1.getPackageRegistry());
+ EPackage root1 = TestEMFUtil.loadEcore("model1.ecore", session1.getPackageRegistry());
res1.getContents().add(root1);
transaction1.commit();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PackageRegistryTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PackageRegistryTest.java
index b20bc5e43d..bce801d264 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PackageRegistryTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/PackageRegistryTest.java
@@ -697,10 +697,10 @@ public class PackageRegistryTest extends AbstractCDOTest
{
ResourceSet rs = new ResourceSetImpl();
rs.getResourceFactoryRegistry().getExtensionToFactoryMap().put("ecore", new XMIResourceFactoryImpl());
- Resource r1 = rs.createResource(URI.createURI("file:///SubclassTest1.ecore"));
+ Resource r1 = rs.createResource(URI.createURI("SubclassTest1.ecore"));
r1.load(OM.BUNDLE.getInputStream("SubclassTest1.ecore"), null);
EPackage p1 = (EPackage)r1.getContents().get(0);
- Resource r2 = rs.createResource(URI.createURI("file:///SubclassTest2.ecore"));
+ Resource r2 = rs.createResource(URI.createURI("SubclassTest2.ecore"));
r2.load(OM.BUNDLE.getInputStream("SubclassTest2.ecore"), null);
EPackage p2 = (EPackage)r2.getContents().get(0);
@@ -723,10 +723,10 @@ public class PackageRegistryTest extends AbstractCDOTest
{
ResourceSet rs = new ResourceSetImpl();
rs.getResourceFactoryRegistry().getExtensionToFactoryMap().put("ecore", new XMIResourceFactoryImpl());
- Resource r1 = rs.createResource(URI.createURI("file:///SubclassTest1.ecore"));
+ Resource r1 = rs.createResource(URI.createURI("SubclassTest1.ecore"));
r1.load(OM.BUNDLE.getInputStream("SubclassTest1.ecore"), null);
EPackage p1 = (EPackage)r1.getContents().get(0);
- Resource r2 = rs.createResource(URI.createURI("file:///SubclassTest2.ecore"));
+ Resource r2 = rs.createResource(URI.createURI("SubclassTest2.ecore"));
r2.load(OM.BUNDLE.getInputStream("SubclassTest2.ecore"), null);
EPackage p2 = (EPackage)r2.getContents().get(0);
@@ -772,7 +772,7 @@ public class PackageRegistryTest extends AbstractCDOTest
public static EPackage loadModel(String fileName) throws IOException
{
- URI uri = URI.createURI("file://" + fileName);
+ URI uri = URI.createURI(fileName);
XMIResource resource = new XMIResourceImpl(uri);
resource.setEncoding("UTF-8");
resource.load(OM.BUNDLE.getInputStream(fileName), null);
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_303466_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_303466_Test.java
index efddd03b8f..f092710d5e 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_303466_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_303466_Test.java
@@ -14,7 +14,7 @@ import org.eclipse.emf.cdo.common.model.EMFUtil;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.tests.AbstractCDOTest;
-import org.eclipse.emf.cdo.tests.PackageRegistryTest;
+import org.eclipse.emf.cdo.tests.util.TestEMFUtil;
import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.cdo.util.CommitException;
@@ -43,7 +43,7 @@ public class Bugzilla_303466_Test extends AbstractCDOTest
CDOSession session = openSession();
ResourceSet resourceSet = EMFUtil.newEcoreResourceSet();
- EPackage derivedPkg = PackageRegistryTest.loadModel("model/derived.ecore");
+ EPackage derivedPkg = TestEMFUtil.loadEcore("model/derived.ecore");
Resource resource = derivedPkg.eResource();
resourceSet.getResources().add(resource);
resource.load(null);
@@ -94,12 +94,12 @@ public class Bugzilla_303466_Test extends AbstractCDOTest
ResourceSet resourceSet = EMFUtil.newEcoreResourceSet();
- EPackage basePkg = PackageRegistryTest.loadModel("model/base.ecore");
+ EPackage basePkg = TestEMFUtil.loadEcore("model/base.ecore");
Resource resource1 = basePkg.eResource();
resourceSet.getResources().add(resource1);
resourceSet.getPackageRegistry().put(basePkg.getNsURI(), basePkg);
- EPackage derivedPkg = PackageRegistryTest.loadModel("model/derived.ecore");
+ EPackage derivedPkg = TestEMFUtil.loadEcore("model/derived.ecore");
Resource resource2 = derivedPkg.eResource();
resourceSet.getResources().add(resource2);
resourceSet.getPackageRegistry().put(basePkg.getNsURI(), derivedPkg);
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/util/TestEMFUtil.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/util/TestEMFUtil.java
index 7763357f0b..832827758a 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/util/TestEMFUtil.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/util/TestEMFUtil.java
@@ -80,14 +80,14 @@ public final class TestEMFUtil
return loadMultiple(fileName, resourceSet);
}
- public static EObject loadEcore(String fileName, EPackage.Registry packageRegistry)
+ public static EPackage loadEcore(String fileName, EPackage.Registry packageRegistry)
{
- return load(fileName, newEcoreResourceSet(packageRegistry));
+ return (EPackage)load(fileName, newEcoreResourceSet(packageRegistry));
}
- public static EObject loadEcore(String fileName)
+ public static EPackage loadEcore(String fileName)
{
- return load(fileName, newEcoreResourceSet());
+ return (EPackage)load(fileName, newEcoreResourceSet());
}
public static void save(String fileName, EObject root, ResourceSet resourceSet)

Back to the top