[hibernate-commits] Hibernate SVN: r11554 - trunk/HibernateExt/search/src/test/org/hibernate/search/test/bridge.
hibernate-commits at lists.jboss.org
hibernate-commits at lists.jboss.org
Thu May 24 00:31:40 EDT 2007
Author: epbernard
Date: 2007-05-24 00:31:40 -0400 (Thu, 24 May 2007)
New Revision: 11554
Added:
trunk/HibernateExt/search/src/test/org/hibernate/search/test/bridge/Gangster.java
trunk/HibernateExt/search/src/test/org/hibernate/search/test/bridge/UnresolvedBridgeTest.java
Log:
HSEARCH-37 tests
Added: trunk/HibernateExt/search/src/test/org/hibernate/search/test/bridge/Gangster.java
===================================================================
--- trunk/HibernateExt/search/src/test/org/hibernate/search/test/bridge/Gangster.java (rev 0)
+++ trunk/HibernateExt/search/src/test/org/hibernate/search/test/bridge/Gangster.java 2007-05-24 04:31:40 UTC (rev 11554)
@@ -0,0 +1,37 @@
+//$Id: $
+package org.hibernate.search.test.bridge;
+
+import java.io.Serializable;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.GeneratedValue;
+
+import org.hibernate.search.annotations.Indexed;
+import org.hibernate.search.annotations.DocumentId;
+
+/**
+ * @author Emmanuel Bernard
+ */
+ at Entity
+ at Indexed
+public class Gangster {
+ @Id @DocumentId
+ private Serializable id;
+ private String name;
+
+ public Serializable getId() {
+ return id;
+ }
+
+ public void setId(Serializable id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Added: trunk/HibernateExt/search/src/test/org/hibernate/search/test/bridge/UnresolvedBridgeTest.java
===================================================================
--- trunk/HibernateExt/search/src/test/org/hibernate/search/test/bridge/UnresolvedBridgeTest.java (rev 0)
+++ trunk/HibernateExt/search/src/test/org/hibernate/search/test/bridge/UnresolvedBridgeTest.java 2007-05-24 04:31:40 UTC (rev 11554)
@@ -0,0 +1,40 @@
+//$Id: $
+package org.hibernate.search.test.bridge;
+
+import java.io.InputStream;
+
+import org.hibernate.search.test.SearchTestCase;
+import org.hibernate.search.SearchException;
+import org.hibernate.Session;
+import org.hibernate.dialect.Dialect;
+import org.hibernate.cfg.AnnotationConfiguration;
+import org.hibernate.cfg.Environment;
+import org.hibernate.cfg.Configuration;
+import junit.framework.TestCase;
+
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class UnresolvedBridgeTest extends TestCase {
+ public void testSerializableType() throws Exception {
+ AnnotationConfiguration cfg = new AnnotationConfiguration();
+
+ for (int i = 0; i < getMappings().length; i++) {
+ cfg.addAnnotatedClass( getMappings()[i] );
+ }
+ try {
+ cfg.buildSessionFactory( /*new TestInterceptor()*/ );
+ fail("Undefined bridge went through");
+ }
+ catch( SearchException e ) {
+ //success
+ }
+ }
+
+ protected Class[] getMappings() {
+ return new Class[] {
+ Gangster.class
+ };
+ }
+}
More information about the hibernate-commits
mailing list