Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorslewis2018-09-27 17:27:23 -0400
committerslewis2018-09-27 17:27:23 -0400
commit1f426000a4ea9569d24f64c866cc10e3144ba319 (patch)
tree535cf3be0bbf37410b3c6419431300d065896920 /tests
parente0673ed9090a25ac57c511d0458e4ff01aecce50 (diff)
downloadorg.eclipse.ecf-1f426000a4ea9569d24f64c866cc10e3144ba319.tar.gz
org.eclipse.ecf-1f426000a4ea9569d24f64c866cc10e3144ba319.tar.xz
org.eclipse.ecf-1f426000a4ea9569d24f64c866cc10e3144ba319.zip
Fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=539556
Diffstat (limited to 'tests')
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/ITestEnum.java21
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/OSGIObjectStreamTest.java8
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/TestEnumImpl.java17
3 files changed, 45 insertions, 1 deletions
diff --git a/tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/ITestEnum.java b/tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/ITestEnum.java
new file mode 100644
index 000000000..5e83a6865
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/ITestEnum.java
@@ -0,0 +1,21 @@
+package org.eclipse.ecf.tests.core.util;
+
+import java.io.Serializable;
+
+public interface ITestEnum extends Serializable {
+
+ enum ColumnType {
+ METADATA,
+ ICON
+ }
+
+ enum DataType {
+ STRING,
+ DATE,
+ INTEGER,
+ FILE_SIZE,
+ USER
+ }
+
+ ColumnType getColumnType();
+}
diff --git a/tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/OSGIObjectStreamTest.java b/tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/OSGIObjectStreamTest.java
index 639b1f9c7..352ffbfe3 100644
--- a/tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/OSGIObjectStreamTest.java
+++ b/tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/OSGIObjectStreamTest.java
@@ -59,6 +59,7 @@ public class OSGIObjectStreamTest extends TestCase {
String s;
MySerializable ser;
Bundle b;
+ TestEnumImpl testEnum;
@Override
protected void setUp() throws Exception {
@@ -82,6 +83,8 @@ public class OSGIObjectStreamTest extends TestCase {
ser = new MySerializable("first string", 100, new byte[] { 1, 2, 3 });
b = Activator.getContext().getBundle();
+
+ testEnum = new TestEnumImpl();
}
public void testOSGIObjectOutputStream() throws Exception {
@@ -149,5 +152,8 @@ public class OSGIObjectStreamTest extends TestCase {
assertTrue(Arrays.equals(r.getBytes(),ser.getBytes()));
}
-
+ public void testEnum() throws Exception {
+ ITestEnum desTestEnum = (ITestEnum) serializeDeserialize(testEnum);
+ assertEquals(desTestEnum.getColumnType().name(),testEnum.getColumnType().name());
+ }
}
diff --git a/tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/TestEnumImpl.java b/tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/TestEnumImpl.java
new file mode 100644
index 000000000..c39f4dfb1
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/TestEnumImpl.java
@@ -0,0 +1,17 @@
+package org.eclipse.ecf.tests.core.util;
+
+public class TestEnumImpl implements ITestEnum {
+
+ private static final long serialVersionUID = 1L;
+
+ private ColumnType columnType;
+
+ public ColumnType getColumnType() {
+ return columnType;
+ }
+
+ public TestEnumImpl() {
+ this.columnType = ITestEnum.ColumnType.METADATA;
+ }
+
+}

Back to the top