[jboss-cvs] JBossAS SVN: r62802 - in branches/Branch_4_2/ejb3: src/resources/test/clusteredentity/providedprefix/META-INF and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri May 4 01:21:56 EDT 2007


Author: bstansberry at jboss.com
Date: 2007-05-04 01:21:56 -0400 (Fri, 04 May 2007)
New Revision: 62802

Added:
   branches/Branch_4_2/ejb3/src/resources/test/clusteredentity/providedprefix/META-INF/application.xml
   branches/Branch_4_2/ejb3/src/resources/test/clusteredentity/providedprefix/META-INF/jboss-app.xml
   branches/Branch_4_2/ejb3/src/resources/test/clusteredentity/providedprefix/META-INF/persistence.xml
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/clusteredentity/unit/ProvidedPrefixEntityQueryUnitTestCase.java
Modified:
   branches/Branch_4_2/ejb3/build-test.xml
Log:
[EJBTHREE-954] Ensure segregation of deployments in the 2nd level cache

Modified: branches/Branch_4_2/ejb3/build-test.xml
===================================================================
--- branches/Branch_4_2/ejb3/build-test.xml	2007-05-04 05:21:51 UTC (rev 62801)
+++ branches/Branch_4_2/ejb3/build-test.xml	2007-05-04 05:21:56 UTC (rev 62802)
@@ -3011,6 +3011,30 @@
        </fileset>
     </jar>
 
+      <jar jarfile="${build.lib}/clusteredentity-providedprefix-test.jar">
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/ejb3/test/clusteredentity/classloader/*.class"/>
+         </fileset>
+         <fileset dir="${resources}/test/clusteredentity/providedprefix">
+            <include name="META-INF/persistence.xml"/>
+         </fileset>
+      </jar>
+
+    <jar jarfile="${build.lib}/clusteredentity-providedprefix-test.ear">
+       <fileset dir="${build.lib}">
+          <include name="clusteredentity-providedprefix-test.jar"/>
+       </fileset>
+       <fileset dir="${resources}/test/clusteredentity/providedprefix">
+          <include name="META-INF/application.xml"/>
+          <include name="META-INF/jboss-app.xml"/>
+        <include name="clusteredentity-ds.xml"/>
+       </fileset>
+       <fileset dir="${resources}/test/clusteredentity/classloader">
+          <include name="clusteredentity-ds.xml"/>
+       </fileset>
+    </jar>
+
+
     <jar jarfile="${build.lib}/clusteredentity-embeddedid-test.jar">
        <fileset dir="${build.classes}">
           <include name="org/jboss/ejb3/test/clusteredentity/embeddedid/*.class"/>
@@ -3300,6 +3324,7 @@
             <path refid="sun.jaf.classpath"/>
             <path refid="sun.javamail.classpath"/>
             <path refid="apache.httpclient.classpath"/>
+            <path refid="hsqldb.hsqldb.classpath"/>
          </classpath>
 
          <formatter type="plain" usefile="true"/>

Added: branches/Branch_4_2/ejb3/src/resources/test/clusteredentity/providedprefix/META-INF/application.xml
===================================================================
--- branches/Branch_4_2/ejb3/src/resources/test/clusteredentity/providedprefix/META-INF/application.xml	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/resources/test/clusteredentity/providedprefix/META-INF/application.xml	2007-05-04 05:21:56 UTC (rev 62802)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<application>
+   <display-name>Clustered entity with scoped classloader test ear</display-name>
+   <module>
+      <ejb>clusteredentity-providedprefix-test.jar</ejb>
+   </module>
+</application>
\ No newline at end of file

Added: branches/Branch_4_2/ejb3/src/resources/test/clusteredentity/providedprefix/META-INF/jboss-app.xml
===================================================================
--- branches/Branch_4_2/ejb3/src/resources/test/clusteredentity/providedprefix/META-INF/jboss-app.xml	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/resources/test/clusteredentity/providedprefix/META-INF/jboss-app.xml	2007-05-04 05:21:56 UTC (rev 62802)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jboss-app>
+   <loader-repository>
+      jboss.test:ear=clusteredentity-classloader-test.ear
+      <!--
+      <loader-repository-config>
+         java2ParentDelegation=false
+      </loader-repository-config>
+      -->
+   </loader-repository>
+   <module>
+      <service>clusteredentity-ds.xml</service>
+   </module>
+</jboss-app>
\ No newline at end of file

Added: branches/Branch_4_2/ejb3/src/resources/test/clusteredentity/providedprefix/META-INF/persistence.xml
===================================================================
--- branches/Branch_4_2/ejb3/src/resources/test/clusteredentity/providedprefix/META-INF/persistence.xml	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/resources/test/clusteredentity/providedprefix/META-INF/persistence.xml	2007-05-04 05:21:56 UTC (rev 62802)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence>
+   <persistence-unit name="tempdb" transaction-type="JTA">
+      <jta-data-source>java:/ClusteredEntityTestDS</jta-data-source>
+      <properties>
+         <property name="hibernate.cache.provider_class" value="org.jboss.ejb3.entity.TreeCacheProviderHook"/>
+         <property name="hibernate.treecache.mbean.object_name" value="jboss.cache:service=EJB3EntityTreeCache"/>
+         <!-- Must use "update" here as we do a test of redeployment and don't want to drop the db -->
+         <property name="hibernate.hbm2ddl.auto" value="update"/>
+         <property name="hibernate.cache.use_query_cache" value="true"/>
+         <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
+         <property name="hibernate.cache.region_prefix" value="myprefix"/>
+      </properties>
+   </persistence-unit>
+</persistence>

Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/clusteredentity/unit/ProvidedPrefixEntityQueryUnitTestCase.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/clusteredentity/unit/ProvidedPrefixEntityQueryUnitTestCase.java	                        (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/clusteredentity/unit/ProvidedPrefixEntityQueryUnitTestCase.java	2007-05-04 05:21:56 UTC (rev 62802)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.ejb3.test.clusteredentity.unit;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.ejb3.test.DBSetup;
+
+/**
+ * Duplicates teh EntityQueryUnitTestCase, but with a
+ * hibernate.cache.region_prefix specified in persistence.xml.
+ * 
+ * @author Brian Stansberry
+ */
+public class ProvidedPrefixEntityQueryUnitTestCase extends EntityQueryUnitTestCase
+{
+   public static final String EAR_NAME = "clusteredentity-providedprefix-test";
+   public static final String PROVIDED_PREFIX = "myprefix";
+   
+   public ProvidedPrefixEntityQueryUnitTestCase(String name)
+   {
+      super(name);
+   }
+   
+   public static Test suite() throws Exception
+   {
+      TestSuite suite = new TestSuite();
+      Test t1 = getDeploySetup(ProvidedPrefixEntityQueryUnitTestCase.class, 
+                               EAR_NAME + ".ear");
+
+      suite.addTest(t1);
+
+      // Create an initializer for the test suite
+      DBSetup wrapper = new DBSetup(suite);
+      return wrapper;
+   }
+
+   @Override
+   protected String createRegionName(String noPrefix)
+   {
+      return "/" + PROVIDED_PREFIX + "/" + noPrefix.replace('.', '/');
+   }
+
+   @Override
+   protected String getEarName()
+   {
+      return EAR_NAME;
+   }
+
+   @Override
+   protected String getJarName()
+   {
+      return EAR_NAME;
+   }
+
+   
+   
+
+}




More information about the jboss-cvs-commits mailing list