summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2006-09-06 02:22:24 (EDT)
committerEike Stepper2006-09-06 02:22:24 (EDT)
commitc434765219c35c559710a54db796c170840cbf95 (patch)
tree526c4ae8ec5d802a9534072a66ce335f3c72f5b6
parent8332ed884a4cdd292a24fe191f99fcf92c6be8c5 (diff)
downloadcdo-c434765219c35c559710a54db796c170840cbf95.zip
cdo-c434765219c35c559710a54db796c170840cbf95.tar.gz
cdo-c434765219c35c559710a54db796c170840cbf95.tar.bz2
[156162] Add import/export
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/SerializationTest.java44
1 files changed, 2 insertions, 42 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/SerializationTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/SerializationTest.java
index 510325b..1fd4876 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/SerializationTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/SerializationTest.java
@@ -11,9 +11,6 @@
package org.eclipse.emf.cdo.tests.model1;
-import org.eclipse.emf.cdo.client.CDOPersistable;
-import org.eclipse.emf.cdo.client.CDOResource;
-
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
@@ -28,17 +25,13 @@ import org.eclipse.net4j.util.IOHelper;
import testmodel1.TreeNode;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
-import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.io.InputStreamReader;
import java.io.OutputStream;
@@ -66,7 +59,7 @@ public class SerializationTest extends AbstractModel1Test
saveRoot(root, RESOURCE);
TreeNode loaded = (TreeNode) loadRoot(RESOURCE);
- preLoadResource((CDOResource) loaded.eResource());
+ loaded.cdoGetResource().preLoad();
EObject copied = EcoreUtil.copy(loaded);
ResourceSet resourceSet = createXMIResourceSet();
@@ -123,7 +116,7 @@ public class SerializationTest extends AbstractModel1Test
saveRoot(root, RESOURCE);
TreeNode loaded = (TreeNode) loadRoot(RESOURCE);
- preLoadResource((CDOResource) loaded.eResource());
+ loaded.cdoGetResource().preLoad();
EObject copied = EcoreUtil.copy(loaded);
ResourceSet resourceSet = createXMIResourceSet();
@@ -211,37 +204,4 @@ public class SerializationTest extends AbstractModel1Test
IOHelper.close(os);
}
}
-
- protected void preLoadResource(CDOResource cdoResource)
- {
- for (Iterator it = EcoreUtil.getAllContents(cdoResource, true); it.hasNext();)
- {
- CDOPersistable persistable = (CDOPersistable) it.next();
- persistable.cdoLoad();
- }
- }
-
- @Deprecated
- protected void assertFileContent(String content, File file) throws IOException
- {
- String[] lines = content.split("\n");
- FileInputStream stream = null;
-
- try
- {
- stream = new FileInputStream(file);
- BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
-
- for (int i = 0; i < lines.length; i++)
- {
- String expectedLine = lines[i];
- String fileLine = reader.readLine();
- assertEquals(expectedLine, fileLine);
- }
- }
- finally
- {
- IOHelper.close(stream);
- }
- }
}