Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test
In directory sc8-pr-cvs1:/tmp/cvs-serv24602/hibernate/test
Modified Files:
FooBarTest.java
Log Message:
* SessionFactory.close() now unbinds from JNDI
* added Session.remove()
* got rid of another unnecessry collection delete()
Index: FooBarTest.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBarTest.java,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** FooBarTest.java 18 Apr 2003 05:09:51 -0000 1.56
--- FooBarTest.java 19 Apr 2003 03:26:11 -0000 1.57
***************
*** 1079,1082 ****
--- 1079,1097 ----
}
+ public void testRemoveContains() throws Exception {
+ Session s = sessions.openSession();
+ Baz baz = new Baz();
+ baz.setDefaults();
+ s.save(baz);
+ s.flush();
+ assertTrue( s.contains(baz) );
+ s.remove(baz);
+ assertFalse( s.contains(baz) );
+ Baz baz2 = (Baz) s.load( Baz.class, baz.getCode() );
+ assertFalse(baz==baz2);
+ s.delete(baz2);
+ s.flush();
+ }
+
public void testCollectionOfSelf() throws Exception {
Session s = sessions.openSession();
***************
*** 2818,2822 ****
s.find("from foo in class net.sf.hibernate.test.Fo");
tx.commit();
! assertTrue( s.close()!=null);
c.close();
}
--- 2833,2837 ----
s.find("from foo in class net.sf.hibernate.test.Fo");
tx.commit();
! assertTrue( s.close()==c );
c.close();
}
|