cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From torehal...@apache.org
Subject svn commit: r1394459 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne: access/IncrementalFaultListTest.java reflect/generic/ reflect/generic/DataObjectAttributePropertyTest.java
Date Fri, 05 Oct 2012 11:50:54 GMT
Author: torehalset
Date: Fri Oct  5 11:50:54 2012
New Revision: 1394459

URL: http://svn.apache.org/viewvc?rev=1394459&view=rev
Log:
serialization junit tests for CAY-1741 and CAY-1735

Added:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/IncrementalFaultListTest.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/reflect/generic/
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/reflect/generic/DataObjectAttributePropertyTest.java

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/IncrementalFaultListTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/IncrementalFaultListTest.java?rev=1394459&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/IncrementalFaultListTest.java
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/IncrementalFaultListTest.java
Fri Oct  5 11:50:54 2012
@@ -0,0 +1,28 @@
+package org.apache.cayenne.access;
+
+import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.query.SelectQuery;
+import org.apache.cayenne.testdo.testmap.Artist;
+import org.apache.cayenne.unit.di.server.ServerCase;
+import org.apache.cayenne.unit.di.server.UseServerRuntime;
+import org.apache.cayenne.util.Util;
+
+@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+public class IncrementalFaultListTest extends ServerCase {
+
+	@Inject
+	protected DataContext context;
+
+	public void testSerialization() throws Exception {
+		SelectQuery query = new SelectQuery(Artist.class);
+		query.setPageSize(10);
+		
+		IncrementalFaultList<Artist> i1 = new IncrementalFaultList<Artist>(context,
query, 10);
+		IncrementalFaultList<Artist> i2 = Util.cloneViaSerialization(i1);
+		
+		assertNotNull(i2);
+		assertEquals(i1.getMaxFetchSize(), i2.getMaxFetchSize());
+		assertEquals(i1.getClass(), i2.getClass());
+	}
+
+}

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/reflect/generic/DataObjectAttributePropertyTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/reflect/generic/DataObjectAttributePropertyTest.java?rev=1394459&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/reflect/generic/DataObjectAttributePropertyTest.java
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/reflect/generic/DataObjectAttributePropertyTest.java
Fri Oct  5 11:50:54 2012
@@ -0,0 +1,24 @@
+package org.apache.cayenne.reflect.generic;
+
+import junit.framework.TestCase;
+
+import org.apache.cayenne.map.ObjAttribute;
+import org.apache.cayenne.map.ObjEntity;
+import org.apache.cayenne.util.Util;
+
+public class DataObjectAttributePropertyTest extends TestCase {
+	
+	public void testSerialization() throws Exception {
+		ObjEntity e1 = new ObjEntity("objEntityName");
+		ObjAttribute a1 = new ObjAttribute("aName", "aType", e1);
+		
+		DataObjectAttributeProperty p1 = new DataObjectAttributeProperty(a1);
+		DataObjectAttributeProperty p2 = Util.cloneViaSerialization(p1);
+		
+		assertNotNull(p2);
+		assertNotNull(p2.getAttribute());
+		assertEquals(p1.getAttribute().getName(), p2.getAttribute().getName());
+		assertEquals(p1.getName(), p2.getName());
+	}
+
+}



Mime
View raw message