cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r463117 - /incubator/cayenne/main/trunk/integration-test/pojo/src/test/java/org/apache/cayenne/itest/pojo/SimpleObjectTest.java
Date Thu, 12 Oct 2006 02:57:35 GMT
Author: aadamchik
Date: Wed Oct 11 19:57:35 2006
New Revision: 463117

URL: http://svn.apache.org/viewvc?view=rev&rev=463117
Log:
CAY-682 Generic Cayenne POJO enhancer
Now passes a simple property update test

Modified:
    incubator/cayenne/main/trunk/integration-test/pojo/src/test/java/org/apache/cayenne/itest/pojo/SimpleObjectTest.java

Modified: incubator/cayenne/main/trunk/integration-test/pojo/src/test/java/org/apache/cayenne/itest/pojo/SimpleObjectTest.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/integration-test/pojo/src/test/java/org/apache/cayenne/itest/pojo/SimpleObjectTest.java?view=diff&rev=463117&r1=463116&r2=463117
==============================================================================
--- incubator/cayenne/main/trunk/integration-test/pojo/src/test/java/org/apache/cayenne/itest/pojo/SimpleObjectTest.java
(original)
+++ incubator/cayenne/main/trunk/integration-test/pojo/src/test/java/org/apache/cayenne/itest/pojo/SimpleObjectTest.java
Wed Oct 11 19:57:35 2006
@@ -46,4 +46,19 @@
 		assertEquals("Y", o.getName());
 		assertEquals(5, DataObjectUtils.intPKForObject((Persistent) o));
 	}
+
+	public void testUpdate() throws Exception {
+		getDbHelper().deleteAll("entity1");
+		getDbHelper().insert("entity1", new String[] { "id", "name" },
+				new Object[] { 5, "Y" });
+
+		SelectQuery q = new SelectQuery(Entity1.class);
+		List results = context.performQuery(q);
+		assertEquals(1, results.size());
+
+		Entity1 o = (Entity1) results.get(0);
+		o.setName(o.getName() + "-U");
+		context.commitChanges();
+		assertEquals("Y-U", getDbHelper().getObject("entity1", "name"));
+	}
 }



Mime
View raw message