Author: julien_viet
Date: 2010-01-14 12:30:00 -0500 (Thu, 14 Jan 2010)
New Revision: 1299
Added:
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E1.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E2.java
Removed:
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E.java
Modified:
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/TestSerialization.java
Log:
refactor a bit a unit test
Deleted: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E.java
===================================================================
---
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E.java 2010-01-14
17:24:58 UTC (rev 1298)
+++
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E.java 2010-01-14
17:30:00 UTC (rev 1299)
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.exoplatform.webui.replication;
-
-import org.exoplatform.webui.application.replication.annotations.ReplicatedType;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
- * @version $Revision$
- */
-@ReplicatedType
-public class E
-{
-
- E left;
- E right;
-
-}
Added: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E1.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E1.java
(rev 0)
+++
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E1.java 2010-01-14
17:30:00 UTC (rev 1299)
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.exoplatform.webui.replication;
+
+import org.exoplatform.webui.application.replication.annotations.ReplicatedType;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+@ReplicatedType
+public class E1
+{
+}
Copied: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E2.java
(from rev 1269,
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E.java)
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E2.java
(rev 0)
+++
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/E2.java 2010-01-14
17:30:00 UTC (rev 1299)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.exoplatform.webui.replication;
+
+import org.exoplatform.webui.application.replication.annotations.ReplicatedType;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+@ReplicatedType
+public class E2 extends E1
+{
+
+ E1 left;
+ E1 right;
+
+}
Modified:
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/TestSerialization.java
===================================================================
---
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/TestSerialization.java 2010-01-14
17:24:58 UTC (rev 1298)
+++
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/replication/TestSerialization.java 2010-01-14
17:30:00 UTC (rev 1299)
@@ -60,17 +60,17 @@
public void testAAA() throws Exception
{
TypeDomain domain = new TypeDomain();
- domain.add(E.class);
- E e = new E();
- e.left = new E();
- e.left.left = new E();
- e.left.right = new E();
- e.right = new E();
- e.right.left = e.left.left;
- e.right.right = e.left.right;
+ domain.add(E2.class);
+ E2 e = new E2();
+ e.left = new E2();
+ ((E2)e.left).left = new E1();
+ ((E2)e.left).right = new E1();
+ e.right = new E2();
+ ((E2)e.right).left = ((E2)e.left).left;
+ ((E2)e.right).right = ((E2)e.left).right;
SerializationContext context = new SerializationContext(domain);
e = context.clone(e);
- assertSame(e.left.left, e.right.left);
- assertSame(e.left.right, e.right.right);
+ assertSame(((E2)e.left).left, ((E2)e.right).left);
+ assertSame(((E2)e.left).right, ((E2)e.right).right);
}
}