Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
dreab8 committed Feb 17, 2020
1 parent 7d13abf commit efb0750
Showing 1 changed file with 0 additions and 43 deletions.
Expand Up @@ -114,49 +114,6 @@ public void testSubselect(SessionFactoryScope scope) {
);
}

@Test
@TestForIssue(jiraKey = "HHH-12740")
public void testSubselect_2(SessionFactoryScope scope) {
scope.inTransaction(
session -> {
List<Parent> list = session.byMultipleIds( Parent.class ).multiLoad( ids( 1 ) );
assertEquals( 1, list.size() );

// None of the collections should be loaded yet
for ( Parent p : list ) {
assertFalse( Hibernate.isInitialized( p.children ) );
}

Hibernate.initialize( list.get( 0 ).children );


// // When the first collection is loaded, the full batch of 50 collections
// // should be loaded.
// Hibernate.initialize( list.get( 0 ).children );
//
// for ( int i = 0; i < 50; i++ ) {
// assertTrue( Hibernate.isInitialized( list.get( i ).children ) );
// assertEquals( i + 1, list.get( i ).children.size() );
// }
//
// // The collections for the 51st through 56th entities should still be uninitialized
// for ( int i = 50; i < 56; i++ ) {
// assertFalse( Hibernate.isInitialized( list.get( i ).children ) );
// }
//
// // When the 51st collection gets initialized, the remaining collections should
// // also be initialized.
// Hibernate.initialize( list.get( 50 ).children );
//
// for ( int i = 50; i < 56; i++ ) {
// assertTrue( Hibernate.isInitialized( list.get( i ).children ) );
// assertEquals( i + 1, list.get( i ).children.size() );
// }
}
);
}


private Integer[] ids(int count) {
Integer[] ids = new Integer[count];
for ( int i = 1; i <= count; i++ ) {
Expand Down

0 comments on commit efb0750

Please sign in to comment.