Author: julien_viet
Date: 2009-12-17 09:10:32 -0500 (Thu, 17 Dec 2009)
New Revision: 1049
Modified:
portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/ChromatticIntegrationTestCase.java
portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/FooEntity.java
Log:
added persistence unit test
Modified:
portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/ChromatticIntegrationTestCase.java
===================================================================
---
portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/ChromatticIntegrationTestCase.java 2009-12-17
13:55:28 UTC (rev 1048)
+++
portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/ChromatticIntegrationTestCase.java 2009-12-17
14:10:32 UTC (rev 1049)
@@ -216,4 +216,24 @@
chromatticManager.endRequest(false);
}
}
+
+ public void testPersistence() throws Exception {
+
+ chromatticManager.beginRequest();
+ ChromatticSession session = testLF.getChromattic().openSession();
+ FooEntity foo = session.create(FooEntity.class);
+ String fooId = session.persist(foo, "testPersistence");
+ session.save();
+ chromatticManager.endRequest(true);
+
+ chromatticManager.beginRequest();
+ session = testLF.getChromattic().openSession();
+ foo = session.findById(FooEntity.class, fooId);
+ session.close();
+ chromatticManager.endRequest(false);
+
+ assertNotNull(foo);
+
+ }
+
}
Modified:
portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/FooEntity.java
===================================================================
---
portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/FooEntity.java 2009-12-17
13:55:28 UTC (rev 1048)
+++
portal/trunk/component/common/src/test/java/org/exoplatform/commons/chromattic/FooEntity.java 2009-12-17
14:10:32 UTC (rev 1049)
@@ -25,7 +25,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-@NodeMapping(name = "foo")
+@NodeMapping(name = "nt:base")
public abstract class FooEntity
{