[hibernate-commits] Hibernate SVN: r10708 - in branches/Branch_3_2/Hibernate3/test/org/hibernate/test: . cfg

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Fri Nov 3 10:32:56 EST 2006


Author: steve.ebersole at jboss.com
Date: 2006-11-03 10:32:55 -0500 (Fri, 03 Nov 2006)
New Revision: 10708

Added:
   branches/Branch_3_2/Hibernate3/test/org/hibernate/test/cfg/
   branches/Branch_3_2/Hibernate3/test/org/hibernate/test/cfg/Cacheable.hbm.xml
   branches/Branch_3_2/Hibernate3/test/org/hibernate/test/cfg/CacheableFileTest.java
Log:
HHH-2108 : fixed cacheable files

Added: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/cfg/Cacheable.hbm.xml
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/cfg/Cacheable.hbm.xml	2006-11-03 15:22:01 UTC (rev 10707)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/cfg/Cacheable.hbm.xml	2006-11-03 15:32:55 UTC (rev 10708)
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+	"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+	"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping>
+
+    <class entity-name="Entity">
+        <id name="id" type="long" column="ID">
+            <generator class="increment"/>
+        </id>
+        <property name="name" type="string" column="NAME"/>
+    </class>
+
+</hibernate-mapping>

Added: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/cfg/CacheableFileTest.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/cfg/CacheableFileTest.java	2006-11-03 15:22:01 UTC (rev 10707)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/cfg/CacheableFileTest.java	2006-11-03 15:32:55 UTC (rev 10708)
@@ -0,0 +1,41 @@
+package org.hibernate.test.cfg;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.hibernate.cfg.Configuration;
+
+/**
+ * {@inheritDoc}
+ *
+ * @author Steve Ebersole
+ */
+public class CacheableFileTest extends TestCase {
+
+	public static final String MAPPING = "org/hibernate/test/cfg/Cacheable.hbm.xml";
+
+	private File mappingFile;
+
+	protected void setUp() throws Exception {
+		super.setUp();
+		mappingFile = new File( getClass().getClassLoader().getResource( MAPPING ).getFile() );
+		assertTrue( mappingFile.exists() );
+		File cached = new File( mappingFile.getParentFile(), mappingFile.getName() + ".bin" );
+		if ( cached.exists() ) {
+			cached.delete();
+		}
+	}
+
+	protected void tearDown() throws Exception {
+		mappingFile = null;
+		super.tearDown();
+	}
+
+	public void testCachedFiles() {
+		Configuration cfg = new Configuration();
+		cfg.addCacheableFile( mappingFile );
+		Configuration cfg2 = new Configuration();
+		cfg2.addCacheableFile( mappingFile );
+	}
+}




More information about the hibernate-commits mailing list