[jboss-cvs] JBossAS SVN: r62507 - in branches/JBoss_4_0_5_GA_CP: testsuite/imports/sections and 5 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Apr 24 06:32:32 EDT 2007
Author: darran.lofthouse at jboss.com
Date: 2007-04-24 06:32:31 -0400 (Tue, 24 Apr 2007)
New Revision: 62507
Added:
branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/
branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ABean.java
branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ALocal.java
branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ALocalHome.java
branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/PartitionIndexUnitTestCase.java
branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/
branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/
branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/ejb-jar.xml
branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/jboss.xml
branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/jbosscmp-jdbc.xml
Removed:
branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ABean.java
branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ALocal.java
branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ALocalHome.java
branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/PartitionIndexUnitTestCase.java
branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/
branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/ejb-jar.xml
branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/jboss.xml
branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/jbosscmp-jdbc.xml
Modified:
branches/JBoss_4_0_5_GA_CP/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/schema/PartitionedTableCache.java
branches/JBoss_4_0_5_GA_CP/testsuite/imports/sections/cmp.xml
Log:
ASPATCH-202 - cache partition index calculation.
Modified: branches/JBoss_4_0_5_GA_CP/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/schema/PartitionedTableCache.java
===================================================================
--- branches/JBoss_4_0_5_GA_CP/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/schema/PartitionedTableCache.java 2007-04-24 10:21:39 UTC (rev 62506)
+++ branches/JBoss_4_0_5_GA_CP/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/schema/PartitionedTableCache.java 2007-04-24 10:32:31 UTC (rev 62507)
@@ -246,7 +246,13 @@
private int getPartitionIndex(Object key)
{
- return Math.abs(key.hashCode()) % partitions.length;
+ int hash = key.hashCode();
+ // make it positive
+ if(hash < 0)
+ {
+ hash = hash == Integer.MIN_VALUE ? Integer.MAX_VALUE : -hash;
+ }
+ return hash % partitions.length;
}
// Inner
Modified: branches/JBoss_4_0_5_GA_CP/testsuite/imports/sections/cmp.xml
===================================================================
--- branches/JBoss_4_0_5_GA_CP/testsuite/imports/sections/cmp.xml 2007-04-24 10:21:39 UTC (rev 62506)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/imports/sections/cmp.xml 2007-04-24 10:32:31 UTC (rev 62507)
@@ -498,5 +498,17 @@
</fileset>
</jar>
+ <!-- build cmp2-paritionindex.jar -->
+ <jar destfile="${build.lib}/cmp2-partitionindex.jar">
+ <fileset dir="${build.classes}">
+ <patternset refid="common.test.client.classes"/>
+ <include name="org/jboss/test/cmp2/partitionindex/**"/>
+ </fileset>
+ <fileset dir="${build.resources}/cmp2/partitionindex">
+ <include name="**/*.*"/>
+ </fileset>
+ <zipfileset src="${jboss.test.lib}/jboss-test.jar" includes="org/jboss/**/*.*"/>
+ <zipfileset src="${junit.junit.lib}/junit.jar" includes="junit/**/*.*"/>
+ </jar>
</target>
</project>
Copied: branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex (from rev 60099, branches/Branch_4_0/testsuite/src/main/org/jboss/test/cmp2/partitionindex)
Deleted: branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ABean.java
===================================================================
--- branches/Branch_4_0/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ABean.java 2007-01-29 10:20:34 UTC (rev 60099)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ABean.java 2007-04-24 10:32:31 UTC (rev 62507)
@@ -1,109 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.test.cmp2.partitionindex;
-
-
-import javax.ejb.EntityBean;
-import javax.ejb.EntityContext;
-import javax.ejb.RemoveException;
-import javax.ejb.CreateException;
-
-
-/**
- * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
- * @version <tt>$Revision: 44013 $</tt>
- */
-public abstract class ABean implements EntityBean
-{
- private Object longTx;
-
- // CMP accessors --------------------------------------------
- /**
- * @ejb.pk-field
- * @ejb.persistent-field
- * @ejb.interface-method
- */
- public abstract Integer getId();
-
- public abstract void setId(Integer id);
-
- /**
- * @ejb.persistent-field
- * @ejb.interface-method
- */
- public abstract String getName();
-
- /**
- * @ejb.interface-method
- */
- public abstract void setName(String name);
-
- /**
- * @throws javax.ejb.CreateException
- * @ejb.create-method
- */
- public Integer ejbCreate(Integer id, String name)
- throws CreateException
- {
- setId(id);
- setName(name);
- return null;
- }
-
- public void ejbPostCreate(Integer id, String name)
- {
- }
-
- /**
- * @param ctx The new entityContext value
- */
- public void setEntityContext(EntityContext ctx)
- {
- }
-
- /**
- * Unset the associated entity context.
- */
- public void unsetEntityContext()
- {
- }
-
- public void ejbActivate()
- {
- }
-
- public void ejbLoad()
- {
- }
-
- public void ejbPassivate()
- {
- }
-
- public void ejbRemove() throws RemoveException
- {
- }
-
- public void ejbStore()
- {
- }
-}
Copied: branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ABean.java (from rev 60099, branches/Branch_4_0/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ABean.java)
===================================================================
--- branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ABean.java (rev 0)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ABean.java 2007-04-24 10:32:31 UTC (rev 62507)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.test.cmp2.partitionindex;
+
+
+import javax.ejb.EntityBean;
+import javax.ejb.EntityContext;
+import javax.ejb.RemoveException;
+import javax.ejb.CreateException;
+
+
+/**
+ * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
+ * @version <tt>$Revision: 44013 $</tt>
+ */
+public abstract class ABean implements EntityBean
+{
+ private Object longTx;
+
+ // CMP accessors --------------------------------------------
+ /**
+ * @ejb.pk-field
+ * @ejb.persistent-field
+ * @ejb.interface-method
+ */
+ public abstract Integer getId();
+
+ public abstract void setId(Integer id);
+
+ /**
+ * @ejb.persistent-field
+ * @ejb.interface-method
+ */
+ public abstract String getName();
+
+ /**
+ * @ejb.interface-method
+ */
+ public abstract void setName(String name);
+
+ /**
+ * @throws javax.ejb.CreateException
+ * @ejb.create-method
+ */
+ public Integer ejbCreate(Integer id, String name)
+ throws CreateException
+ {
+ setId(id);
+ setName(name);
+ return null;
+ }
+
+ public void ejbPostCreate(Integer id, String name)
+ {
+ }
+
+ /**
+ * @param ctx The new entityContext value
+ */
+ public void setEntityContext(EntityContext ctx)
+ {
+ }
+
+ /**
+ * Unset the associated entity context.
+ */
+ public void unsetEntityContext()
+ {
+ }
+
+ public void ejbActivate()
+ {
+ }
+
+ public void ejbLoad()
+ {
+ }
+
+ public void ejbPassivate()
+ {
+ }
+
+ public void ejbRemove() throws RemoveException
+ {
+ }
+
+ public void ejbStore()
+ {
+ }
+}
Deleted: branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ALocal.java
===================================================================
--- branches/Branch_4_0/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ALocal.java 2007-01-29 10:20:34 UTC (rev 60099)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ALocal.java 2007-04-24 10:32:31 UTC (rev 62507)
@@ -1,36 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.test.cmp2.partitionindex;
-
-/**
- * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
- * @version <tt>$Revision: 44013 $</tt>
- */
-public interface ALocal
- extends javax.ejb.EJBLocalObject
-{
- public Integer getId( ) ;
-
- public String getName( ) ;
-
- public void setName( String name ) ;
-}
Copied: branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ALocal.java (from rev 60099, branches/Branch_4_0/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ALocal.java)
===================================================================
--- branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ALocal.java (rev 0)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ALocal.java 2007-04-24 10:32:31 UTC (rev 62507)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.test.cmp2.partitionindex;
+
+/**
+ * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
+ * @version <tt>$Revision: 44013 $</tt>
+ */
+public interface ALocal
+ extends javax.ejb.EJBLocalObject
+{
+ public Integer getId( ) ;
+
+ public String getName( ) ;
+
+ public void setName( String name ) ;
+}
Deleted: branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ALocalHome.java
===================================================================
--- branches/Branch_4_0/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ALocalHome.java 2007-01-29 10:20:34 UTC (rev 60099)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ALocalHome.java 2007-04-24 10:32:31 UTC (rev 62507)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.test.cmp2.partitionindex;
-
-
-/**
- * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
- * @version <tt>$Revision: 44013 $</tt>
- */
-public interface ALocalHome
- extends javax.ejb.EJBLocalHome
-{
- public ALocal create(Integer id , String name)
- throws javax.ejb.CreateException;
-
- public ALocal findByPrimaryKey(Integer pk)
- throws javax.ejb.FinderException;
-}
Copied: branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ALocalHome.java (from rev 60099, branches/Branch_4_0/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ALocalHome.java)
===================================================================
--- branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ALocalHome.java (rev 0)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/ALocalHome.java 2007-04-24 10:32:31 UTC (rev 62507)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.test.cmp2.partitionindex;
+
+
+/**
+ * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
+ * @version <tt>$Revision: 44013 $</tt>
+ */
+public interface ALocalHome
+ extends javax.ejb.EJBLocalHome
+{
+ public ALocal create(Integer id , String name)
+ throws javax.ejb.CreateException;
+
+ public ALocal findByPrimaryKey(Integer pk)
+ throws javax.ejb.FinderException;
+}
Deleted: branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/PartitionIndexUnitTestCase.java
===================================================================
--- branches/Branch_4_0/testsuite/src/main/org/jboss/test/cmp2/partitionindex/PartitionIndexUnitTestCase.java 2007-01-29 10:20:34 UTC (rev 60099)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/PartitionIndexUnitTestCase.java 2007-04-24 10:32:31 UTC (rev 62507)
@@ -1,81 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.test.cmp2.partitionindex;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.ejb.FinderException;
-import org.jboss.test.JBossTestCase;
-import org.jboss.test.util.ejb.EJBTestCase;
-import junit.framework.Test;
-
-/**
- * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
- * @version <tt>$Revision: 44013 $</tt>
- */
-public class PartitionIndexUnitTestCase
- extends EJBTestCase
-{
- public static Test suite() throws Exception
- {
- return JBossTestCase.getDeploySetup(PartitionIndexUnitTestCase.class, "cmp2-partitionindex.jar");
- }
-
- public PartitionIndexUnitTestCase(String methodName)
- {
- super(methodName);
- }
-
- // tests
-
- public void testJBAS4033() throws Exception
- {
- ALocalHome ah = (ALocalHome)lookup("ALocalHome");
- try
- {
- ah.findByPrimaryKey(new Integer(Integer.MIN_VALUE));
- }
- catch(FinderException fe)
- {
- // that's ok
- }
- }
-
- // Private
-
- private Object lookup(String name) throws NamingException
- {
- InitialContext ic = null;
- try
- {
- ic = new InitialContext();
- return ic.lookup(name);
- }
- finally
- {
- if(ic != null)
- {
- ic.close();
- }
- }
- }
-}
Copied: branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/PartitionIndexUnitTestCase.java (from rev 60099, branches/Branch_4_0/testsuite/src/main/org/jboss/test/cmp2/partitionindex/PartitionIndexUnitTestCase.java)
===================================================================
--- branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/PartitionIndexUnitTestCase.java (rev 0)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/cmp2/partitionindex/PartitionIndexUnitTestCase.java 2007-04-24 10:32:31 UTC (rev 62507)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.test.cmp2.partitionindex;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.ejb.FinderException;
+import org.jboss.test.JBossTestCase;
+import org.jboss.test.util.ejb.EJBTestCase;
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
+ * @version <tt>$Revision: 44013 $</tt>
+ */
+public class PartitionIndexUnitTestCase
+ extends EJBTestCase
+{
+ public static Test suite() throws Exception
+ {
+ return JBossTestCase.getDeploySetup(PartitionIndexUnitTestCase.class, "cmp2-partitionindex.jar");
+ }
+
+ public PartitionIndexUnitTestCase(String methodName)
+ {
+ super(methodName);
+ }
+
+ // tests
+
+ public void testJBAS4033() throws Exception
+ {
+ ALocalHome ah = (ALocalHome)lookup("ALocalHome");
+ try
+ {
+ ah.findByPrimaryKey(new Integer(Integer.MIN_VALUE));
+ }
+ catch(FinderException fe)
+ {
+ // that's ok
+ }
+ }
+
+ // Private
+
+ private Object lookup(String name) throws NamingException
+ {
+ InitialContext ic = null;
+ try
+ {
+ ic = new InitialContext();
+ return ic.lookup(name);
+ }
+ finally
+ {
+ if(ic != null)
+ {
+ ic.close();
+ }
+ }
+ }
+}
Copied: branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex (from rev 60099, branches/Branch_4_0/testsuite/src/resources/cmp2/partitionindex)
Copied: branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF (from rev 60099, branches/Branch_4_0/testsuite/src/resources/cmp2/partitionindex/META-INF)
Deleted: branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/ejb-jar.xml
===================================================================
--- branches/Branch_4_0/testsuite/src/resources/cmp2/partitionindex/META-INF/ejb-jar.xml 2007-01-29 10:20:34 UTC (rev 60099)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/ejb-jar.xml 2007-04-24 10:32:31 UTC (rev 62507)
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE ejb-jar PUBLIC
- "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
- "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
-
-<ejb-jar>
- <enterprise-beans>
- <session>
- <description>JUnit Session Bean Test Runner</description>
- <ejb-name>EJBTestRunnerEJB</ejb-name>
- <home>org.jboss.test.util.ejb.EJBTestRunnerHome</home>
- <remote>org.jboss.test.util.ejb.EJBTestRunner</remote>
- <ejb-class>org.jboss.test.util.ejb.EJBTestRunnerBean</ejb-class>
- <session-type>Stateless</session-type>
- <transaction-type>Bean</transaction-type>
- </session>
- <entity>
- <ejb-name>A</ejb-name>
- <local-home>org.jboss.test.cmp2.partitionindex.ALocalHome</local-home>
- <local>org.jboss.test.cmp2.partitionindex.ALocal</local>
- <ejb-class>org.jboss.test.cmp2.partitionindex.ABean</ejb-class>
- <persistence-type>Container</persistence-type>
- <prim-key-class>java.lang.Integer</prim-key-class>
- <reentrant>False</reentrant>
- <cmp-version>2.x</cmp-version>
- <abstract-schema-name>A</abstract-schema-name>
- <cmp-field><field-name>id</field-name></cmp-field>
- <cmp-field><field-name>name</field-name></cmp-field>
- <primkey-field>id</primkey-field>
- </entity>
- </enterprise-beans>
-</ejb-jar>
Copied: branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/ejb-jar.xml (from rev 60099, branches/Branch_4_0/testsuite/src/resources/cmp2/partitionindex/META-INF/ejb-jar.xml)
===================================================================
--- branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/ejb-jar.xml (rev 0)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/ejb-jar.xml 2007-04-24 10:32:31 UTC (rev 62507)
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<!DOCTYPE ejb-jar PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
+ "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
+
+<ejb-jar>
+ <enterprise-beans>
+ <session>
+ <description>JUnit Session Bean Test Runner</description>
+ <ejb-name>EJBTestRunnerEJB</ejb-name>
+ <home>org.jboss.test.util.ejb.EJBTestRunnerHome</home>
+ <remote>org.jboss.test.util.ejb.EJBTestRunner</remote>
+ <ejb-class>org.jboss.test.util.ejb.EJBTestRunnerBean</ejb-class>
+ <session-type>Stateless</session-type>
+ <transaction-type>Bean</transaction-type>
+ </session>
+ <entity>
+ <ejb-name>A</ejb-name>
+ <local-home>org.jboss.test.cmp2.partitionindex.ALocalHome</local-home>
+ <local>org.jboss.test.cmp2.partitionindex.ALocal</local>
+ <ejb-class>org.jboss.test.cmp2.partitionindex.ABean</ejb-class>
+ <persistence-type>Container</persistence-type>
+ <prim-key-class>java.lang.Integer</prim-key-class>
+ <reentrant>False</reentrant>
+ <cmp-version>2.x</cmp-version>
+ <abstract-schema-name>A</abstract-schema-name>
+ <cmp-field><field-name>id</field-name></cmp-field>
+ <cmp-field><field-name>name</field-name></cmp-field>
+ <primkey-field>id</primkey-field>
+ </entity>
+ </enterprise-beans>
+</ejb-jar>
Deleted: branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/jboss.xml
===================================================================
--- branches/Branch_4_0/testsuite/src/resources/cmp2/partitionindex/META-INF/jboss.xml 2007-01-29 10:20:34 UTC (rev 60099)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/jboss.xml 2007-04-24 10:32:31 UTC (rev 62507)
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">
-
-<jboss>
- <enterprise-beans>
- <entity>
- <ejb-name>A</ejb-name>
- <local-jndi-name>ALocalHome</local-jndi-name>
- <configuration-name>custom container</configuration-name>
- </entity>
- <session>
- <ejb-name>EJBTestRunnerEJB</ejb-name>
- <jndi-name>ejb/EJBTestRunner</jndi-name>
- </session>
- </enterprise-beans>
-
- <container-configurations>
- <container-configuration extends="cmp2.x jdbc2 pm">
- <container-name>custom container</container-name>
- <container-cache-conf>
- <cache-policy-conf>
- <min-capacity>500</min-capacity>
- <max-capacity>10000</max-capacity>
- </cache-policy-conf>
- <cache-policy-conf-other>
- <partitions>10</partitions>
- </cache-policy-conf-other>
- </container-cache-conf>
- </container-configuration>
- </container-configurations>
-</jboss>
Copied: branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/jboss.xml (from rev 60099, branches/Branch_4_0/testsuite/src/resources/cmp2/partitionindex/META-INF/jboss.xml)
===================================================================
--- branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/jboss.xml (rev 0)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/jboss.xml 2007-04-24 10:32:31 UTC (rev 62507)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">
+
+<jboss>
+ <enterprise-beans>
+ <entity>
+ <ejb-name>A</ejb-name>
+ <local-jndi-name>ALocalHome</local-jndi-name>
+ <configuration-name>custom container</configuration-name>
+ </entity>
+ <session>
+ <ejb-name>EJBTestRunnerEJB</ejb-name>
+ <jndi-name>ejb/EJBTestRunner</jndi-name>
+ </session>
+ </enterprise-beans>
+
+ <container-configurations>
+ <container-configuration extends="cmp2.x jdbc2 pm">
+ <container-name>custom container</container-name>
+ <container-cache-conf>
+ <cache-policy-conf>
+ <min-capacity>500</min-capacity>
+ <max-capacity>10000</max-capacity>
+ </cache-policy-conf>
+ <cache-policy-conf-other>
+ <partitions>10</partitions>
+ </cache-policy-conf-other>
+ </container-cache-conf>
+ </container-configuration>
+ </container-configurations>
+</jboss>
Deleted: branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/jbosscmp-jdbc.xml
===================================================================
--- branches/Branch_4_0/testsuite/src/resources/cmp2/partitionindex/META-INF/jbosscmp-jdbc.xml 2007-01-29 10:20:34 UTC (rev 60099)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/jbosscmp-jdbc.xml 2007-04-24 10:32:31 UTC (rev 62507)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE jbosscmp-jdbc PUBLIC
- "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN"
- "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">
-<jbosscmp-jdbc>
- <defaults>
- <remove-table>true</remove-table>
- </defaults>
-
- <enterprise-beans>
- <entity>
- <ejb-name>A</ejb-name>
- <table-name>PARTITIONINDEX_AEJB</table-name>
- </entity>
- </enterprise-beans>
-</jbosscmp-jdbc>
Copied: branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/jbosscmp-jdbc.xml (from rev 60099, branches/Branch_4_0/testsuite/src/resources/cmp2/partitionindex/META-INF/jbosscmp-jdbc.xml)
===================================================================
--- branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/jbosscmp-jdbc.xml (rev 0)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/cmp2/partitionindex/META-INF/jbosscmp-jdbc.xml 2007-04-24 10:32:31 UTC (rev 62507)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jbosscmp-jdbc PUBLIC
+ "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN"
+ "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">
+<jbosscmp-jdbc>
+ <defaults>
+ <remove-table>true</remove-table>
+ </defaults>
+
+ <enterprise-beans>
+ <entity>
+ <ejb-name>A</ejb-name>
+ <table-name>PARTITIONINDEX_AEJB</table-name>
+ </entity>
+ </enterprise-beans>
+</jbosscmp-jdbc>
More information about the jboss-cvs-commits
mailing list