[jboss-cvs] JBossAS SVN: r79754 - in projects/jpa/trunk/deployers: src/main/java/org/jboss/jpa/deployment and 11 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Oct 20 12:01:10 EDT 2008


Author: bstansberry at jboss.com
Date: 2008-10-20 12:01:10 -0400 (Mon, 20 Oct 2008)
New Revision: 79754

Added:
   projects/jpa/trunk/deployers/src/test/java/org/jboss/jpa/deployers/test/common/MockRegionFactory.java
   projects/jpa/trunk/deployers/src/test/java/org/jboss/jpa/deployers/test/ejbthree893/
   projects/jpa/trunk/deployers/src/test/java/org/jboss/jpa/deployers/test/ejbthree893/SessionFactoryNameTestCase.java
   projects/jpa/trunk/deployers/src/test/java/org/jboss/jpa/deployers/test/jbas6111/
   projects/jpa/trunk/deployers/src/test/java/org/jboss/jpa/deployers/test/jbas6111/SecondLevelCacheRegionPrefixTestCase.java
   projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/ejbthree893/
   projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/ejbthree893/SessionFactoryNameTestCase.xml
   projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/ejbthree893/derby-beans.xml
   projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/ejbthree893/pu/
   projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/ejbthree893/pu/META-INF/
   projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/ejbthree893/pu/META-INF/persistence.xml
   projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/jbas6111/
   projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/jbas6111/SecondLevelCacheRegionPrefixTestCase.xml
   projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/jbas6111/derby-beans.xml
   projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/jbas6111/pu/
   projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/jbas6111/pu/META-INF/
   projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/jbas6111/pu/META-INF/persistence.xml
Modified:
   projects/jpa/trunk/deployers/pom.xml
   projects/jpa/trunk/deployers/src/main/java/org/jboss/jpa/deployment/PersistenceUnitDeployment.java
Log:
[JBAS-6111] Ensure hibernate.cache.region_prefix is specified by PersistenceUnitDeployment
Test EJBTHREE-893

Modified: projects/jpa/trunk/deployers/pom.xml
===================================================================
--- projects/jpa/trunk/deployers/pom.xml	2008-10-20 15:50:06 UTC (rev 79753)
+++ projects/jpa/trunk/deployers/pom.xml	2008-10-20 16:01:10 UTC (rev 79754)
@@ -22,7 +22,7 @@
     <dependency>
       <groupId>jboss.jbossts</groupId>
       <artifactId>jbossjta</artifactId>
-      <version>4.3.0.GA</version>
+      <version>4.4.0.GA</version>
       <scope>test</scope>
     </dependency>
   	<dependency>
@@ -41,12 +41,12 @@
     <dependency>
       <groupId>org.hibernate</groupId>
       <artifactId>hibernate-entitymanager</artifactId>
-      <version>3.3.2.GA</version>
+      <version>3.4.0.GA</version>
     </dependency>
     <dependency>
-      <groupId>org.jboss</groupId>
+      <groupId>org.jboss.integration</groupId>
       <artifactId>jboss-transaction-spi</artifactId>
-      <version>5.0.0.Beta4</version>
+      <version>5.0.0.CR2</version>
     </dependency>
     <dependency>
       <groupId>org.jboss</groupId>
@@ -57,22 +57,22 @@
   	<dependency>
       <groupId>org.jboss.deployers</groupId>
       <artifactId>jboss-deployers-vfs</artifactId>
-      <version>2.0.0.Beta18</version>
+      <version>2.0.0.CR2</version>
     </dependency>
   	<dependency>
       <groupId>org.jboss.deployers</groupId>
       <artifactId>jboss-deployers-vfs-spi</artifactId>
-      <version>2.0.0.Beta18</version>
+      <version>2.0.0.CR2</version>
     </dependency>
     <dependency>
       <groupId>org.jboss.metadata</groupId>
       <artifactId>jboss-metadata</artifactId>
-      <version>1.0.0.Beta26</version>
+      <version>1.0.0.CR1</version>
     </dependency>
     <dependency>
       <groupId>org.jboss.naming</groupId>
       <artifactId>jnpserver</artifactId>
-      <version>5.0.0.CR1</version>
+      <version>5.0.0.CR3</version>
       <scope>test</scope>
     </dependency>
     
@@ -92,8 +92,17 @@
     <dependency>
       <groupId>jboss.jbossts</groupId>
       <artifactId>jbossts-common</artifactId>
-      <version>4.3.0.GA</version>
+      <version>4.4.0.GA</version>
       <scope>test</scope>
     </dependency>
+    
+    <!-- Hibernate core logging -->
+    <dependency>
+      <groupId>org.jboss.slf4j</groupId>
+      <artifactId>slf4j-jboss-logging</artifactId>
+      <version>1.0.0.GA</version>
+      <scope>test</scope>
+    </dependency>
+    
   </dependencies>
 </project>

Modified: projects/jpa/trunk/deployers/src/main/java/org/jboss/jpa/deployment/PersistenceUnitDeployment.java
===================================================================
--- projects/jpa/trunk/deployers/src/main/java/org/jboss/jpa/deployment/PersistenceUnitDeployment.java	2008-10-20 15:50:06 UTC (rev 79753)
+++ projects/jpa/trunk/deployers/src/main/java/org/jboss/jpa/deployment/PersistenceUnitDeployment.java	2008-10-20 16:01:10 UTC (rev 79754)
@@ -277,6 +277,13 @@
          pi.getProperties().put("hibernate.session_factory_name", kernelName);
       }
       
+      // EJBTHREE-954/JBAS-6111
+      // Ensure 2nd level cache entries are segregated from other deployments
+      if (pi.getProperties().getProperty("hibernate.cache.region_prefix") == null)
+      {
+         pi.getProperties().setProperty("hibernate.cache.region_prefix", kernelName);
+      }
+      
       PersistenceProvider pp = (PersistenceProvider) providerClass.newInstance();
       actualFactory = pp.createContainerEntityManagerFactory(pi, null);
 

Added: projects/jpa/trunk/deployers/src/test/java/org/jboss/jpa/deployers/test/common/MockRegionFactory.java
===================================================================
--- projects/jpa/trunk/deployers/src/test/java/org/jboss/jpa/deployers/test/common/MockRegionFactory.java	                        (rev 0)
+++ projects/jpa/trunk/deployers/src/test/java/org/jboss/jpa/deployers/test/common/MockRegionFactory.java	2008-10-20 16:01:10 UTC (rev 79754)
@@ -0,0 +1,180 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jpa.deployers.test.common;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.hibernate.cache.CacheDataDescription;
+import org.hibernate.cache.CacheException;
+import org.hibernate.cache.CollectionRegion;
+import org.hibernate.cache.EntityRegion;
+import org.hibernate.cache.QueryResultsRegion;
+import org.hibernate.cache.RegionFactory;
+import org.hibernate.cache.TimestampsRegion;
+import org.hibernate.cfg.Settings;
+
+/**
+ * Mock impl of Hibernate RegionFactory used as a mechanism to validate
+ * the properties used to configure a Hibernate SessionFactory. The intent
+ * is not really to have a meaningful RegionFactory or second level cache; 
+ * it's just that the RegionFactory plugin mechanism provides a hook to examine 
+ * the properties associated with the Hibernate SessionFactory.
+ * 
+ * @see org.jboss.jpa.deployers.test.ejbthree893.SessionFactoryNameTestCase
+ * @see org.jboss.jpa.deployers.test.jbas6111.SecondLevelCacheRegionPrefixTestCase
+ * 
+ * @author Brian Stansberry
+ */
+public class MockRegionFactory implements RegionFactory
+{
+   /** List of Properties passed to {@link #start(Settings, Properties)} */
+   public static final List<Properties> SESSION_FACTORY_PROPERTIES = new ArrayList<Properties>();
+   
+   public MockRegionFactory()
+   {      
+   }
+
+   public MockRegionFactory(Properties properties)
+   {      
+   }
+   
+   /**
+    * This is the relevant bit; we store a ref to the properties.
+    */
+   public void start(Settings arg0, Properties arg1) throws CacheException
+   {
+      SESSION_FACTORY_PROPERTIES.add(arg1);
+   }
+   
+   public CollectionRegion buildCollectionRegion(String arg0, Properties arg1, CacheDataDescription arg2)
+         throws CacheException
+   {
+      throw new UnsupportedOperationException("MockRegionFactory doesn't support collection regions");
+   }
+
+   public EntityRegion buildEntityRegion(String arg0, Properties arg1, CacheDataDescription arg2) throws CacheException
+   {
+      throw new UnsupportedOperationException("MockRegionFactory doesn't support entity regions");
+   }
+
+   public QueryResultsRegion buildQueryResultsRegion(String arg0, Properties arg1) throws CacheException
+   {
+      return new MockGeneralDataRegion(arg0);
+   }
+
+   public TimestampsRegion buildTimestampsRegion(String arg0, Properties arg1) throws CacheException
+   {
+      return new MockGeneralDataRegion(arg0);
+   }
+
+   public boolean isMinimalPutsEnabledByDefault()
+   {
+      return false;
+   }
+
+   public long nextTimestamp()
+   {
+      return 0;
+   }
+
+   public void stop()
+   {
+      // no-op
+   }
+   
+   public class MockGeneralDataRegion implements QueryResultsRegion, TimestampsRegion
+   {
+      private final String name;
+      
+      public MockGeneralDataRegion(String name)
+      {
+         this.name = name;
+      }
+      
+      public void evict(Object arg0) throws CacheException
+      {
+         // no-op
+      }
+
+      public void evictAll() throws CacheException
+      {
+         // no-op
+      }
+
+      public Object get(Object arg0) throws CacheException
+      {
+         return null;
+      }
+
+      public void put(Object arg0, Object arg1) throws CacheException
+      {
+         // no-op
+      }
+
+      public void destroy() throws CacheException
+      {
+         // no-op
+      }
+
+      public long getElementCountInMemory()
+      {
+         return 0;
+      }
+
+      public long getElementCountOnDisk()
+      {
+         return 0;
+      }
+
+      public String getName()
+      {
+         return name;
+      }
+
+      public long getSizeInMemory()
+      {
+         return 0;
+      }
+
+      public int getTimeout()
+      {
+         return 0;
+      }
+
+      public long nextTimestamp()
+      {
+         return 0;
+      }
+
+      public Map toMap()
+      {      
+         return Collections.EMPTY_MAP;
+      }
+      
+   }
+
+}


Property changes on: projects/jpa/trunk/deployers/src/test/java/org/jboss/jpa/deployers/test/common/MockRegionFactory.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Added: projects/jpa/trunk/deployers/src/test/java/org/jboss/jpa/deployers/test/ejbthree893/SessionFactoryNameTestCase.java
===================================================================
--- projects/jpa/trunk/deployers/src/test/java/org/jboss/jpa/deployers/test/ejbthree893/SessionFactoryNameTestCase.java	                        (rev 0)
+++ projects/jpa/trunk/deployers/src/test/java/org/jboss/jpa/deployers/test/ejbthree893/SessionFactoryNameTestCase.java	2008-10-20 16:01:10 UTC (rev 79754)
@@ -0,0 +1,103 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jpa.deployers.test.ejbthree893;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.jpa.deployers.test.common.MainDeployerTestDelegate;
+import org.jboss.jpa.deployers.test.common.MockRegionFactory;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Test for EJBTHREE-893 compliance.
+ * 
+ * @author Brian Stansberry
+ * 
+ * @version $Revision: $
+ */
+public class SessionFactoryNameTestCase
+{
+   private static MainDeployerTestDelegate delegate;
+   
+   @AfterClass
+   public static void afterClass() throws Exception
+   {
+      delegate.tearDown();
+   }
+   
+   @BeforeClass
+   public static void beforeClass() throws Exception
+   {
+      delegate = new MainDeployerTestDelegate(SessionFactoryNameTestCase.class);
+      delegate.setUp();
+      
+      delegate.deploy("/org/jboss/jpa/deployers/test/common/jndi-beans.xml");
+      delegate.deploy("/org/jboss/jpa/deployers/test/common/jbossts-beans.xml");
+      delegate.deploy("derby-beans.xml");
+   }
+   
+   @After
+   public void after() throws Exception
+   {
+      MockRegionFactory.SESSION_FACTORY_PROPERTIES.clear();
+   }
+   
+   @Test
+   public void testSessionFactoryName() throws Exception
+   {
+      String spec = "/org/jboss/jpa/deployers/test/ejbthree893/pu";
+      URL url = getClass().getResource(spec);
+      VirtualFile file = VFS.getRoot(url);
+      VFSDeployment deployment = VFSDeploymentFactory.getInstance().createVFSDeployment(file);
+      delegate.getMainDeployer().deploy(deployment);
+      
+      try
+      {         
+         assertEquals("Expected number of property sets found", 2, MockRegionFactory.SESSION_FACTORY_PROPERTIES.size());
+         Set<String> factoryNames = new HashSet<String>();
+         for (Properties properties : MockRegionFactory.SESSION_FACTORY_PROPERTIES)
+         {
+            factoryNames.add(properties.getProperty("hibernate.session_factory_name"));               
+         }
+         
+         assertTrue("Synthetic factory name created", factoryNames.contains("persistence.unit:unitName=#noname"));
+         assertTrue("Declared factory name respected", factoryNames.contains("a_name")); 
+      }
+      finally
+      {      
+         delegate.getMainDeployer().undeploy(deployment);
+      }
+   }
+}

Added: projects/jpa/trunk/deployers/src/test/java/org/jboss/jpa/deployers/test/jbas6111/SecondLevelCacheRegionPrefixTestCase.java
===================================================================
--- projects/jpa/trunk/deployers/src/test/java/org/jboss/jpa/deployers/test/jbas6111/SecondLevelCacheRegionPrefixTestCase.java	                        (rev 0)
+++ projects/jpa/trunk/deployers/src/test/java/org/jboss/jpa/deployers/test/jbas6111/SecondLevelCacheRegionPrefixTestCase.java	2008-10-20 16:01:10 UTC (rev 79754)
@@ -0,0 +1,103 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jpa.deployers.test.jbas6111;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.jpa.deployers.test.common.MainDeployerTestDelegate;
+import org.jboss.jpa.deployers.test.common.MockRegionFactory;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Test for JBAS-6111 compliance.
+ * 
+ * @author Brian Stansberry
+ * 
+ * @version $Revision: $
+ */
+public class SecondLevelCacheRegionPrefixTestCase
+{
+   private static MainDeployerTestDelegate delegate;
+   
+   @AfterClass
+   public static void afterClass() throws Exception
+   {
+      delegate.tearDown();
+   }
+   
+   @BeforeClass
+   public static void beforeClass() throws Exception
+   {
+      delegate = new MainDeployerTestDelegate(SecondLevelCacheRegionPrefixTestCase.class);
+      delegate.setUp();
+      
+      delegate.deploy("/org/jboss/jpa/deployers/test/common/jndi-beans.xml");
+      delegate.deploy("/org/jboss/jpa/deployers/test/common/jbossts-beans.xml");
+      delegate.deploy("derby-beans.xml");
+   }
+   
+   @After
+   public void after() throws Exception
+   {
+      MockRegionFactory.SESSION_FACTORY_PROPERTIES.clear();
+   }
+   
+   @Test
+   public void testRegionPrefixes() throws Exception
+   {
+      String spec = "/org/jboss/jpa/deployers/test/jbas6111/pu";
+      URL url = getClass().getResource(spec);
+      VirtualFile file = VFS.getRoot(url);
+      VFSDeployment deployment = VFSDeploymentFactory.getInstance().createVFSDeployment(file);
+      delegate.getMainDeployer().deploy(deployment);
+      
+      try
+      {         
+         assertEquals("Expected number of property sets found", 2, MockRegionFactory.SESSION_FACTORY_PROPERTIES.size());
+         Set<String> regionPrefixes = new HashSet<String>();
+         for (Properties properties : MockRegionFactory.SESSION_FACTORY_PROPERTIES)
+         {
+            regionPrefixes.add(properties.getProperty("hibernate.cache.region_prefix"));               
+         }
+         
+         assertTrue("Synthetic region prefix created", regionPrefixes.contains("persistence.unit:unitName=#noprefix"));
+         assertTrue("Declared region prefix respected", regionPrefixes.contains("a_prefix")); 
+      }
+      finally
+      {      
+         delegate.getMainDeployer().undeploy(deployment);
+      }
+   }
+}

Added: projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/ejbthree893/SessionFactoryNameTestCase.xml
===================================================================
--- projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/ejbthree893/SessionFactoryNameTestCase.xml	                        (rev 0)
+++ projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/ejbthree893/SessionFactoryNameTestCase.xml	2008-10-20 16:01:10 UTC (rev 79754)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <bean name="DataSourceDependencyResolver" class="org.jboss.jpa.deployers.test.common.SimpleDataSourceDependencyResolver"/>
+   
+   <bean name="JavaEEModuleInformer" class="org.jboss.jpa.deployers.test.common.SimpleJavaEEModuleInformer"/>
+   
+   <bean name="PersistenceUnitDependencyResolver" class="org.jboss.jpa.resolvers.DefaultPersistenceUnitDependencyResolver"/>
+   
+   <bean name="PersistenceParsingDeployer" class="org.jboss.jpa.deployers.PersistenceParsingDeployer"/>
+
+   <bean name="PersistenceDeployer" class="org.jboss.jpa.deployers.PersistenceDeployer"/>
+   <bean name="PersistenceUnitDeployer" class="org.jboss.jpa.deployers.PersistenceUnitDeployer">
+      <property name="defaultPersistenceProperties">
+         <map keyClass="java.lang.String" valueClass="java.lang.String">
+            <entry>
+               <key>hibernate.transaction.manager_lookup_class</key>
+               <value>org.hibernate.transaction.JBossTransactionManagerLookup</value>
+            </entry>
+         </map>
+      </property>
+   </bean>
+</deployment>

Added: projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/ejbthree893/derby-beans.xml
===================================================================
--- projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/ejbthree893/derby-beans.xml	                        (rev 0)
+++ projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/ejbthree893/derby-beans.xml	2008-10-20 16:01:10 UTC (rev 79754)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <!-- As a 'mock' DataSource we use Derby -->
+   <bean name="DerbyService" class="org.jboss.jpa.deployers.test.common.DerbyService"/>
+</deployment>
\ No newline at end of file

Added: projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/ejbthree893/pu/META-INF/persistence.xml
===================================================================
--- projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/ejbthree893/pu/META-INF/persistence.xml	                        (rev 0)
+++ projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/ejbthree893/pu/META-INF/persistence.xml	2008-10-20 16:01:10 UTC (rev 79754)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+   version="1.0">
+   <persistence-unit name="named">
+      <jta-data-source>java:/DefaultDS</jta-data-source>
+      <properties>
+          <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+          <!-- Use a special RegionFactory that caches the SessionFactory properties so the
+               test can inspect them. -->
+          <property name="hibernate.cache.region.factory_class" value="org.jboss.jpa.deployers.test.common.MockRegionFactory"/>
+          <!-- MockRegionFactory can only handle query caching, not entity/collection -->
+          <property name="hibernate.cache.use_query_cache" value="true"/>
+          <!--  Test validates this config is respected -->
+          <property name="hibernate.session_factory_name" value="a_name"/>
+      </properties>
+   </persistence-unit>
+   <persistence-unit name="noname">
+      <jta-data-source>java:/DefaultDS</jta-data-source>
+      <properties>
+          <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+          <!-- Use a special RegionFactory that caches the SessionFactory properties so the
+               test can inspect them. -->
+          <property name="hibernate.cache.region.factory_class" value="org.jboss.jpa.deployers.test.common.MockRegionFactory"/>
+          <!-- MockRegionFactory can only handle query caching, not entity/collection -->
+          <property name="hibernate.cache.use_query_cache" value="true"/>
+      </properties>
+   </persistence-unit>
+</persistence>


Property changes on: projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/jbas6111
___________________________________________________________________
Name: svn:mergeinfo
   + 

Added: projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/jbas6111/SecondLevelCacheRegionPrefixTestCase.xml
===================================================================
--- projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/jbas6111/SecondLevelCacheRegionPrefixTestCase.xml	                        (rev 0)
+++ projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/jbas6111/SecondLevelCacheRegionPrefixTestCase.xml	2008-10-20 16:01:10 UTC (rev 79754)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <bean name="DataSourceDependencyResolver" class="org.jboss.jpa.deployers.test.common.SimpleDataSourceDependencyResolver"/>
+   
+   <bean name="JavaEEModuleInformer" class="org.jboss.jpa.deployers.test.common.SimpleJavaEEModuleInformer"/>
+   
+   <bean name="PersistenceUnitDependencyResolver" class="org.jboss.jpa.resolvers.DefaultPersistenceUnitDependencyResolver"/>
+   
+   <bean name="PersistenceParsingDeployer" class="org.jboss.jpa.deployers.PersistenceParsingDeployer"/>
+
+   <bean name="PersistenceDeployer" class="org.jboss.jpa.deployers.PersistenceDeployer"/>
+   <bean name="PersistenceUnitDeployer" class="org.jboss.jpa.deployers.PersistenceUnitDeployer">
+      <property name="defaultPersistenceProperties">
+         <map keyClass="java.lang.String" valueClass="java.lang.String">
+            <entry>
+               <key>hibernate.transaction.manager_lookup_class</key>
+               <value>org.hibernate.transaction.JBossTransactionManagerLookup</value>
+            </entry>
+         </map>
+      </property>
+   </bean>
+</deployment>

Added: projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/jbas6111/derby-beans.xml
===================================================================
--- projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/jbas6111/derby-beans.xml	                        (rev 0)
+++ projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/jbas6111/derby-beans.xml	2008-10-20 16:01:10 UTC (rev 79754)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <!-- As a 'mock' DataSource we use Derby -->
+   <bean name="DerbyService" class="org.jboss.jpa.deployers.test.common.DerbyService"/>
+</deployment>
\ No newline at end of file

Added: projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/jbas6111/pu/META-INF/persistence.xml
===================================================================
--- projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/jbas6111/pu/META-INF/persistence.xml	                        (rev 0)
+++ projects/jpa/trunk/deployers/src/test/resources/org/jboss/jpa/deployers/test/jbas6111/pu/META-INF/persistence.xml	2008-10-20 16:01:10 UTC (rev 79754)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+   version="1.0">
+   <persistence-unit name="prefix">
+      <jta-data-source>java:/DefaultDS</jta-data-source>
+      <properties>
+          <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+          <!-- Use a special RegionFactory that caches the SessionFactory properties so the
+               test can inspect them. -->
+          <property name="hibernate.cache.region.factory_class" value="org.jboss.jpa.deployers.test.common.MockRegionFactory"/>
+          <!-- MockRegionFactory can only handle query caching, not entity/collection -->
+          <property name="hibernate.cache.use_query_cache" value="true"/>
+          <!--  Test validates this config is respected -->
+          <property name="hibernate.cache.region_prefix" value="a_prefix"/>
+      </properties>
+   </persistence-unit>
+   <persistence-unit name="noprefix">
+      <jta-data-source>java:/DefaultDS</jta-data-source>
+      <properties>
+          <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+          <!-- Use a special RegionFactory that caches the SessionFactory properties so the
+               test can inspect them. -->
+          <property name="hibernate.cache.region.factory_class" value="org.jboss.jpa.deployers.test.common.MockRegionFactory"/>
+          <!-- MockRegionFactory can only handle query caching, not entity/collection -->
+          <property name="hibernate.cache.use_query_cache" value="true"/>
+      </properties>
+   </persistence-unit>
+</persistence>




More information about the jboss-cvs-commits mailing list