[jboss-cvs] JBossAS SVN: r64686 - trunk/testsuite/src/main/org/jboss/test/deployers/jbas4548/ejb.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Aug 18 17:10:55 EDT 2007


Author: bstansberry at jboss.com
Date: 2007-08-18 17:10:55 -0400 (Sat, 18 Aug 2007)
New Revision: 64686

Added:
   trunk/testsuite/src/main/org/jboss/test/deployers/jbas4548/ejb/AComplexPK.java
   trunk/testsuite/src/main/org/jboss/test/deployers/jbas4548/ejb/EntityPK.java
   trunk/testsuite/src/main/org/jboss/test/deployers/jbas4548/ejb/EntityPKBean.java
   trunk/testsuite/src/main/org/jboss/test/deployers/jbas4548/ejb/EntityPKHome.java
Log:
[JBAS-4548] Add a test for JBAS-4548

Added: trunk/testsuite/src/main/org/jboss/test/deployers/jbas4548/ejb/AComplexPK.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/jbas4548/ejb/AComplexPK.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/jbas4548/ejb/AComplexPK.java	2007-08-18 21:10:55 UTC (rev 64686)
@@ -0,0 +1,71 @@
+/*
+  * 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.deployers.jbas4548.ejb;
+
+import java.io.Serializable;
+import java.io.IOException;
+
+public class AComplexPK implements Serializable{
+
+    /** The serialVersionUID */
+   private static final long serialVersionUID = 1L;
+   
+   public boolean aBoolean;
+    public int anInt;
+    public long aLong;
+    public double aDouble;
+    public String aString;
+
+    public AComplexPK() {};
+    
+
+    public AComplexPK(boolean aBoolean, int anInt, long aLong, double aDouble, String aString) {
+
+        this.aBoolean = aBoolean;
+        this.anInt = anInt;
+        this.aLong = aLong;
+        this.aDouble = aDouble;
+        this.aString = aString;
+    }
+	
+	public boolean equals(Object other) {
+		if (other != null && other instanceof AComplexPK) {
+			AComplexPK otherPK = (AComplexPK)other;
+			return ((aBoolean == otherPK.aBoolean) &&
+				(anInt == otherPK.anInt) &&
+				(aLong == otherPK.aLong) &&
+				(aDouble == otherPK.aDouble) &&
+				(aString == null ? otherPK.aString == null : aString.equals(otherPK.aString)));
+		} else return false;
+	}
+				
+	
+	public int hashCode() {
+		
+		// Missing the double but ok for test
+		
+		return anInt*
+				(new Long(aLong)).intValue()*
+				(new Double(aDouble)).intValue()*
+				aString.hashCode();
+	}
+} 


Property changes on: trunk/testsuite/src/main/org/jboss/test/deployers/jbas4548/ejb/AComplexPK.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + native

Added: trunk/testsuite/src/main/org/jboss/test/deployers/jbas4548/ejb/EntityPK.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/jbas4548/ejb/EntityPK.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/jbas4548/ejb/EntityPK.java	2007-08-18 21:10:55 UTC (rev 64686)
@@ -0,0 +1,33 @@
+/*
+  * 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.deployers.jbas4548.ejb;
+
+import javax.ejb.EJBLocalObject;
+
+public interface EntityPK extends EJBLocalObject
+{
+    public AComplexPK readAllValues();
+    public void updateAllValues(AComplexPK aComplexPK);
+	
+	public int getOtherField();
+	public void setOtherField(int newValue);
+}


Property changes on: trunk/testsuite/src/main/org/jboss/test/deployers/jbas4548/ejb/EntityPK.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + native

Added: trunk/testsuite/src/main/org/jboss/test/deployers/jbas4548/ejb/EntityPKBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/jbas4548/ejb/EntityPKBean.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/jbas4548/ejb/EntityPKBean.java	2007-08-18 21:10:55 UTC (rev 64686)
@@ -0,0 +1,144 @@
+/*
+  * 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.deployers.jbas4548.ejb;
+
+
+import javax.ejb.EntityBean;
+import javax.ejb.EntityContext;
+import javax.ejb.CreateException;
+import javax.ejb.RemoveException;
+
+import org.jboss.logging.Logger;
+
+/** Tests of the cluster cache invalidation framework.
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */ 
+public abstract class EntityPKBean implements EntityBean
+{
+   private static Logger log = Logger.getLogger(EntityPKBean.class);
+
+   private EntityContext entityContext;
+
+   public AComplexPK ejbCreate(boolean aBoolean, int anInt, long aLong,
+      double aDouble, String aString)
+      throws CreateException
+   {
+      log.debug("ejbCreate() called");
+      updateAllValues(new AComplexPK(aBoolean, anInt, aLong, aDouble, aString));
+      return null;
+   }
+
+   public AComplexPK ejbCreateMETHOD(boolean aBoolean, int anInt, long aLong,
+      double aDouble, String aString)
+      throws CreateException
+   {
+      log.debug("ejbCreateMETHOD() called");
+      updateAllValues(new AComplexPK(aBoolean, anInt, aLong, aDouble, aString));
+      return null;
+   }
+
+   public void ejbPostCreate(boolean aBoolean, int anInt, long aLong,
+      double aDouble, String aString)
+      throws CreateException
+   {
+      log.debug("ejbPostCreate(pk) called");
+   }
+
+   public void ejbPostCreateMETHOD(boolean aBoolean, int anInt, long aLong,
+      double aDouble, String aString)
+      throws CreateException
+   {
+      log.debug("ejbPostCreateMETHOD(pk) called");
+   }
+
+   public void ejbActivate()
+   {
+      log.debug("ejbActivate() called");
+   }
+
+   public void ejbLoad()
+   {
+      log.debug("ejbLoad() called");
+   }
+
+   public void ejbPassivate()
+   {
+      log.debug("ejbPassivate() called");
+   }
+
+   public void ejbRemove() throws RemoveException
+   {
+
+      log.debug("EntityPK.ejbRemove() called");
+   }
+   public void ejbStore()
+   {
+      log.debug("ejbStore() called");
+   }
+
+   public void setEntityContext(EntityContext context)
+   {
+      log.debug("setSessionContext() called");
+      entityContext = context;
+   }
+
+   public void unsetEntityContext()
+   {
+      log.debug("unsetSessionContext() called");
+      entityContext = null;
+   }
+
+   public void updateAllValues(AComplexPK aComplexPK)
+   {
+      setABoolean(aComplexPK.aBoolean);
+      setADouble(aComplexPK.aDouble);
+      setALong(aComplexPK.aLong);
+      setAnInt(aComplexPK.anInt);
+      setAString(aComplexPK.aString);
+   }
+
+   public AComplexPK readAllValues()
+   {
+      return new AComplexPK(getABoolean(), getAnInt(), getALong(), getADouble(),
+         getAString());
+   }
+
+   public abstract boolean getABoolean();
+   public abstract void setABoolean(boolean value);
+
+   public abstract double getADouble();
+   public abstract void setADouble(double value);
+
+   public abstract long getALong();
+   public abstract void setALong(long value);
+
+   public abstract int getAnInt();
+   public abstract void setAnInt(int value);
+
+   public abstract String getAString();
+   public abstract void setAString(String value);
+
+   public abstract int getOtherField();
+   public abstract void setOtherField(int newValue);
+
+}


Property changes on: trunk/testsuite/src/main/org/jboss/test/deployers/jbas4548/ejb/EntityPKBean.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + native

Added: trunk/testsuite/src/main/org/jboss/test/deployers/jbas4548/ejb/EntityPKHome.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/jbas4548/ejb/EntityPKHome.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/jbas4548/ejb/EntityPKHome.java	2007-08-18 21:10:55 UTC (rev 64686)
@@ -0,0 +1,48 @@
+/*
+  * 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.deployers.jbas4548.ejb;
+
+import java.util.Collection;
+import javax.ejb.EJBLocalHome;
+import javax.ejb.CreateException;
+import javax.ejb.FinderException;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */ 
+public interface EntityPKHome extends EJBLocalHome
+{
+    public EntityPK create(boolean aBoolean, int anInt, long aLong,
+       double aDouble, String aString)
+       throws CreateException;
+
+    public EntityPK createMETHOD(boolean aBoolean, int anInt, long aLong,
+       double aDouble, String aString)
+       throws CreateException;
+
+    public EntityPK findByPrimaryKey(AComplexPK acomplexPK)
+        throws FinderException;
+
+    public Collection findAll()
+        throws FinderException;
+}


Property changes on: trunk/testsuite/src/main/org/jboss/test/deployers/jbas4548/ejb/EntityPKHome.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + native




More information about the jboss-cvs-commits mailing list