[hibernate-commits] Hibernate SVN: r10496 - branches/Branch_3_2/Hibernate3/test/org/hibernate/test/extralazy

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Wed Sep 20 04:35:14 EDT 2006


Author: max.andersen at jboss.com
Date: 2006-09-20 04:35:11 -0400 (Wed, 20 Sep 2006)
New Revision: 10496

Modified:
   branches/Branch_3_2/Hibernate3/test/org/hibernate/test/extralazy/ExtraLazyTest.java
Log:
extra lazy set test

Modified: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/extralazy/ExtraLazyTest.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/extralazy/ExtraLazyTest.java	2006-09-20 06:59:09 UTC (rev 10495)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/extralazy/ExtraLazyTest.java	2006-09-20 08:35:11 UTC (rev 10496)
@@ -1,6 +1,7 @@
 //$Id$
 package org.hibernate.test.extralazy;
 
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -209,6 +210,33 @@
 		
 	}
 	
+	public void testExtraLazySetFailureExpected() {
+		Session s = openSession();
+		Transaction t = s.beginTransaction();
+		User gavin = new User("gavin", "secret");
+		new Document( "Hia", "something", gavin );
+		new Document( "Seam", "seamy", gavin );
+		s.persist(gavin);
+		t.commit();
+		s.close();
+		
+		s = openSession();
+		t = s.beginTransaction();
+		
+		User person = (User) s.get(User.class, gavin.getName());
+		
+		new Document( "Fresh", "word", person );
+		System.out.println("Writing out the persons documentes (Set). Expected to find 3 but it only contains 2.");
+		
+		for (Iterator iter = person.getDocuments().iterator(); iter.hasNext();) {
+			Document doc = (Document) iter.next();
+			System.out.println("phoneNumber: " + doc);			
+		}
+		
+		assertEquals(person.getDocuments().size(),3);
+		s.close();
+	}
+	
 	protected String[] getMappings() {
 		return new String[] { "extralazy/UserGroup.hbm.xml" };
 	}




More information about the hibernate-commits mailing list