Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2018-04-24 00:32:21 -0400
committerEike Stepper2018-04-24 00:32:21 -0400
commit5fe0848ec3ae550523f1204e11903f804adab999 (patch)
tree28ad30e17f77f2c0def65443a3b7d5f803d69f69 /plugins/org.eclipse.emf.cdo.tests/src
parent71558cffe67d4e4d42dd883d5f037d3d28102427 (diff)
downloadcdo-5fe0848ec3ae550523f1204e11903f804adab999.tar.gz
cdo-5fe0848ec3ae550523f1204e11903f804adab999.tar.xz
cdo-5fe0848ec3ae550523f1204e11903f804adab999.zip
[517391] [CDO] Exporter/Importer do not handle byte array attributes
https://bugs.eclipse.org/bugs/show_bug.cgi?id=517391
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.tests/src')
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BackupTest.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BackupTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BackupTest.java
index d97d29b13e..25bdc07975 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BackupTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BackupTest.java
@@ -27,6 +27,7 @@ import org.eclipse.emf.cdo.tests.model3.Point;
import org.eclipse.emf.cdo.tests.model3.Polygon;
import org.eclipse.emf.cdo.tests.model5.Doctor;
import org.eclipse.emf.cdo.tests.model5.TestFeatureMap;
+import org.eclipse.emf.cdo.tests.model6.UnsettableAttributes;
import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.cdo.util.CommitException;
import org.eclipse.emf.cdo.view.CDOView;
@@ -163,6 +164,24 @@ public class BackupTest extends AbstractCDOTest
exporter.exportRepository(baos);
}
+ public void testExportByteArray() throws Exception
+ {
+ UnsettableAttributes object = getModel6Factory().createUnsettableAttributes();
+ object.setAttrByteArray(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -2, -3, -128, 127 });
+
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.createResource(getResourcePath("/res1"));
+ resource.getContents().add(object);
+ transaction.commit();
+
+ InternalRepository repo1 = getRepository();
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ CDOServerExporter.XML exporter = new CDOServerExporter.XML(repo1);
+ exporter.exportRepository(baos);
+ }
+
public void testExportCustomDataType() throws Exception
{
CDOSession session = openSession();
@@ -381,6 +400,31 @@ public class BackupTest extends AbstractCDOTest
}
@CleanRepositoriesBefore(reason = "Inactive repository required")
+ public void testImportByteArray() throws Exception
+ {
+ UnsettableAttributes object = getModel6Factory().createUnsettableAttributes();
+ object.setAttrByteArray(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -2, -3, -128, 127 });
+
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.createResource(getResourcePath("/res1"));
+ resource.getContents().add(object);
+ transaction.commit();
+
+ InternalRepository repo1 = getRepository();
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ CDOServerExporter.XML exporter = new CDOServerExporter.XML(repo1);
+ exporter.exportRepository(baos);
+
+ InternalRepository repo2 = getRepository("repo2", false);
+
+ ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+ CDOServerImporter.XML importer = new CDOServerImporter.XML(repo2);
+ importer.importRepository(bais);
+ }
+
+ @CleanRepositoriesBefore(reason = "Inactive repository required")
public void testImportCustomDataType() throws Exception
{
CDOSession session = openSession();

Back to the top