Hibernate SVN: r18375 - in search/trunk/src/test/java/org/hibernate/search/test: query and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: sannegrinovero
Date: 2009-12-31 13:56:17 -0500 (Thu, 31 Dec 2009)
New Revision: 18375
Modified:
search/trunk/src/test/java/org/hibernate/search/test/PurgeTest.java
search/trunk/src/test/java/org/hibernate/search/test/query/LuceneQueryTest.java
Log:
French accents in tests: fix encoding
Modified: search/trunk/src/test/java/org/hibernate/search/test/PurgeTest.java
===================================================================
--- search/trunk/src/test/java/org/hibernate/search/test/PurgeTest.java 2009-12-31 06:15:00 UTC (rev 18374)
+++ search/trunk/src/test/java/org/hibernate/search/test/PurgeTest.java 2009-12-31 18:56:17 UTC (rev 18375)
@@ -54,7 +54,7 @@
s.save( clock );
Book book = new Book( 1, "La chute de la petite reine a travers les yeux de Festina", "La chute de la petite reine a travers les yeux de Festina, blahblah" );
s.save( book );
- book = new Book( 2, "La gloire de mon p�re", "Les deboires de mon p�re en v�lo" );
+ book = new Book( 2, "La gloire de mon père", "Les deboires de mon père en vélo" );
s.save( book );
tx.commit();
s.clear();
@@ -98,7 +98,7 @@
s.save( clock );
Book book = new Book( 1, "La chute de la petite reine a travers les yeux de Festina", "La chute de la petite reine a travers les yeux de Festina, blahblah" );
s.save( book );
- book = new Book( 2, "La gloire de mon p�re", "Les deboires de mon p�re en v�lo" );
+ book = new Book( 2, "La gloire de mon père", "Les deboires de mon père en vélo" );
s.save( book );
tx.commit();
s.clear();
Modified: search/trunk/src/test/java/org/hibernate/search/test/query/LuceneQueryTest.java
===================================================================
--- search/trunk/src/test/java/org/hibernate/search/test/query/LuceneQueryTest.java 2009-12-31 06:15:00 UTC (rev 18374)
+++ search/trunk/src/test/java/org/hibernate/search/test/query/LuceneQueryTest.java 2009-12-31 18:56:17 UTC (rev 18375)
@@ -57,7 +57,7 @@
s.save( clock );
Book book = new Book( 1, "La chute de la petite reine a travers les yeux de Festina", "La chute de la petite reine a travers les yeux de Festina, blahblah" );
s.save( book );
- book = new Book( 2, "La gloire de mon p�re", "Les deboires de mon p�re en v�lo" );
+ book = new Book( 2, "La gloire de mon père", "Les deboires de mon père en vélo" );
s.save( book );
tx.commit();
s.clear();
@@ -112,7 +112,7 @@
s.save( clock );
Book book = new Book( 1, "La chute de la petite reine a travers les yeux de Festina", "La chute de la petite reine a travers les yeux de Festina, blahblah" );
s.save( book );
- book = new Book( 2, "La gloire de mon p�re", "Les deboires de mon p�re en v�lo" );
+ book = new Book( 2, "La gloire de mon père", "Les deboires de mon père en vélo" );
s.save( book );
tx.commit();
s.clear();
@@ -148,7 +148,7 @@
s.save( clock );
Book book = new Book( 1, "La chute de la petite reine a travers les yeux de Festina", "La chute de la petite reine a travers les yeux de Festina, blahblah" );
s.save( book );
- book = new Book( 2, "La gloire de mon p�re", "Les deboires de mon p�re en v�lo" );
+ book = new Book( 2, "La gloire de mon père", "Les deboires de mon père en vélo" );
s.save( book );
tx.commit();
s.clear();
@@ -194,7 +194,7 @@
s.save( clock );
Book book = new Book( 1, "La chute de la petite reine a travers les yeux de Festina", "La chute de la petite reine a travers les yeux de Festina, blahblah" );
s.save( book );
- book = new Book( 2, "La gloire de mon p�re", "Les deboires de mon p�re en v�lo" );
+ book = new Book( 2, "La gloire de mon père", "Les deboires de mon père en vélo" );
s.save( book );
tx.commit();//post commit events for lucene
s.clear();
@@ -240,7 +240,7 @@
s.save( clock );
Book book = new Book( 1, "La chute de la petite reine a travers les yeux de Festina", "La chute de la petite reine a travers les yeux de Festina, blahblah" );
s.save( book );
- book = new Book( 2, "La gloire de mon p�re", "Les deboires de mon p�re en v�lo" );
+ book = new Book( 2, "La gloire de mon père", "Les deboires de mon père en vélo" );
s.save( book );
tx.commit();//post commit events for lucene
s.clear();
14 years, 12 months
Hibernate SVN: r18374 - core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/criteria.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-12-31 01:15:00 -0500 (Thu, 31 Dec 2009)
New Revision: 18374
Modified:
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java
Log:
HHH-2166 - Long 'in' lists in queries results in a Java stack overflow exception.
Modified: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java 2009-12-31 06:14:45 UTC (rev 18373)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java 2009-12-31 06:15:00 UTC (rev 18374)
@@ -62,6 +62,7 @@
if ( (getDialect() instanceof SQLServerDialect)
|| (getDialect() instanceof Oracle8iDialect) ){
skipExpectedFailure( new Exception("this test fails on oracle and ms sql server, for more info, see HHH-1123") );
+ return;
}
Session session = openSession();
Transaction t = session.beginTransaction();
@@ -91,6 +92,7 @@
if ( (getDialect() instanceof SQLServerDialect)
|| (getDialect() instanceof Oracle8iDialect) ){
skipExpectedFailure( new Exception("this test fails on oracle and ms sql server, for more info, see HHH-1123") );
+ return;
}
Session session = openSession();
Transaction t = session.beginTransaction();
14 years, 12 months
Hibernate SVN: r18373 - core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/criteria.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-12-31 01:14:45 -0500 (Thu, 31 Dec 2009)
New Revision: 18373
Modified:
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/criteria/LongInElementsTest.java
Log:
JBPAPP-3089 HHH-2166 - Long 'in' lists in queries results in a Java stack overflow exception.
Modified: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/criteria/LongInElementsTest.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/criteria/LongInElementsTest.java 2009-12-31 05:49:33 UTC (rev 18372)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/criteria/LongInElementsTest.java 2009-12-31 06:14:45 UTC (rev 18373)
@@ -62,6 +62,7 @@
if ( (getDialect() instanceof SQLServerDialect)
|| (getDialect() instanceof Oracle8iDialect) ){
skipExpectedFailure( new Exception("this test fails on oracle and ms sql server, for more info, see HHH-1123") );
+ return;
}
Session session = openSession();
Transaction t = session.beginTransaction();
@@ -91,6 +92,7 @@
if ( (getDialect() instanceof SQLServerDialect)
|| (getDialect() instanceof Oracle8iDialect) ){
skipExpectedFailure( new Exception("this test fails on oracle and ms sql server, for more info, see HHH-1123") );
+ return;
}
Session session = openSession();
Transaction t = session.beginTransaction();
14 years, 12 months
Hibernate SVN: r18372 - core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/criteria.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-12-31 00:49:33 -0500 (Thu, 31 Dec 2009)
New Revision: 18372
Modified:
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java
Log:
JBPAPP-3089 HHH-2166 - Long 'in' lists in queries results in a Java stack overflow exception.
Modified: core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java 2009-12-31 05:48:24 UTC (rev 18371)
+++ core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java 2009-12-31 05:49:33 UTC (rev 18372)
@@ -62,6 +62,7 @@
if ( (getDialect() instanceof SQLServerDialect)
|| (getDialect() instanceof Oracle8iDialect) ){
skipExpectedFailure( new Exception("this test fails on oracle and ms sql server, for more info, see HHH-1123") );
+ return;
}
Session session = openSession();
Transaction t = session.beginTransaction();
@@ -91,6 +92,7 @@
if ( (getDialect() instanceof SQLServerDialect)
|| (getDialect() instanceof Oracle8iDialect) ){
skipExpectedFailure( new Exception("this test fails on oracle and ms sql server, for more info, see HHH-1123") );
+ return;
}
Session session = openSession();
Transaction t = session.beginTransaction();
14 years, 12 months
Hibernate SVN: r18371 - core/trunk/testsuite/src/test/java/org/hibernate/test/criteria.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-12-31 00:48:24 -0500 (Thu, 31 Dec 2009)
New Revision: 18371
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java
Log:
HHH-2166 - Long 'in' lists in queries results in a Java stack overflow exception.
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java 2009-12-31 05:18:44 UTC (rev 18370)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java 2009-12-31 05:48:24 UTC (rev 18371)
@@ -62,6 +62,7 @@
if ( (getDialect() instanceof SQLServerDialect)
|| (getDialect() instanceof Oracle8iDialect) ){
skipExpectedFailure( new Exception("this test fails on oracle and ms sql server, for more info, see HHH-1123") );
+ return;
}
Session session = openSession();
Transaction t = session.beginTransaction();
@@ -91,6 +92,7 @@
if ( (getDialect() instanceof SQLServerDialect)
|| (getDialect() instanceof Oracle8iDialect) ){
skipExpectedFailure( new Exception("this test fails on oracle and ms sql server, for more info, see HHH-1123") );
+ return;
}
Session session = openSession();
Transaction t = session.beginTransaction();
14 years, 12 months
Hibernate SVN: r18370 - core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/cascade.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-12-31 00:18:44 -0500 (Thu, 31 Dec 2009)
New Revision: 18370
Modified:
core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/cascade/BidirectionalOneToManyCascadeTest.java
Log:
JBPAPP-3317 exclude postgresql and oracle in the test of org.hibernate.test.cascade.BidirectionalOneToManyCascadeTest.testSaveOrphanDeleteChildWithParentFailureExpected
Modified: core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/cascade/BidirectionalOneToManyCascadeTest.java
===================================================================
--- core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/cascade/BidirectionalOneToManyCascadeTest.java 2009-12-30 15:36:46 UTC (rev 18369)
+++ core/branches/Branch_3_3_2_GA_CP/testsuite/src/test/java/org/hibernate/test/cascade/BidirectionalOneToManyCascadeTest.java 2009-12-31 05:18:44 UTC (rev 18370)
@@ -8,6 +8,8 @@
import org.hibernate.Session;
import org.hibernate.Transaction;
+import org.hibernate.dialect.Oracle8iDialect;
+import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.junit.functional.FunctionalTestCase;
import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
@@ -22,20 +24,18 @@
*/
public class BidirectionalOneToManyCascadeTest extends FunctionalTestCase {
- public BidirectionalOneToManyCascadeTest(String name) {
+ public BidirectionalOneToManyCascadeTest( String name ) {
super( name );
}
public String[] getMappings() {
- return new String[] {
- "cascade/Child.hbm.xml",
- "cascade/DeleteOrphanChild.hbm.xml",
- "cascade/Parent.hbm.xml"
- };
+ return new String[] { "cascade/Child.hbm.xml",
+ "cascade/DeleteOrphanChild.hbm.xml", "cascade/Parent.hbm.xml" };
}
public static Test suite() {
- return new FunctionalTestClassTestSuite( BidirectionalOneToManyCascadeTest.class );
+ return new FunctionalTestClassTestSuite(
+ BidirectionalOneToManyCascadeTest.class );
}
/**
@@ -55,9 +55,9 @@
session = openSession();
txn = session.beginTransaction();
- parent = ( Parent ) session.get( Parent.class, parent.getId() );
- assertEquals( 1, parent.getChildren().size() );
- assertEquals( 0, parent.getDeleteOrphanChildren().size() );
+ parent = (Parent) session.get( Parent.class , parent.getId() );
+ assertEquals( 1 , parent.getChildren().size() );
+ assertEquals( 0 , parent.getDeleteOrphanChildren().size() );
session.delete( parent );
txn.commit();
session.close();
@@ -80,9 +80,9 @@
session = openSession();
txn = session.beginTransaction();
- parent = ( Parent ) session.get( Parent.class, parent.getId() );
- assertEquals( 1, parent.getChildren().size() );
- assertEquals( 0, parent.getDeleteOrphanChildren().size() );
+ parent = (Parent) session.get( Parent.class , parent.getId() );
+ assertEquals( 1 , parent.getChildren().size() );
+ assertEquals( 0 , parent.getDeleteOrphanChildren().size() );
session.delete( parent );
txn.commit();
session.close();
@@ -106,9 +106,9 @@
session = openSession();
txn = session.beginTransaction();
- parent = ( Parent ) session.get( Parent.class, parent.getId() );
- assertEquals( 0, parent.getChildren().size() );
- assertEquals( 1, parent.getDeleteOrphanChildren().size() );
+ parent = (Parent) session.get( Parent.class , parent.getId() );
+ assertEquals( 0 , parent.getChildren().size() );
+ assertEquals( 1 , parent.getDeleteOrphanChildren().size() );
session.delete( parent );
txn.commit();
session.close();
@@ -122,6 +122,13 @@
* This test is known to fail. See HHH-2269.
*/
public void testSaveOrphanDeleteChildWithParentFailureExpected() {
+ if ( getDialect() instanceof Oracle8iDialect
+ || getDialect() instanceof PostgreSQLDialect ) {
+
+ fail( "enforce this test fails on oracle and postgresql since " +
+ "this is a failure expected test, " +
+ "but actually, this test passes on these two DBs, see https://jira.jboss.org/jira/browse/JBPAPP-3317" );
+ }
Session session = openSession();
Transaction txn = session.beginTransaction();
Parent parent = new Parent();
@@ -134,9 +141,9 @@
session = openSession();
txn = session.beginTransaction();
- parent = ( Parent ) session.get( Parent.class, parent.getId() );
- assertEquals( 0, parent.getChildren().size() );
- assertEquals( 1, parent.getDeleteOrphanChildren().size() );
+ parent = (Parent) session.get( Parent.class , parent.getId() );
+ assertEquals( 0 , parent.getChildren().size() );
+ assertEquals( 1 , parent.getDeleteOrphanChildren().size() );
session.delete( parent );
txn.commit();
session.close();
14 years, 12 months
Hibernate SVN: r18369 - search/branches/v3_1_1_GA_CP/src/test/java/org/hibernate/search/test/engine.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-12-30 10:36:46 -0500 (Wed, 30 Dec 2009)
New Revision: 18369
Modified:
search/branches/v3_1_1_GA_CP/src/test/java/org/hibernate/search/test/engine/LazyCollectionsUpdatingTest.java
Log:
JBPAPP-3316 org.hibernate.search.test.engine.LazyCollectionsUpdatingTest fails on most DB by a NPE
Modified: search/branches/v3_1_1_GA_CP/src/test/java/org/hibernate/search/test/engine/LazyCollectionsUpdatingTest.java
===================================================================
--- search/branches/v3_1_1_GA_CP/src/test/java/org/hibernate/search/test/engine/LazyCollectionsUpdatingTest.java 2009-12-30 11:59:12 UTC (rev 18368)
+++ search/branches/v3_1_1_GA_CP/src/test/java/org/hibernate/search/test/engine/LazyCollectionsUpdatingTest.java 2009-12-30 15:36:46 UTC (rev 18369)
@@ -28,7 +28,10 @@
FullTextSession fullTextSession = Search.getFullTextSession( sessions.openSession() );
try {
Transaction tx = fullTextSession.beginTransaction();
- BusStop busStop = (BusStop) fullTextSession.get( BusStop.class, 1L );
+ List list = fullTextSession.createCriteria( BusStop.class ).list();
+ assertNotNull( list );
+ assertEquals( 4 , list.size() );
+ BusStop busStop = (BusStop) list.get( 1 );
busStop.setRoadName( "new road" );
tx.commit();
}
@@ -45,7 +48,10 @@
assertFindsByRoadName( "buonarroti" );
FullTextSession fullTextSession = Search.getFullTextSession( sessions.openSession() );
try {
- BusStop busStop = (BusStop) fullTextSession.get( BusStop.class, 1L );
+ List list = fullTextSession.createCriteria( BusStop.class ).list();
+ assertNotNull( list );
+ assertEquals( 4 , list.size() );
+ BusStop busStop = (BusStop) list.get( 1 );
busStop.setRoadName( "new road" );
fullTextSession.flush();
}
14 years, 12 months
Hibernate SVN: r18368 - search/trunk.
by hibernate-commits@lists.jboss.org
Author: sannegrinovero
Date: 2009-12-30 06:59:12 -0500 (Wed, 30 Dec 2009)
New Revision: 18368
Modified:
search/trunk/pom.xml
Log:
small updates in pom.xml: removing hsqldb as compile dependency, adding Hudson link, add my blog link, refer to correct Subversion path
Modified: search/trunk/pom.xml
===================================================================
--- search/trunk/pom.xml 2009-12-30 09:09:22 UTC (rev 18367)
+++ search/trunk/pom.xml 2009-12-30 11:59:12 UTC (rev 18368)
@@ -12,9 +12,9 @@
<url>http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH</url>
</issueManagement>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/hibernate/search/tags/v3_2_0_Beta1</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/hibernate/search/tags/v3_2_0_Beta1</developerConnection>
- <url>http://fisheye.jboss.com/browse/Hibernate/search/tags/v3_2_0_Beta1</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/hibernate/search/trunk</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/hibernate/search/trunk</developerConnection>
+ <url>http://fisheye.jboss.com/browse/Hibernate/search/trunk</url>
</scm>
<organization>
@@ -29,6 +29,11 @@
</license>
</licenses>
+ <ciManagement>
+ <system>Hudson</system>
+ <url>http://hudson.jboss.org/hudson/view/hibernate/job/hibernate-search-trunk/</url>
+ </ciManagement>
+ <inceptionYear>2006</inceptionYear>
<developers>
<developer>
<id>epbernard</id>
@@ -41,11 +46,13 @@
<name>Hardy Ferentschik</name>
<url>http://in.relation.to/Bloggers/Hardy</url>
</developer>
+ <developer>
+ <id>sannegrinovero</id>
+ <name>Sanne Grinovero</name>
+ <url>http://in.relation.to/Bloggers/Sanne</url>
+ </developer>
</developers>
<contributors>
- <contributor>
- <name>Sanne Grinovero</name>
- </contributor>
</contributors>
<properties>
@@ -336,6 +343,7 @@
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>1.8.0.2</version>
+ <scope>test</scope>
</dependency>
</dependencies>
<properties>
14 years, 12 months
Hibernate SVN: r18367 - core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/criteria.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-12-30 04:09:22 -0500 (Wed, 30 Dec 2009)
New Revision: 18367
Modified:
core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java
Log:
HHH-2166 - Long 'in' lists in queries results in a Java stack overflow exception.
Modified: core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java
===================================================================
--- core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java 2009-12-30 09:08:45 UTC (rev 18366)
+++ core/branches/Branch_3_3/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java 2009-12-30 09:09:22 UTC (rev 18367)
@@ -32,7 +32,6 @@
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.criterion.Restrictions;
-import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.Oracle8iDialect;
import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.junit.functional.FunctionalTestCase;
@@ -40,81 +39,85 @@
/**
*
- * HHH-2166 Long "in" lists in queries results in a Java stack overflow exception.
- * to reproduce this issue, you should add "<argLine>-Xss128k</argLine>" to the surefire plugin (test on Fedora 12)
+ * HHH-2166 Long "in" lists in queries results in a Java stack overflow
+ * exception. to reproduce this issue, you should add
+ * "<argLine>-Xss128k</argLine>" to the surefire plugin (test on Fedora 12)
*
* @author Strong Liu
*/
public class LongInElementsTest extends FunctionalTestCase {
-
+
private static final int ELEMENTS_SIZE = 4000;
-
+
public LongInElementsTest( String string ) {
- super(string);
+ super( string );
}
public String[] getMappings() {
return new String[] { "criteria/Animal.hbm.xml" };
}
-
- //HHH-2166
- public void testLongInElementsByHQL(){
+
+ // HHH-2166
+ public void testLongInElementsByHQL() {
+ if ( (getDialect() instanceof SQLServerDialect)
+ || (getDialect() instanceof Oracle8iDialect) ){
+ skipExpectedFailure( new Exception("this test fails on oracle and ms sql server, for more info, see HHH-1123") );
+ }
Session session = openSession();
Transaction t = session.beginTransaction();
StateProvince beijing = new StateProvince();
- beijing.setIsoCode("100089");
- beijing.setName("beijing");
- session.persist(beijing);
+ beijing.setIsoCode( "100089" );
+ beijing.setName( "beijing" );
+ session.persist( beijing );
session.flush();
session.clear();
-
- Query query = session.createQuery("from org.hibernate.test.hql.StateProvince sp where sp.id in ( :idList )");
+
+ Query query = session
+ .createQuery( "from org.hibernate.test.hql.StateProvince sp where sp.id in ( :idList )" );
query.setParameterList( "idList" , createLotsOfElements() );
List list = query.list();
session.flush();
session.clear();
- assertEquals( 1, list.size() );
- session.delete(beijing);
+ assertEquals( 1 , list.size() );
+ session.delete( beijing );
t.commit();
session.close();
-
+
}
-
- //HHH-2166
- public void testLongInElementsByCriteria(){
+
+ // HHH-2166
+ public void testLongInElementsByCriteria() {
+ if ( (getDialect() instanceof SQLServerDialect)
+ || (getDialect() instanceof Oracle8iDialect) ){
+ skipExpectedFailure( new Exception("this test fails on oracle and ms sql server, for more info, see HHH-1123") );
+ }
Session session = openSession();
Transaction t = session.beginTransaction();
StateProvince beijing = new StateProvince();
- beijing.setIsoCode("100089");
- beijing.setName("beijing");
- session.persist(beijing);
+ beijing.setIsoCode( "100089" );
+ beijing.setName( "beijing" );
+ session.persist( beijing );
session.flush();
session.clear();
-
- Criteria criteria = session.createCriteria(StateProvince.class);
- criteria.add(Restrictions.in("id", createLotsOfElements()));
+
+ Criteria criteria = session.createCriteria( StateProvince.class );
+ criteria.add( Restrictions.in( "id" , createLotsOfElements() ) );
List list = criteria.list();
session.flush();
session.clear();
- assertEquals( 1, list.size() );
- session.delete(beijing);
+ assertEquals( 1 , list.size() );
+ session.delete( beijing );
t.commit();
session.close();
-
+
}
-
- public boolean appliesTo( Dialect dialect ) {
- //HHH-1123
- return !(dialect instanceof SQLServerDialect) && !(dialect instanceof Oracle8iDialect);
-
- }
- private List createLotsOfElements(){
+ private List createLotsOfElements() {
List list = new ArrayList();
- for ( int i = 0; i < ELEMENTS_SIZE; i++ ){
- list.add(Long.valueOf(i));
+ for ( int i = 0; i < ELEMENTS_SIZE; i++ ) {
+ list.add( Long.valueOf( i ) );
}
return list;
}
15 years
Hibernate SVN: r18366 - core/trunk/testsuite/src/test/java/org/hibernate/test/criteria.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-12-30 04:08:45 -0500 (Wed, 30 Dec 2009)
New Revision: 18366
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java
Log:
HHH-2166 - Long 'in' lists in queries results in a Java stack overflow exception.
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java 2009-12-30 09:07:51 UTC (rev 18365)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/criteria/LongInElementsTest.java 2009-12-30 09:08:45 UTC (rev 18366)
@@ -32,7 +32,6 @@
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.criterion.Restrictions;
-import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.Oracle8iDialect;
import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.junit.functional.FunctionalTestCase;
@@ -40,81 +39,85 @@
/**
*
- * HHH-2166 Long "in" lists in queries results in a Java stack overflow exception.
- * to reproduce this issue, you should add "<argLine>-Xss128k</argLine>" to the surefire plugin (test on Fedora 12)
+ * HHH-2166 Long "in" lists in queries results in a Java stack overflow
+ * exception. to reproduce this issue, you should add
+ * "<argLine>-Xss128k</argLine>" to the surefire plugin (test on Fedora 12)
*
* @author Strong Liu
*/
public class LongInElementsTest extends FunctionalTestCase {
-
+
private static final int ELEMENTS_SIZE = 4000;
-
+
public LongInElementsTest( String string ) {
- super(string);
+ super( string );
}
public String[] getMappings() {
return new String[] { "criteria/Animal.hbm.xml" };
}
-
- //HHH-2166
- public void testLongInElementsByHQL(){
+
+ // HHH-2166
+ public void testLongInElementsByHQL() {
+ if ( (getDialect() instanceof SQLServerDialect)
+ || (getDialect() instanceof Oracle8iDialect) ){
+ skipExpectedFailure( new Exception("this test fails on oracle and ms sql server, for more info, see HHH-1123") );
+ }
Session session = openSession();
Transaction t = session.beginTransaction();
StateProvince beijing = new StateProvince();
- beijing.setIsoCode("100089");
- beijing.setName("beijing");
- session.persist(beijing);
+ beijing.setIsoCode( "100089" );
+ beijing.setName( "beijing" );
+ session.persist( beijing );
session.flush();
session.clear();
-
- Query query = session.createQuery("from org.hibernate.test.hql.StateProvince sp where sp.id in ( :idList )");
+
+ Query query = session
+ .createQuery( "from org.hibernate.test.hql.StateProvince sp where sp.id in ( :idList )" );
query.setParameterList( "idList" , createLotsOfElements() );
List list = query.list();
session.flush();
session.clear();
- assertEquals( 1, list.size() );
- session.delete(beijing);
+ assertEquals( 1 , list.size() );
+ session.delete( beijing );
t.commit();
session.close();
-
+
}
-
- //HHH-2166
- public void testLongInElementsByCriteria(){
+
+ // HHH-2166
+ public void testLongInElementsByCriteria() {
+ if ( (getDialect() instanceof SQLServerDialect)
+ || (getDialect() instanceof Oracle8iDialect) ){
+ skipExpectedFailure( new Exception("this test fails on oracle and ms sql server, for more info, see HHH-1123") );
+ }
Session session = openSession();
Transaction t = session.beginTransaction();
StateProvince beijing = new StateProvince();
- beijing.setIsoCode("100089");
- beijing.setName("beijing");
- session.persist(beijing);
+ beijing.setIsoCode( "100089" );
+ beijing.setName( "beijing" );
+ session.persist( beijing );
session.flush();
session.clear();
-
- Criteria criteria = session.createCriteria(StateProvince.class);
- criteria.add(Restrictions.in("id", createLotsOfElements()));
+
+ Criteria criteria = session.createCriteria( StateProvince.class );
+ criteria.add( Restrictions.in( "id" , createLotsOfElements() ) );
List list = criteria.list();
session.flush();
session.clear();
- assertEquals( 1, list.size() );
- session.delete(beijing);
+ assertEquals( 1 , list.size() );
+ session.delete( beijing );
t.commit();
session.close();
-
+
}
-
- public boolean appliesTo( Dialect dialect ) {
- //HHH-1123
- return !(dialect instanceof SQLServerDialect) && !(dialect instanceof Oracle8iDialect);
-
- }
- private List createLotsOfElements(){
+ private List createLotsOfElements() {
List list = new ArrayList();
- for ( int i = 0; i < ELEMENTS_SIZE; i++ ){
- list.add(Long.valueOf(i));
+ for ( int i = 0; i < ELEMENTS_SIZE; i++ ) {
+ list.add( Long.valueOf( i ) );
}
return list;
}
15 years