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:
parent
37dc5e05ba
commit
2a60faba25
|
@ -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);
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
|
|
||||||
|
|
|
@ -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 );
|
||||||
|
|
Loading…
Reference in New Issue