Author: hardy.ferentschik
Date: 2009-10-29 09:55:33 -0400 (Thu, 29 Oct 2009)
New Revision: 17877
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/CriteriaQueryTest.java
core/trunk/testsuite/src/test/java/org/hibernate/test/idprops/IdentifierPropertyReferencesTest.java
core/trunk/testsuite/src/test/java/org/hibernate/test/immutable/ImmutableTest.java
core/trunk/testsuite/src/test/java/org/hibernate/test/ops/MergeTest.java
core/trunk/testsuite/src/test/java/org/hibernate/test/ops/SaveOrUpdateTest.java
Log:
HHH-1724 updated test which expected an Integer instead of Long as row count
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/CriteriaQueryTest.java
===================================================================
---
core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/CriteriaQueryTest.java 2009-10-29
08:52:03 UTC (rev 17876)
+++
core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/CriteriaQueryTest.java 2009-10-29
13:55:33 UTC (rev 17877)
@@ -370,10 +370,10 @@
//s.flush();
- Integer count = (Integer) s.createCriteria(Enrolment.class)
+ Long count = (Long) s.createCriteria(Enrolment.class)
.setProjection( Projections.count("studentNumber").setDistinct() )
.uniqueResult();
- assertEquals(count, new Integer(2));
+ assertEquals(count, new Long(2));
Object object = s.createCriteria(Enrolment.class)
.setProjection( Projections.projectionList()
@@ -385,7 +385,7 @@
.uniqueResult();
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(101),result[2]);
assertEquals( 384.0, ( (Double) result[3] ).doubleValue(), 0.01 );
@@ -544,10 +544,10 @@
s.flush();
- Integer count = (Integer) s.createCriteria(Enrolment.class)
+ Long count = (Long) s.createCriteria(Enrolment.class)
.setProjection( Property.forName("studentNumber").count().setDistinct() )
.uniqueResult();
- assertEquals(count, new Integer(2));
+ assertEquals(count, new Long(2));
Object object = s.createCriteria(Enrolment.class)
.setProjection( Projections.projectionList()
@@ -559,7 +559,7 @@
.uniqueResult();
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(101),result[2]);
assertEquals(384.0, ( (Double) result[3] ).doubleValue(), 0.01);
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/idprops/IdentifierPropertyReferencesTest.java
===================================================================
---
core/trunk/testsuite/src/test/java/org/hibernate/test/idprops/IdentifierPropertyReferencesTest.java 2009-10-29
08:52:03 UTC (rev 17876)
+++
core/trunk/testsuite/src/test/java/org/hibernate/test/idprops/IdentifierPropertyReferencesTest.java 2009-10-29
13:55:33 UTC (rev 17877)
@@ -182,6 +182,6 @@
}
private long extractCount(Criteria crit) {
- return ( ( Integer ) crit.list().get( 0 ) ).intValue();
+ return ( ( Long ) crit.list().get( 0 ) ).longValue();
}
}
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/immutable/ImmutableTest.java
===================================================================
---
core/trunk/testsuite/src/test/java/org/hibernate/test/immutable/ImmutableTest.java 2009-10-29
08:52:03 UTC (rev 17876)
+++
core/trunk/testsuite/src/test/java/org/hibernate/test/immutable/ImmutableTest.java 2009-10-29
13:55:33 UTC (rev 17877)
@@ -86,8 +86,8 @@
cv2 = (ContractVariation) it.next();
assertEquals( cv2.getText(), "more expensive" );
s.delete(c);
- assertEquals( s.createCriteria(Contract.class).setProjection( Projections.rowCount()
).uniqueResult(), new Integer(0) );
- assertEquals( s.createCriteria(ContractVariation.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 Long(0) );
t.commit();
s.close();
}
@@ -122,8 +122,8 @@
cv2 = (ContractVariation) it.next();
assertEquals( cv2.getText(), "more expensive" );
s.delete(c);
- assertEquals( s.createCriteria(Contract.class).setProjection( Projections.rowCount()
).uniqueResult(), new Integer(0) );
- assertEquals( s.createCriteria(ContractVariation.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 Long(0) );
t.commit();
s.close();
}
@@ -159,8 +159,8 @@
cv2 = (ContractVariation) it.next();
assertEquals( cv2.getText(), "more expensive" );
s.delete(c);
- assertEquals( s.createCriteria(Contract.class).setProjection( Projections.rowCount()
).uniqueResult(), new Integer(0) );
- assertEquals( s.createCriteria(ContractVariation.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 Long(0) );
t.commit();
s.close();
}
@@ -203,8 +203,8 @@
cv2 = (ContractVariation) it.next();
assertEquals( cv2.getText(), "more expensive" );
s.delete(c);
- assertEquals( s.createCriteria(Contract.class).setProjection( Projections.rowCount()
).uniqueResult(), new Integer(0) );
- assertEquals( s.createCriteria(ContractVariation.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 Long(0) );
t.commit();
s.close();
}
@@ -239,8 +239,8 @@
cv2 = (ContractVariation) it.next();
assertEquals( cv2.getText(), "more expensive" );
s.delete(c);
- assertEquals( s.createCriteria(Contract.class).setProjection( Projections.rowCount()
).uniqueResult(), new Integer(0) );
- assertEquals( s.createCriteria(ContractVariation.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 Long(0) );
t.commit();
s.close();
}
@@ -276,8 +276,8 @@
cv2 = (ContractVariation) it.next();
assertEquals( cv2.getText(), "more expensive" );
s.delete(c);
- assertEquals( s.createCriteria(Contract.class).setProjection( Projections.rowCount()
).uniqueResult(), new Integer(0) );
- assertEquals( s.createCriteria(ContractVariation.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 Long(0) );
t.commit();
s.close();
}
@@ -321,8 +321,8 @@
cv2 = (ContractVariation) it.next();
assertEquals( cv2.getText(), "more expensive" );
s.delete(c);
- assertEquals( s.createCriteria(Contract.class).setProjection( Projections.rowCount()
).uniqueResult(), new Integer(0) );
- assertEquals( s.createCriteria(ContractVariation.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 Long(0) );
t.commit();
s.close();
}
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/ops/MergeTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/ops/MergeTest.java 2009-10-29
08:52:03 UTC (rev 17876)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/ops/MergeTest.java 2009-10-29
13:55:33 UTC (rev 17877)
@@ -603,7 +603,7 @@
s.createCriteria(NumberedNode.class)
.setProjection( Projections.rowCount() )
.uniqueResult(),
- new Integer(2)
+ new Long(2)
);
s.close();
@@ -646,7 +646,7 @@
s.createCriteria(NumberedNode.class)
.setProjection( Projections.rowCount() )
.uniqueResult(),
- new Integer(2)
+ new Long(2)
);
tx.commit();
@@ -691,7 +691,7 @@
s.createCriteria(NumberedNode.class)
.setProjection( Projections.rowCount() )
.uniqueResult(),
- new Integer(2)
+ new Long(2)
);
tx.commit();
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/ops/SaveOrUpdateTest.java
===================================================================
---
core/trunk/testsuite/src/test/java/org/hibernate/test/ops/SaveOrUpdateTest.java 2009-10-29
08:52:03 UTC (rev 17876)
+++
core/trunk/testsuite/src/test/java/org/hibernate/test/ops/SaveOrUpdateTest.java 2009-10-29
13:55:33 UTC (rev 17877)
@@ -242,7 +242,7 @@
s.createCriteria( NumberedNode.class )
.setProjection( Projections.rowCount() )
.uniqueResult(),
- new Integer( 2 )
+ new Long( 2 )
);
s.delete( root );
s.delete( child );
@@ -299,7 +299,7 @@
s.createCriteria( NumberedNode.class )
.setProjection( Projections.rowCount() )
.uniqueResult(),
- new Integer( 2 )
+ new Long( 2 )
);
s.delete( root );
s.delete( child );
@@ -353,7 +353,7 @@
s.createCriteria( Node.class )
.setProjection( Projections.rowCount() )
.uniqueResult(),
- new Integer( 2 )
+ new Long( 2 )
);
s.delete( root );
s.delete( child );