HHH-1724 updated test which expected an Integer instead of Long as row count

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@17877 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Hardy Ferentschik 2009-10-29 13:55:33 +00:00
parent 37dc5e05ba
commit 2a60faba25
5 changed files with 27 additions and 27 deletions

View File

@ -370,10 +370,10 @@ public class CriteriaQueryTest extends FunctionalTestCase {
//s.flush(); //s.flush();
Integer count = (Integer) s.createCriteria(Enrolment.class) Long count = (Long) s.createCriteria(Enrolment.class)
.setProjection( Projections.count("studentNumber").setDistinct() ) .setProjection( Projections.count("studentNumber").setDistinct() )
.uniqueResult(); .uniqueResult();
assertEquals(count, new Integer(2)); assertEquals(count, new Long(2));
Object object = s.createCriteria(Enrolment.class) Object object = s.createCriteria(Enrolment.class)
.setProjection( Projections.projectionList() .setProjection( Projections.projectionList()
@ -385,7 +385,7 @@ public class CriteriaQueryTest extends FunctionalTestCase {
.uniqueResult(); .uniqueResult();
Object[] result = (Object[])object; Object[] result = (Object[])object;
assertEquals(new Integer(2),result[0]); assertEquals(new Long(2),result[0]);
assertEquals(new Long(667),result[1]); assertEquals(new Long(667),result[1]);
assertEquals(new Long(101),result[2]); assertEquals(new Long(101),result[2]);
assertEquals( 384.0, ( (Double) result[3] ).doubleValue(), 0.01 ); assertEquals( 384.0, ( (Double) result[3] ).doubleValue(), 0.01 );
@ -544,10 +544,10 @@ public class CriteriaQueryTest extends FunctionalTestCase {
s.flush(); s.flush();
Integer count = (Integer) s.createCriteria(Enrolment.class) Long count = (Long) s.createCriteria(Enrolment.class)
.setProjection( Property.forName("studentNumber").count().setDistinct() ) .setProjection( Property.forName("studentNumber").count().setDistinct() )
.uniqueResult(); .uniqueResult();
assertEquals(count, new Integer(2)); assertEquals(count, new Long(2));
Object object = s.createCriteria(Enrolment.class) Object object = s.createCriteria(Enrolment.class)
.setProjection( Projections.projectionList() .setProjection( Projections.projectionList()
@ -559,7 +559,7 @@ public class CriteriaQueryTest extends FunctionalTestCase {
.uniqueResult(); .uniqueResult();
Object[] result = (Object[])object; Object[] result = (Object[])object;
assertEquals(new Integer(2),result[0]); assertEquals(new Long(2),result[0]);
assertEquals(new Long(667),result[1]); assertEquals(new Long(667),result[1]);
assertEquals(new Long(101),result[2]); assertEquals(new Long(101),result[2]);
assertEquals(384.0, ( (Double) result[3] ).doubleValue(), 0.01); assertEquals(384.0, ( (Double) result[3] ).doubleValue(), 0.01);

View File

@ -182,6 +182,6 @@ public class IdentifierPropertyReferencesTest extends FunctionalTestCase {
} }
private long extractCount(Criteria crit) { private long extractCount(Criteria crit) {
return ( ( Integer ) crit.list().get( 0 ) ).intValue(); return ( ( Long ) crit.list().get( 0 ) ).longValue();
} }
} }

View File

@ -86,8 +86,8 @@ public class ImmutableTest extends FunctionalTestCase {
cv2 = (ContractVariation) it.next(); cv2 = (ContractVariation) it.next();
assertEquals( cv2.getText(), "more expensive" ); assertEquals( cv2.getText(), "more expensive" );
s.delete(c); s.delete(c);
assertEquals( s.createCriteria(Contract.class).setProjection( Projections.rowCount() ).uniqueResult(), new Integer(0) ); assertEquals( s.createCriteria(Contract.class).setProjection( Projections.rowCount() ).uniqueResult(), new Long(0) );
assertEquals( s.createCriteria(ContractVariation.class).setProjection( Projections.rowCount() ).uniqueResult(), new Integer(0) ); assertEquals( s.createCriteria(ContractVariation.class).setProjection( Projections.rowCount() ).uniqueResult(), new Long(0) );
t.commit(); t.commit();
s.close(); s.close();
} }
@ -122,8 +122,8 @@ public class ImmutableTest extends FunctionalTestCase {
cv2 = (ContractVariation) it.next(); cv2 = (ContractVariation) it.next();
assertEquals( cv2.getText(), "more expensive" ); assertEquals( cv2.getText(), "more expensive" );
s.delete(c); s.delete(c);
assertEquals( s.createCriteria(Contract.class).setProjection( Projections.rowCount() ).uniqueResult(), new Integer(0) ); assertEquals( s.createCriteria(Contract.class).setProjection( Projections.rowCount() ).uniqueResult(), new Long(0) );
assertEquals( s.createCriteria(ContractVariation.class).setProjection( Projections.rowCount() ).uniqueResult(), new Integer(0) ); assertEquals( s.createCriteria(ContractVariation.class).setProjection( Projections.rowCount() ).uniqueResult(), new Long(0) );
t.commit(); t.commit();
s.close(); s.close();
} }
@ -159,8 +159,8 @@ public class ImmutableTest extends FunctionalTestCase {
cv2 = (ContractVariation) it.next(); cv2 = (ContractVariation) it.next();
assertEquals( cv2.getText(), "more expensive" ); assertEquals( cv2.getText(), "more expensive" );
s.delete(c); s.delete(c);
assertEquals( s.createCriteria(Contract.class).setProjection( Projections.rowCount() ).uniqueResult(), new Integer(0) ); assertEquals( s.createCriteria(Contract.class).setProjection( Projections.rowCount() ).uniqueResult(), new Long(0) );
assertEquals( s.createCriteria(ContractVariation.class).setProjection( Projections.rowCount() ).uniqueResult(), new Integer(0) ); assertEquals( s.createCriteria(ContractVariation.class).setProjection( Projections.rowCount() ).uniqueResult(), new Long(0) );
t.commit(); t.commit();
s.close(); s.close();
} }
@ -203,8 +203,8 @@ public class ImmutableTest extends FunctionalTestCase {
cv2 = (ContractVariation) it.next(); cv2 = (ContractVariation) it.next();
assertEquals( cv2.getText(), "more expensive" ); assertEquals( cv2.getText(), "more expensive" );
s.delete(c); s.delete(c);
assertEquals( s.createCriteria(Contract.class).setProjection( Projections.rowCount() ).uniqueResult(), new Integer(0) ); assertEquals( s.createCriteria(Contract.class).setProjection( Projections.rowCount() ).uniqueResult(), new Long(0) );
assertEquals( s.createCriteria(ContractVariation.class).setProjection( Projections.rowCount() ).uniqueResult(), new Integer(0) ); assertEquals( s.createCriteria(ContractVariation.class).setProjection( Projections.rowCount() ).uniqueResult(), new Long(0) );
t.commit(); t.commit();
s.close(); s.close();
} }
@ -239,8 +239,8 @@ public class ImmutableTest extends FunctionalTestCase {
cv2 = (ContractVariation) it.next(); cv2 = (ContractVariation) it.next();
assertEquals( cv2.getText(), "more expensive" ); assertEquals( cv2.getText(), "more expensive" );
s.delete(c); s.delete(c);
assertEquals( s.createCriteria(Contract.class).setProjection( Projections.rowCount() ).uniqueResult(), new Integer(0) ); assertEquals( s.createCriteria(Contract.class).setProjection( Projections.rowCount() ).uniqueResult(), new Long(0) );
assertEquals( s.createCriteria(ContractVariation.class).setProjection( Projections.rowCount() ).uniqueResult(), new Integer(0) ); assertEquals( s.createCriteria(ContractVariation.class).setProjection( Projections.rowCount() ).uniqueResult(), new Long(0) );
t.commit(); t.commit();
s.close(); s.close();
} }
@ -276,8 +276,8 @@ public class ImmutableTest extends FunctionalTestCase {
cv2 = (ContractVariation) it.next(); cv2 = (ContractVariation) it.next();
assertEquals( cv2.getText(), "more expensive" ); assertEquals( cv2.getText(), "more expensive" );
s.delete(c); s.delete(c);
assertEquals( s.createCriteria(Contract.class).setProjection( Projections.rowCount() ).uniqueResult(), new Integer(0) ); assertEquals( s.createCriteria(Contract.class).setProjection( Projections.rowCount() ).uniqueResult(), new Long(0) );
assertEquals( s.createCriteria(ContractVariation.class).setProjection( Projections.rowCount() ).uniqueResult(), new Integer(0) ); assertEquals( s.createCriteria(ContractVariation.class).setProjection( Projections.rowCount() ).uniqueResult(), new Long(0) );
t.commit(); t.commit();
s.close(); s.close();
} }
@ -321,8 +321,8 @@ public class ImmutableTest extends FunctionalTestCase {
cv2 = (ContractVariation) it.next(); cv2 = (ContractVariation) it.next();
assertEquals( cv2.getText(), "more expensive" ); assertEquals( cv2.getText(), "more expensive" );
s.delete(c); s.delete(c);
assertEquals( s.createCriteria(Contract.class).setProjection( Projections.rowCount() ).uniqueResult(), new Integer(0) ); assertEquals( s.createCriteria(Contract.class).setProjection( Projections.rowCount() ).uniqueResult(), new Long(0) );
assertEquals( s.createCriteria(ContractVariation.class).setProjection( Projections.rowCount() ).uniqueResult(), new Integer(0) ); assertEquals( s.createCriteria(ContractVariation.class).setProjection( Projections.rowCount() ).uniqueResult(), new Long(0) );
t.commit(); t.commit();
s.close(); s.close();
} }

View File

@ -603,7 +603,7 @@ public class MergeTest extends AbstractOperationTestCase {
s.createCriteria(NumberedNode.class) s.createCriteria(NumberedNode.class)
.setProjection( Projections.rowCount() ) .setProjection( Projections.rowCount() )
.uniqueResult(), .uniqueResult(),
new Integer(2) new Long(2)
); );
s.close(); s.close();
@ -646,7 +646,7 @@ public class MergeTest extends AbstractOperationTestCase {
s.createCriteria(NumberedNode.class) s.createCriteria(NumberedNode.class)
.setProjection( Projections.rowCount() ) .setProjection( Projections.rowCount() )
.uniqueResult(), .uniqueResult(),
new Integer(2) new Long(2)
); );
tx.commit(); tx.commit();
@ -691,7 +691,7 @@ public class MergeTest extends AbstractOperationTestCase {
s.createCriteria(NumberedNode.class) s.createCriteria(NumberedNode.class)
.setProjection( Projections.rowCount() ) .setProjection( Projections.rowCount() )
.uniqueResult(), .uniqueResult(),
new Integer(2) new Long(2)
); );
tx.commit(); tx.commit();

View File

@ -242,7 +242,7 @@ public class SaveOrUpdateTest extends FunctionalTestCase {
s.createCriteria( NumberedNode.class ) s.createCriteria( NumberedNode.class )
.setProjection( Projections.rowCount() ) .setProjection( Projections.rowCount() )
.uniqueResult(), .uniqueResult(),
new Integer( 2 ) new Long( 2 )
); );
s.delete( root ); s.delete( root );
s.delete( child ); s.delete( child );
@ -299,7 +299,7 @@ public class SaveOrUpdateTest extends FunctionalTestCase {
s.createCriteria( NumberedNode.class ) s.createCriteria( NumberedNode.class )
.setProjection( Projections.rowCount() ) .setProjection( Projections.rowCount() )
.uniqueResult(), .uniqueResult(),
new Integer( 2 ) new Long( 2 )
); );
s.delete( root ); s.delete( root );
s.delete( child ); s.delete( child );
@ -353,7 +353,7 @@ public class SaveOrUpdateTest extends FunctionalTestCase {
s.createCriteria( Node.class ) s.createCriteria( Node.class )
.setProjection( Projections.rowCount() ) .setProjection( Projections.rowCount() )
.uniqueResult(), .uniqueResult(),
new Integer( 2 ) new Long( 2 )
); );
s.delete( root ); s.delete( root );
s.delete( child ); s.delete( child );