Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2006-08-26 21:11:45 +0000
committerEike Stepper2006-08-26 21:11:45 +0000
commitfc79cba952d6d828f4ff704d6e9c71f3ade219c2 (patch)
tree278ffe43d60daf79e7f242eeba865b4563620574
parentd426bfda588394504805138b67408cb7a5c5c74a (diff)
downloadcdo-fc79cba952d6d828f4ff704d6e9c71f3ade219c2.tar.gz
cdo-fc79cba952d6d828f4ff704d6e9c71f3ade219c2.tar.xz
cdo-fc79cba952d6d828f4ff704d6e9c71f3ade219c2.zip
[154522] Copy from CDO resource to XMI resource does not work
https://bugs.eclipse.org/bugs/show_bug.cgi?id=154389
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/model1/SerializationTest.java31
1 files changed, 28 insertions, 3 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 87a1282baa..24e440a490 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
@@ -31,11 +31,14 @@ 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;
@@ -75,7 +78,7 @@ public class SerializationTest extends AbstractModel1Test
{ // Verification
String content = IOHelper.readFully(FILE);
- assertEquals(CONTENT, content);
+ assertFileContent(CONTENT, FILE);
}
}
finally
@@ -131,8 +134,7 @@ public class SerializationTest extends AbstractModel1Test
}
{ // Verification
- String content = IOHelper.readFully(FILE);
- assertEquals(CONTENT, content);
+ assertFileContent(CONTENT, FILE);
}
}
finally
@@ -217,4 +219,27 @@ public class SerializationTest extends AbstractModel1Test
persistable.cdoLoad();
}
}
+
+ 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);
+ }
+ }
}

Back to the top