From: <one...@us...> - 2003-03-06 11:21:44
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv14212/hibernate/test Modified Files: MultiTableTest.java Log Message: detect collection modifications not made via wrapper Index: MultiTableTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/test/MultiTableTest.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** MultiTableTest.java 30 Dec 2002 13:11:42 -0000 1.22 --- MultiTableTest.java 6 Mar 2003 10:55:09 -0000 1.23 *************** *** 7,10 **** --- 7,11 ---- import java.util.HashSet; import java.util.Iterator; + import java.util.List; import java.util.Set; *************** *** 258,262 **** } ! public static Test suite() throws Exception { try { --- 259,283 ---- } ! public void testCollectionPointer() throws Exception { ! Session sess = sessions.openSession(); ! LessSimple ls = new LessSimple(); ! List list = new ArrayList(); ! ls.setBag(list); ! Simple s = new Simple(); ! Serializable id = sess.save(ls); ! sess.save(s); ! sess.flush(); ! list.add(s); ! sess.flush(); ! sess.connection().commit(); ! ! sess = sessions.openSession(); ! ls = (LessSimple) sess.load(LessSimple.class, id); ! assertTrue( ls.getBag().size()==1 ); ! sess.delete("from o in class java.lang.Object"); ! sess.flush(); ! sess.connection().commit(); ! } ! public static Test suite() throws Exception { try { |