Author: epbernard
Date: 2007-01-30 06:30:23 -0500 (Tue, 30 Jan 2007)
New Revision: 11114
Added:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/HANTestCase.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/SearchTestCase.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/HANTestCase.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Address.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/MarsAddress.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Martian.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/MartianPk.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Music.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Rock.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Tv.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/TvOwner.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Venusian.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/VenusianPk.java
Removed:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/TestCase.java
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/FSDirectoryTest.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/RamDirectoryTest.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/TransactionTest.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/bridge/BridgeTest.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/fieldAccess/FieldAccessTest.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/inheritance/InheritanceTest.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/query/LuceneQueryTest.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/session/MassIndexTest.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/worker/AsyncWorkerTest.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/worker/WorkerTestCase.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/EmbeddedObjectTest.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/HibernateAnnotationIntegrationTest.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/NonHibernateAnnotationsIntegrationTest.java
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/validators/DigitsTest.java
Log:
Test refactoring to avoid depedencies
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/FSDirectoryTest.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/FSDirectoryTest.java 2007-01-30
10:17:25 UTC (rev 11113)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/FSDirectoryTest.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -24,7 +24,7 @@
/**
* @author Gavin King
*/
-public class FSDirectoryTest extends TestCase {
+public class FSDirectoryTest extends SearchTestCase {
protected void setUp() throws Exception {
Added:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/HANTestCase.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/HANTestCase.java
(rev 0)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/HANTestCase.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -0,0 +1,158 @@
+//$Id: $
+package org.hibernate.search.test;
+
+import java.io.InputStream;
+
+import org.hibernate.SessionFactory;
+import org.hibernate.Session;
+import org.hibernate.HibernateException;
+import org.hibernate.Interceptor;
+import org.hibernate.dialect.Dialect;
+import org.hibernate.cfg.AnnotationConfiguration;
+import org.hibernate.cfg.Environment;
+import org.hibernate.cfg.Configuration;
+
+/**
+ * copy from HAN
+ * @author Emmanuel Bernard
+ */
+public abstract class HANTestCase extends junit.framework.TestCase {
+
+ private static SessionFactory sessions;
+ private static AnnotationConfiguration cfg;
+ private static Dialect dialect;
+ private static Class lastTestClass;
+ private Session session;
+
+ public HANTestCase() {
+ super();
+ }
+
+ public HANTestCase(String x) {
+ super( x );
+ }
+
+ protected void buildSessionFactory(Class[] classes, String[] packages, String[]
xmlFiles) throws Exception {
+
+ if ( getSessions() != null ) getSessions().close();
+ try {
+ setCfg( new AnnotationConfiguration() );
+ configure( cfg );
+ if ( recreateSchema() ) {
+ cfg.setProperty( Environment.HBM2DDL_AUTO, "create-drop" );
+ }
+ for ( int i = 0; i < packages.length; i++ ) {
+ getCfg().addPackage( packages[i] );
+ }
+ for ( int i = 0; i < classes.length; i++ ) {
+ getCfg().addAnnotatedClass( classes[i] );
+ }
+ for ( int i = 0; i < xmlFiles.length; i++ ) {
+ InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(
xmlFiles[i] );
+ getCfg().addInputStream( is );
+ }
+ setDialect( Dialect.getDialect() );
+ setSessions( getCfg().buildSessionFactory( /*new TestInterceptor()*/ ) );
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ throw e;
+ }
+ }
+
+ protected void setUp() throws Exception {
+ if ( getSessions() == null || lastTestClass != getClass() ) {
+ buildSessionFactory( getMappings(), getAnnotatedPackages(), getXmlFiles() );
+ lastTestClass = getClass();
+ }
+ }
+
+ protected void runTest() throws Throwable {
+ try {
+ super.runTest();
+ if ( session != null && session.isOpen() ) {
+ if ( session.isConnected() ) session.connection().rollback();
+ session.close();
+ session = null;
+ fail( "unclosed session" );
+ }
+ else {
+ session = null;
+ }
+ }
+ catch (Throwable e) {
+ try {
+ if ( session != null && session.isOpen() ) {
+ if ( session.isConnected() ) session.connection().rollback();
+ session.close();
+ }
+ }
+ catch (Exception ignore) {
+ }
+ try {
+ if ( sessions != null ) {
+ sessions.close();
+ sessions = null;
+ }
+ }
+ catch (Exception ignore) {
+ }
+ throw e;
+ }
+ }
+
+ public Session openSession() throws HibernateException {
+ session = getSessions().openSession();
+ return session;
+ }
+
+ public Session openSession(Interceptor interceptor) throws HibernateException {
+ session = getSessions().openSession( interceptor );
+ return session;
+ }
+
+ protected abstract Class[] getMappings();
+
+ protected String[] getAnnotatedPackages() {
+ return new String[]{};
+ }
+
+ protected String[] getXmlFiles() {
+ return new String[]{};
+ }
+
+ private void setSessions(SessionFactory sessions) {
+ HANTestCase.sessions = sessions;
+ }
+
+ protected SessionFactory getSessions() {
+ return sessions;
+ }
+
+ private void setDialect(Dialect dialect) {
+ HANTestCase.dialect = dialect;
+ }
+
+ protected Dialect getDialect() {
+ return dialect;
+ }
+
+ protected static void setCfg(AnnotationConfiguration cfg) {
+ HANTestCase.cfg = cfg;
+ }
+
+ protected static AnnotationConfiguration getCfg() {
+ return cfg;
+ }
+
+ protected void configure(Configuration cfg) {
+ //cfg.setNamingStrategy( AlternativeNamingStrategy.INSTANCE );
+ //cfg.getSessionEventListenerConfig().setFlushEventListener( new
EJB3FlushEventListener() );
+ //cfg.getSessionEventListenerConfig().setAutoFlushEventListener( new
EJB3AutoFlushEventListener() );
+ }
+
+ protected boolean recreateSchema() {
+ return true;
+ }
+
+}
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/RamDirectoryTest.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/RamDirectoryTest.java 2007-01-30
10:17:25 UTC (rev 11113)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/RamDirectoryTest.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -1,23 +1,13 @@
//$Id: $
package org.hibernate.search.test;
-import java.io.File;
-import java.util.List;
-
import org.hibernate.Session;
import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.TermDocs;
-import org.apache.lucene.index.Term;
-import org.apache.lucene.search.IndexSearcher;
-import org.apache.lucene.search.Query;
-import org.apache.lucene.search.Hits;
-import org.apache.lucene.queryParser.QueryParser;
-import org.apache.lucene.analysis.standard.StandardAnalyzer;
/**
* @author Emmanuel Bernard
*/
-public class RamDirectoryTest extends TestCase {
+public class RamDirectoryTest extends SearchTestCase {
public void testMultipleEntitiesPerIndex() throws Exception {
Copied:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/SearchTestCase.java
(from rev 11111,
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/TestCase.java)
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/SearchTestCase.java
(rev 0)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/SearchTestCase.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -0,0 +1,50 @@
+//$Id: $
+package org.hibernate.search.test;
+
+import org.apache.lucene.analysis.StopAnalyzer;
+import org.apache.lucene.store.Directory;
+import org.hibernate.HibernateException;
+import org.hibernate.event.PostDeleteEventListener;
+import org.hibernate.event.PostInsertEventListener;
+import org.hibernate.event.PostUpdateEventListener;
+import org.hibernate.impl.SessionFactoryImpl;
+import org.hibernate.search.Environment;
+import org.hibernate.search.event.FullTextIndexEventListener;
+import org.hibernate.search.store.RAMDirectoryProvider;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public abstract class SearchTestCase extends HANTestCase {
+ protected void setUp() throws Exception {
+ //super.setUp(); //we need a fresh session factory each time for index set up
+ buildSessionFactory( getMappings(), getAnnotatedPackages(), getXmlFiles() );
+ }
+
+ protected Directory getDirectory(Class clazz) {
+ return getLuceneEventListener().getSearchFactory().getDocumentBuilders().get( clazz
).getDirectoryProvider().getDirectory();
+ }
+
+ private FullTextIndexEventListener getLuceneEventListener() {
+ PostInsertEventListener[] listeners = ( (SessionFactoryImpl) getSessions()
).getEventListeners().getPostInsertEventListeners();
+ FullTextIndexEventListener listener = null;
+ //FIXME this sucks since we mandante the event listener use
+ for (PostInsertEventListener candidate : listeners) {
+ if (candidate instanceof FullTextIndexEventListener ) {
+ listener = (FullTextIndexEventListener) candidate;
+ break;
+ }
+ }
+ if (listener == null) throw new HibernateException("Lucene event listener
not initialized");
+ return listener;
+ }
+
+ protected void configure(org.hibernate.cfg.Configuration cfg) {
+ cfg.setProperty( "hibernate.search.default.directory_provider",
RAMDirectoryProvider.class.getName() );
+ cfg.setProperty( Environment.ANALYZER_CLASS, StopAnalyzer.class.getName() );
+ //FullTextIndexEventListener del = new FullTextIndexEventListener();
+ cfg.getEventListeners().setPostDeleteEventListeners( new PostDeleteEventListener[]{ new
FullTextIndexEventListener() } );
+ cfg.getEventListeners().setPostUpdateEventListeners( new PostUpdateEventListener[]{ new
FullTextIndexEventListener() } );
+ cfg.getEventListeners().setPostInsertEventListeners( new PostInsertEventListener[]{ new
FullTextIndexEventListener() } );
+ }
+}
Deleted:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/TestCase.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/TestCase.java 2007-01-30
10:17:25 UTC (rev 11113)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/TestCase.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -1,50 +0,0 @@
-//$Id: $
-package org.hibernate.search.test;
-
-import org.apache.lucene.analysis.StopAnalyzer;
-import org.apache.lucene.store.Directory;
-import org.hibernate.event.PostDeleteEventListener;
-import org.hibernate.event.PostInsertEventListener;
-import org.hibernate.event.PostUpdateEventListener;
-import org.hibernate.search.Environment;
-import org.hibernate.search.store.RAMDirectoryProvider;
-import org.hibernate.search.event.FullTextIndexEventListener;
-import org.hibernate.HibernateException;
-import org.hibernate.impl.SessionFactoryImpl;
-
-/**
- * @author Emmanuel Bernard
- */
-public abstract class TestCase extends org.hibernate.test.annotations.TestCase {
- protected void setUp() throws Exception {
- //super.setUp(); //we need a fresh session factory each time for index set up
- buildSessionFactory( getMappings(), getAnnotatedPackages(), getXmlFiles() );
- }
-
- protected Directory getDirectory(Class clazz) {
- return getLuceneEventListener().getSearchFactory().getDocumentBuilders().get( clazz
).getDirectoryProvider().getDirectory();
- }
-
- private FullTextIndexEventListener getLuceneEventListener() {
- PostInsertEventListener[] listeners = ( (SessionFactoryImpl) getSessions()
).getEventListeners().getPostInsertEventListeners();
- FullTextIndexEventListener listener = null;
- //FIXME this sucks since we mandante the event listener use
- for (PostInsertEventListener candidate : listeners) {
- if (candidate instanceof FullTextIndexEventListener ) {
- listener = (FullTextIndexEventListener) candidate;
- break;
- }
- }
- if (listener == null) throw new HibernateException("Lucene event listener
not initialized");
- return listener;
- }
-
- protected void configure(org.hibernate.cfg.Configuration cfg) {
- cfg.setProperty( "hibernate.search.default.directory_provider",
RAMDirectoryProvider.class.getName() );
- cfg.setProperty( Environment.ANALYZER_CLASS, StopAnalyzer.class.getName() );
- //FullTextIndexEventListener del = new FullTextIndexEventListener();
- cfg.getEventListeners().setPostDeleteEventListeners( new PostDeleteEventListener[]{ new
FullTextIndexEventListener() } );
- cfg.getEventListeners().setPostUpdateEventListeners( new PostUpdateEventListener[]{ new
FullTextIndexEventListener() } );
- cfg.getEventListeners().setPostInsertEventListeners( new PostInsertEventListener[]{ new
FullTextIndexEventListener() } );
- }
-}
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/TransactionTest.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/TransactionTest.java 2007-01-30
10:17:25 UTC (rev 11113)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/TransactionTest.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -9,7 +9,7 @@
/**
* @author Emmanuel Bernard
*/
-public class TransactionTest extends TestCase {
+public class TransactionTest extends SearchTestCase {
public void testTransactionCommit() throws Exception {
Session s = getSessions().openSession();
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/bridge/BridgeTest.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/bridge/BridgeTest.java 2007-01-30
10:17:25 UTC (rev 11113)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/bridge/BridgeTest.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -10,7 +10,7 @@
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
-import org.hibernate.search.test.TestCase;
+import org.hibernate.search.test.SearchTestCase;
import org.hibernate.search.Environment;
import org.hibernate.search.FullTextSession;
import org.hibernate.search.Search;
@@ -22,7 +22,7 @@
/**
* @author Emmanuel Bernard
*/
-public class BridgeTest extends TestCase {
+public class BridgeTest extends SearchTestCase {
public void testDefaultAndNullBridges() throws Exception {
Cloud cloud = new Cloud();
cloud.setDate( null );
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/fieldAccess/FieldAccessTest.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/fieldAccess/FieldAccessTest.java 2007-01-30
10:17:25 UTC (rev 11113)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/fieldAccess/FieldAccessTest.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -3,7 +3,7 @@
import java.util.List;
-import org.hibernate.search.test.TestCase;
+import org.hibernate.search.test.SearchTestCase;
import org.hibernate.search.FullTextSession;
import org.hibernate.search.Search;
import org.hibernate.Session;
@@ -14,7 +14,7 @@
/**
* @author Emmanuel Bernard
*/
-public class FieldAccessTest extends TestCase {
+public class FieldAccessTest extends SearchTestCase {
public void testFields() throws Exception {
Document doc = new Document( "Hibernate in Action",
"Object/relational mapping with Hibernate", "blah blah blah" );
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/inheritance/InheritanceTest.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/inheritance/InheritanceTest.java 2007-01-30
10:17:25 UTC (rev 11113)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/inheritance/InheritanceTest.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -1,7 +1,7 @@
//$Id: $
package org.hibernate.search.test.inheritance;
-import org.hibernate.search.test.TestCase;
+import org.hibernate.search.test.SearchTestCase;
import org.hibernate.search.FullTextSession;
import org.hibernate.search.Search;
import org.hibernate.Transaction;
@@ -14,7 +14,7 @@
/**
* @author Emmanuel Bernard
*/
-public class InheritanceTest extends TestCase {
+public class InheritanceTest extends SearchTestCase {
public void testInheritance() throws Exception {
FullTextSession s = Search.createFullTextSession( openSession() );
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/query/LuceneQueryTest.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/query/LuceneQueryTest.java 2007-01-30
10:17:25 UTC (rev 11113)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/query/LuceneQueryTest.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -4,7 +4,7 @@
import java.util.List;
import java.util.Iterator;
-import org.hibernate.search.test.TestCase;
+import org.hibernate.search.test.SearchTestCase;
import org.hibernate.search.FullTextSession;
import org.hibernate.search.Search;
import org.hibernate.Transaction;
@@ -18,7 +18,7 @@
/**
* @author Emmanuel Bernard
*/
-public class LuceneQueryTest extends TestCase {
+public class LuceneQueryTest extends SearchTestCase {
public void testList() throws Exception {
FullTextSession s = Search.createFullTextSession( openSession() );
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/session/MassIndexTest.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/session/MassIndexTest.java 2007-01-30
10:17:25 UTC (rev 11113)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/session/MassIndexTest.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -3,7 +3,7 @@
import java.util.List;
-import org.hibernate.search.test.TestCase;
+import org.hibernate.search.test.SearchTestCase;
import org.hibernate.search.impl.FullTextSessionImpl;
import org.hibernate.search.FullTextSession;
import org.hibernate.search.Search;
@@ -14,7 +14,7 @@
/**
* @author Emmanuel Bernard
*/
-public class MassIndexTest extends TestCase {
+public class MassIndexTest extends SearchTestCase {
public void testTransactional() throws Exception {
FullTextSession s = Search.createFullTextSession( openSession() );
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/worker/AsyncWorkerTest.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/worker/AsyncWorkerTest.java 2007-01-30
10:17:25 UTC (rev 11113)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/worker/AsyncWorkerTest.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -1,10 +1,6 @@
//$Id: $
package org.hibernate.search.test.worker;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ExecutorService;
-
-import org.hibernate.search.test.TestCase;
import org.hibernate.search.store.RAMDirectoryProvider;
import org.hibernate.search.Environment;
import org.hibernate.search.event.FullTextIndexEventListener;
@@ -12,9 +8,6 @@
import org.hibernate.event.PostDeleteEventListener;
import org.hibernate.event.PostUpdateEventListener;
import org.hibernate.event.PostInsertEventListener;
-import org.hibernate.SessionFactory;
-import org.hibernate.Session;
-import org.hibernate.Transaction;
import org.apache.lucene.analysis.StopAnalyzer;
/**
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/worker/WorkerTestCase.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/worker/WorkerTestCase.java 2007-01-30
10:17:25 UTC (rev 11113)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/search/test/worker/WorkerTestCase.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -4,23 +4,15 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-import org.hibernate.search.test.TestCase;
-import org.hibernate.search.store.RAMDirectoryProvider;
-import org.hibernate.search.Environment;
-import org.hibernate.search.event.FullTextIndexEventListener;
+import org.hibernate.search.test.SearchTestCase;
import org.hibernate.SessionFactory;
import org.hibernate.Session;
import org.hibernate.Transaction;
-import org.hibernate.event.PostDeleteEventListener;
-import org.hibernate.event.PostUpdateEventListener;
-import org.hibernate.event.PostInsertEventListener;
-import org.hibernate.cfg.Configuration;
-import org.apache.lucene.analysis.StopAnalyzer;
/**
* @author Emmanuel Bernard
*/
-public class WorkerTestCase extends TestCase {
+public class WorkerTestCase extends SearchTestCase {
public void testConcurrency() throws Exception {
ExecutorService es = Executors.newFixedThreadPool( 15 );
Added:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/HANTestCase.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/HANTestCase.java
(rev 0)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/HANTestCase.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -0,0 +1,160 @@
+//$Id: $
+package org.hibernate.validator.test;
+
+import java.io.InputStream;
+
+import org.hibernate.SessionFactory;
+import org.hibernate.Session;
+import org.hibernate.HibernateException;
+import org.hibernate.Interceptor;
+import org.hibernate.dialect.Dialect;
+import org.hibernate.cfg.AnnotationConfiguration;
+import org.hibernate.cfg.Environment;
+import org.hibernate.cfg.Configuration;
+
+/**
+ * Copy from HAN
+ *
+ * @author Emmanuel Bernard
+ */
+public abstract class HANTestCase extends junit.framework.TestCase {
+
+ private static SessionFactory sessions;
+ private static AnnotationConfiguration cfg;
+ private static Dialect dialect;
+ private static Class lastTestClass;
+ private Session session;
+
+ public HANTestCase() {
+ super();
+ }
+
+ public HANTestCase(String x) {
+ super( x );
+ }
+
+ protected void buildSessionFactory(Class[] classes, String[] packages, String[]
xmlFiles) throws Exception {
+
+ if ( getSessions() != null ) getSessions().close();
+ try {
+ setCfg( new AnnotationConfiguration() );
+ configure( cfg );
+ if ( recreateSchema() ) {
+ cfg.setProperty( Environment.HBM2DDL_AUTO, "create-drop" );
+ }
+ for ( int i = 0; i < packages.length; i++ ) {
+ getCfg().addPackage( packages[i] );
+ }
+ for ( int i = 0; i < classes.length; i++ ) {
+ getCfg().addAnnotatedClass( classes[i] );
+ }
+ for ( int i = 0; i < xmlFiles.length; i++ ) {
+ InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(
xmlFiles[i] );
+ getCfg().addInputStream( is );
+ }
+ setDialect( Dialect.getDialect() );
+ setSessions( getCfg().buildSessionFactory( /*new TestInterceptor()*/ ) );
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ throw e;
+ }
+ }
+
+ protected void setUp() throws Exception {
+ if ( getSessions() == null || lastTestClass != getClass() ) {
+ buildSessionFactory( getMappings(), getAnnotatedPackages(), getXmlFiles() );
+ lastTestClass = getClass();
+ }
+ }
+
+ protected void runTest() throws Throwable {
+ try {
+ super.runTest();
+ if ( session != null && session.isOpen() ) {
+ if ( session.isConnected() ) session.connection().rollback();
+ session.close();
+ session = null;
+ fail( "unclosed session" );
+ }
+ else {
+ session = null;
+ }
+ }
+ catch (Throwable e) {
+ try {
+ if ( session != null && session.isOpen() ) {
+ if ( session.isConnected() ) session.connection().rollback();
+ session.close();
+ }
+ }
+ catch (Exception ignore) {
+ }
+ try {
+ if ( sessions != null ) {
+ sessions.close();
+ sessions = null;
+ }
+ }
+ catch (Exception ignore) {
+ }
+ throw e;
+ }
+ }
+
+ public Session openSession() throws HibernateException {
+ session = getSessions().openSession();
+ return session;
+ }
+
+ public Session openSession(Interceptor interceptor) throws HibernateException {
+ session = getSessions().openSession( interceptor );
+ return session;
+ }
+
+ protected abstract Class[] getMappings();
+
+ protected String[] getAnnotatedPackages() {
+ return new String[]{};
+ }
+
+ protected String[] getXmlFiles() {
+ return new String[]{};
+ }
+
+ private void setSessions(SessionFactory sessions) {
+ HANTestCase.sessions = sessions;
+ }
+
+ protected SessionFactory getSessions() {
+ return sessions;
+ }
+
+ private void setDialect(Dialect dialect) {
+ HANTestCase.dialect = dialect;
+ }
+
+ protected Dialect getDialect() {
+ return dialect;
+ }
+
+ protected static void setCfg(AnnotationConfiguration cfg) {
+ HANTestCase.cfg = cfg;
+ }
+
+ protected static AnnotationConfiguration getCfg() {
+ return cfg;
+ }
+
+ protected void configure(Configuration cfg) {
+ //cfg.setNamingStrategy( AlternativeNamingStrategy.INSTANCE );
+ //cfg.getSessionEventListenerConfig().setFlushEventListener( new
EJB3FlushEventListener() );
+ //cfg.getSessionEventListenerConfig().setAutoFlushEventListener( new
EJB3AutoFlushEventListener() );
+ }
+
+ protected boolean recreateSchema() {
+ return true;
+ }
+
+}
+
Added:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Address.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Address.java
(rev 0)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Address.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -0,0 +1,108 @@
+//$Id: Address.java 9755 2006-04-17 19:44:22Z epbernard $
+package org.hibernate.validator.test.haintegration;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Transient;
+
+import org.hibernate.validator.AssertTrue;
+import org.hibernate.validator.Length;
+import org.hibernate.validator.Min;
+import org.hibernate.validator.NotNull;
+import org.hibernate.validator.Pattern;
+import org.hibernate.validator.Range;
+
+/**
+ * @author Gavin King
+ */
+@Entity
+public class Address {
+ @NotNull
+ public static String blacklistedZipCode;
+
+ private String line1;
+ private String line2;
+ private String zip;
+ private String state;
+ @Length(max = 20)
+ @NotNull
+ private String country;
+ private long id;
+ private boolean internalValid = true;
+ @Range(min = -2, max = 50, message = "{floor.out.of.range} (escaping #{el})")
+ public int floor;
+
+ public String getCountry() {
+ return country;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+ @NotNull
+ public String getLine1() {
+ return line1;
+ }
+
+ public void setLine1(String line1) {
+ this.line1 = line1;
+ }
+
+ public String getLine2() {
+ return line2;
+ }
+
+ public void setLine2(String line2) {
+ this.line2 = line2;
+ }
+
+ @Length(max = 3)
+ @NotNull
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ @Length(max = 5, message = "{long}")
+ @Pattern(regex = "[0-9]+")
+ @NotNull
+ public String getZip() {
+ return zip;
+ }
+
+ public void setZip(String zip) {
+ this.zip = zip;
+ }
+
+ @AssertTrue
+ @Transient
+ public boolean isValid() {
+ return true;
+ }
+
+ @AssertTrue
+ @Transient
+ private boolean isInternalValid() {
+ return internalValid;
+ }
+
+ public void setInternalValid(boolean internalValid) {
+ this.internalValid = internalValid;
+ }
+
+ @Id
+ @Min(1)
+ @Range(max = 2000)
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+}
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/EmbeddedObjectTest.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/EmbeddedObjectTest.java 2007-01-30
10:17:25 UTC (rev 11113)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/EmbeddedObjectTest.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -3,18 +3,18 @@
import org.hibernate.Session;
import org.hibernate.Transaction;
+import org.hibernate.cfg.Configuration;
import org.hibernate.event.PreInsertEventListener;
import org.hibernate.event.PreUpdateEventListener;
-import org.hibernate.cfg.Configuration;
-import org.hibernate.test.annotations.TestCase;
import org.hibernate.validator.ClassValidator;
import org.hibernate.validator.event.ValidatePreInsertEventListener;
import org.hibernate.validator.event.ValidatePreUpdateEventListener;
+import org.hibernate.validator.test.HANTestCase;
/**
* @author Emmanuel Bernard
*/
-public class EmbeddedObjectTest extends TestCase {
+public class EmbeddedObjectTest extends HANTestCase {
public void testNotNullEmbeddedObject() throws Exception {
CreditCard cc = new CreditCard();
User username = new User();
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/HibernateAnnotationIntegrationTest.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/HibernateAnnotationIntegrationTest.java 2007-01-30
10:17:25 UTC (rev 11113)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/HibernateAnnotationIntegrationTest.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -8,10 +8,10 @@
import org.hibernate.event.PreUpdateEventListener;
import org.hibernate.mapping.Column;
import org.hibernate.mapping.PersistentClass;
-import org.hibernate.test.annotations.TestCase;
+import org.hibernate.validator.Environment;
import org.hibernate.validator.InvalidStateException;
-import org.hibernate.validator.Environment;
import org.hibernate.validator.event.ValidateEventListener;
+import org.hibernate.validator.test.HANTestCase;
/**
* Test the validate framework integration with the Hibernate
@@ -19,7 +19,7 @@
*
* @author Emmanuel Bernard
*/
-public class HibernateAnnotationIntegrationTest extends TestCase {
+public class HibernateAnnotationIntegrationTest extends HANTestCase {
public void testApply() throws Exception {
PersistentClass classMapping = getCfg().getClassMapping( Address.class.getName() );
//new ClassValidator( Address.class, ResourceBundle.getBundle("messages",
Locale.ENGLISH) ).apply( classMapping );
Added:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/MarsAddress.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/MarsAddress.java
(rev 0)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/MarsAddress.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -0,0 +1,34 @@
+//$Id: MarsAddress.java 8593 2005-11-17 18:12:11Z epbernard $
+package org.hibernate.validator.test.haintegration;
+
+import javax.persistence.Embeddable;
+
+import org.hibernate.validator.Length;
+import org.hibernate.validator.NotNull;
+
+/**
+ * @author Emmanuel Bernard
+ */
+@Embeddable
+public class MarsAddress {
+ private String continent;
+ private String canal;
+
+ @NotNull
+ public String getContinent() {
+ return continent;
+ }
+
+ public void setContinent(String continent) {
+ this.continent = continent;
+ }
+
+ @Length(min = 5)
+ public String getCanal() {
+ return canal;
+ }
+
+ public void setCanal(String canal) {
+ this.canal = canal;
+ }
+}
Added:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Martian.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Martian.java
(rev 0)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Martian.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -0,0 +1,32 @@
+//$Id: Martian.java 7797 2005-08-10 10:40:48Z epbernard $
+package org.hibernate.validator.test.haintegration;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+/**
+ * @author Emmanuel Bernard
+ */
+@Entity
+public class Martian {
+ private MartianPk id;
+ private MarsAddress address;
+
+ @Id
+ public MartianPk getId() {
+ return id;
+ }
+
+ public void setId(MartianPk id) {
+ this.id = id;
+ }
+
+ public MarsAddress getAddress() {
+ return address;
+ }
+
+ public void setAddress(MarsAddress address) {
+ this.address = address;
+ }
+
+}
Added:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/MartianPk.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/MartianPk.java
(rev 0)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/MartianPk.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -0,0 +1,52 @@
+//$Id: MartianPk.java 8593 2005-11-17 18:12:11Z epbernard $
+package org.hibernate.validator.test.haintegration;
+
+import java.io.Serializable;
+import javax.persistence.Embeddable;
+
+import org.hibernate.validator.Length;
+
+/**
+ * @author Emmanuel Bernard
+ */
+@Embeddable
+public class MartianPk implements Serializable {
+ private String name;
+ private String colony;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Length(max = 4)
+ public String getColony() {
+ return colony;
+ }
+
+ public void setColony(String colony) {
+ this.colony = colony;
+ }
+
+ public boolean equals(Object o) {
+ if ( this == o ) return true;
+ if ( o == null || getClass() != o.getClass() ) return false;
+
+ final MartianPk martianPk = (MartianPk) o;
+
+ if ( !colony.equals( martianPk.colony ) ) return false;
+ if ( !name.equals( martianPk.name ) ) return false;
+
+ return true;
+ }
+
+ public int hashCode() {
+ int result;
+ result = name.hashCode();
+ result = 29 * result + colony.hashCode();
+ return result;
+ }
+}
Added:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Music.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Music.java
(rev 0)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Music.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -0,0 +1,14 @@
+//$Id: Music.java 9795 2006-04-26 06:41:18Z epbernard $
+package org.hibernate.validator.test.haintegration;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+/**
+ * @author Emmanuel Bernard
+ */
+@Entity
+public class Music {
+ @Id
+ public String name;
+}
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/NonHibernateAnnotationsIntegrationTest.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/NonHibernateAnnotationsIntegrationTest.java 2007-01-30
10:17:25 UTC (rev 11113)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/NonHibernateAnnotationsIntegrationTest.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -1,13 +1,13 @@
//$Id: $
package org.hibernate.validator.test.haintegration;
-import org.hibernate.test.annotations.TestCase;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Column;
import org.hibernate.event.PreInsertEventListener;
import org.hibernate.event.PreUpdateEventListener;
import org.hibernate.cfg.Configuration;
import org.hibernate.validator.Environment;
+import org.hibernate.validator.test.HANTestCase;
import org.hibernate.validator.event.ValidateEventListener;
/**
@@ -15,7 +15,7 @@
*
* @author Emmanuel Bernard
*/
-public class NonHibernateAnnotationsIntegrationTest extends TestCase {
+public class NonHibernateAnnotationsIntegrationTest extends HANTestCase {
public void testNotApply() throws Exception {
PersistentClass classMapping = getCfg().getClassMapping( Address.class.getName() );
//new ClassValidator( Address.class, ResourceBundle.getBundle("messages",
Locale.ENGLISH) ).apply( classMapping );
Added:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Rock.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Rock.java
(rev 0)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Rock.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -0,0 +1,15 @@
+//$Id: Rock.java 9795 2006-04-26 06:41:18Z epbernard $
+package org.hibernate.validator.test.haintegration;
+
+import javax.persistence.Entity;
+
+import org.hibernate.validator.NotNull;
+
+/**
+ * @author Emmanuel Bernard
+ */
+@Entity
+public class Rock extends Music {
+ @NotNull
+ public Integer bit;
+}
Added:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Tv.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Tv.java
(rev 0)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Tv.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -0,0 +1,30 @@
+//$Id: Tv.java 10384 2006-08-31 04:10:44Z epbernard $
+package org.hibernate.validator.test.haintegration;
+
+import java.util.Date;
+import java.math.BigInteger;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+import org.hibernate.validator.Future;
+import org.hibernate.validator.Length;
+import org.hibernate.validator.Min;
+
+/**
+ * @author Emmanuel Bernard
+ */
+@Entity
+public class Tv {
+ @Id
+ @Length(max = 2)
+ public String serial;
+ public int size;
+ @Length(max = 2)
+ public String name;
+ @Future
+ public Date expDate;
+ @Length(min = 0)
+ public String description;
+ @Min(1000)
+ public BigInteger lifetime;
+}
Added:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/TvOwner.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/TvOwner.java
(rev 0)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/TvOwner.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -0,0 +1,22 @@
+//$Id: TvOwner.java 9795 2006-04-26 06:41:18Z epbernard $
+package org.hibernate.validator.test.haintegration;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.ManyToOne;
+
+import org.hibernate.validator.NotNull;
+
+/**
+ * @author Emmanuel Bernard
+ */
+@Entity
+public class TvOwner {
+ @Id
+ @GeneratedValue
+ public Integer id;
+ @ManyToOne
+ @NotNull
+ public Tv tv;
+}
Added:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Venusian.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Venusian.java
(rev 0)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/Venusian.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -0,0 +1,38 @@
+//$Id: Venusian.java 9795 2006-04-26 06:41:18Z epbernard $
+package org.hibernate.validator.test.haintegration;
+
+import java.io.Serializable;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+
+import org.hibernate.validator.Length;
+
+/**
+ * @author Emmanuel Bernard
+ */
+@Entity
+(a)IdClass(VenusianPk.class)
+public class Venusian implements Serializable {
+ private String region;
+ private String name;
+
+ @Id
+ @Length(min = 3)
+ public String getRegion() {
+ return region;
+ }
+
+ public void setRegion(String region) {
+ this.region = region;
+ }
+
+ @Id
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Added:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/VenusianPk.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/VenusianPk.java
(rev 0)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/haintegration/VenusianPk.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -0,0 +1,47 @@
+//$Id: VenusianPk.java 7797 2005-08-10 10:40:48Z epbernard $
+package org.hibernate.validator.test.haintegration;
+
+import java.io.Serializable;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class VenusianPk implements Serializable {
+ private String region;
+ private String name;
+
+ public String getRegion() {
+ return region;
+ }
+
+ public void setRegion(String region) {
+ this.region = region;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public boolean equals(Object o) {
+ if ( this == o ) return true;
+ if ( o == null || getClass() != o.getClass() ) return false;
+
+ final VenusianPk that = (VenusianPk) o;
+
+ if ( !name.equals( that.name ) ) return false;
+ if ( !region.equals( that.region ) ) return false;
+
+ return true;
+ }
+
+ public int hashCode() {
+ int result;
+ result = region.hashCode();
+ result = 29 * result + name.hashCode();
+ return result;
+ }
+}
Modified:
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/validators/DigitsTest.java
===================================================================
---
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/validators/DigitsTest.java 2007-01-30
10:17:25 UTC (rev 11113)
+++
branches/Branch_3_2/HibernateExt/metadata/src/test/org/hibernate/validator/test/validators/DigitsTest.java 2007-01-30
11:30:23 UTC (rev 11114)
@@ -8,15 +8,15 @@
import org.hibernate.event.PreUpdateEventListener;
import org.hibernate.mapping.Column;
import org.hibernate.mapping.PersistentClass;
-import org.hibernate.test.annotations.TestCase;
import org.hibernate.validator.ClassValidator;
import org.hibernate.validator.InvalidValue;
+import org.hibernate.validator.test.HANTestCase;
import org.hibernate.validator.event.ValidateEventListener;
/**
* @author Emmanuel Bernard
*/
-public class DigitsTest extends TestCase {
+public class DigitsTest extends HANTestCase {
public void testDigits() throws Exception {
Car car = new Car();