[jboss-cvs] JBossAS SVN: r61842 - in trunk/ejb3: src/resources/test and 5 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Mar 29 08:31:57 EDT 2007
Author: wolfc
Date: 2007-03-29 08:31:57 -0400 (Thu, 29 Mar 2007)
New Revision: 61842
Added:
trunk/ejb3/src/resources/test/ejbthree921/
trunk/ejb3/src/resources/test/ejbthree921/META-INF/
trunk/ejb3/src/resources/test/ejbthree921/META-INF/persistence.xml
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/ExplicitFailoverInterceptor.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/MyStateful.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/MyStatefulBean.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/Person.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/unit/
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/unit/PersistenceContextReplicationTestCase.java
Removed:
trunk/ejb3/src/resources/test/ejbthree921/META-INF/
trunk/ejb3/src/resources/test/ejbthree921/META-INF/persistence.xml
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/ExplicitFailoverInterceptor.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/MyStateful.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/MyStatefulBean.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/Person.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/unit/
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/unit/PersistenceContextReplicationTestCase.java
Modified:
trunk/ejb3/.classpath
trunk/ejb3/build-test.xml
Log:
EJBTHREE-921: unit test
Modified: trunk/ejb3/.classpath
===================================================================
--- trunk/ejb3/.classpath 2007-03-29 12:16:14 UTC (rev 61841)
+++ trunk/ejb3/.classpath 2007-03-29 12:31:57 UTC (rev 61842)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main"/>
+ <classpathentry excluding="org/jboss/ejb3/test/**/*EmbeddedTest.java|org/jboss/ejb3/test/clusteredentity/unit/|org/jboss/ejb3/test/clusteredservice/unit/|org/jboss/ejb3/test/clusteredsession/unit/|org/jboss/ejb3/test/ejbthree921/unit/" kind="src" path="src/test"/>
<classpathentry kind="src" path="/ejb3x"/>
<classpathentry kind="src" path="/j2ee"/>
<classpathentry kind="lib" path="/thirdparty/trove/lib/trove.jar"/>
Modified: trunk/ejb3/build-test.xml
===================================================================
--- trunk/ejb3/build-test.xml 2007-03-29 12:16:14 UTC (rev 61841)
+++ trunk/ejb3/build-test.xml 2007-03-29 12:31:57 UTC (rev 61842)
@@ -1846,6 +1846,20 @@
</jar>
</target>
+ <target name="ejbthree921"
+ description="Builds all jar files."
+ depends="compile-classes">
+
+ <mkdir dir="${build.lib}"/>
+
+ <jar jarfile="${build.lib}/ejbthree921.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/ejb3/test/ejbthree921/*.class"/>
+ </fileset>
+ <fileset dir="${resources}/test/ejbthree921"/>
+ </jar>
+ </target>
+
<target name="jaxws"
description="Builds a simple jar."
depends="compile-classes">
@@ -3151,7 +3165,8 @@
<target name="jars" depends="appclient, tck5sec, invalidtxmdb, descriptortypo, libdeployment, homeinterface, timestampentity, arjuna, mdbtransactions, unauthenticatedprincipal, clusteredservice, invoker, classloader,
circulardependency, jsp, timerdependency, servicedependency, servlet, stateless14, webservices, ear, ejbthree440,
- ejbthree454, ejbthree653, ejbthree670, ejbthree712, ejbthree751, aspectdomain, ejbcontext, schema, mail, scopedclassloader, dependency,
+ ejbthree454, ejbthree653, ejbthree670, ejbthree712, ejbthree751, ejbthree921,
+ aspectdomain, ejbcontext, schema, mail, scopedclassloader, dependency,
securitydomain, enventry,
jms/managed, naming, bmt, jca/inflowmdb, pool, jms, security, reference21_30, factory, dd/web, txexceptions,
exception, dd/override, stateless, standalone-jar, dd/mdb, bank, dd, longlived, xmlcfg, hbm, pkg, regressionHHH275,
@@ -4292,6 +4307,10 @@
value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=n,suspend=n"/>
-->
</antcall>
+ <antcall target="test-with-jvmargs" inheritRefs="true">
+ <param name="test" value="ejbthree921"/>
+ <param name="jvmargs" value=""/>
+ </antcall>
</target>
Copied: trunk/ejb3/src/resources/test/ejbthree921 (from rev 61832, branches/Branch_4_2/ejb3/src/resources/test/ejbthree921)
Copied: trunk/ejb3/src/resources/test/ejbthree921/META-INF (from rev 61832, branches/Branch_4_2/ejb3/src/resources/test/ejbthree921/META-INF)
Deleted: trunk/ejb3/src/resources/test/ejbthree921/META-INF/persistence.xml
===================================================================
--- branches/Branch_4_2/ejb3/src/resources/test/ejbthree921/META-INF/persistence.xml 2007-03-29 09:59:29 UTC (rev 61832)
+++ trunk/ejb3/src/resources/test/ejbthree921/META-INF/persistence.xml 2007-03-29 12:31:57 UTC (rev 61842)
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<persistence>
- <persistence-unit name="tempdb" transaction-type="JTA">
- <jta-data-source>java:/DefaultDS</jta-data-source>
- <properties>
- <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
- </properties>
- </persistence-unit>
-</persistence>
Copied: trunk/ejb3/src/resources/test/ejbthree921/META-INF/persistence.xml (from rev 61832, branches/Branch_4_2/ejb3/src/resources/test/ejbthree921/META-INF/persistence.xml)
===================================================================
--- trunk/ejb3/src/resources/test/ejbthree921/META-INF/persistence.xml (rev 0)
+++ trunk/ejb3/src/resources/test/ejbthree921/META-INF/persistence.xml 2007-03-29 12:31:57 UTC (rev 61842)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence>
+ <persistence-unit name="tempdb" transaction-type="JTA">
+ <jta-data-source>java:/DefaultDS</jta-data-source>
+ <properties>
+ <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+ </properties>
+ </persistence-unit>
+</persistence>
Copied: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921 (from rev 61832, branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree921)
Deleted: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/ExplicitFailoverInterceptor.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/ExplicitFailoverInterceptor.java 2007-03-29 09:59:29 UTC (rev 61832)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/ExplicitFailoverInterceptor.java 2007-03-29 12:31:57 UTC (rev 61842)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-
-package org.jboss.ejb3.test.ejbthree921;
-
-import org.jboss.ha.framework.interfaces.GenericClusteringException;
-import org.jboss.logging.Logger;
-
-import javax.interceptor.AroundInvoke;
-import javax.interceptor.InvocationContext;
-
-/**
- * Used for testing clustering: allows to explicitly makes a call to node fail
- * This will mimic a dead server. This is used as a ejb3 interceptor now.
- * @author Ben Wang
- *
- */
-public class ExplicitFailoverInterceptor
-{
- private Logger log = Logger.getLogger(ExplicitFailoverInterceptor.class);
-
- @AroundInvoke
- public Object invoke(InvocationContext ctx)
- throws Exception
- {
- checkFailoverNeed (ctx);
- return ctx.proceed();
- }
-
- protected void checkFailoverNeed (InvocationContext ctx)
- throws Exception
- {
- if(ctx.getMethod().getName().equals("setUpFailover"))
- {
- return;
- }
-
- String failover = (String)System.getProperty ("JBossCluster-DoFail");
- boolean doFail = false;
-
- if (failover != null)
- {
- String strFailover = failover;
- if (strFailover.equalsIgnoreCase ("true"))
- {
- doFail = true;
- }
- else if (strFailover.equalsIgnoreCase ("once"))
- {
- doFail = true;
- System.setProperty ("JBossCluster-DoFail", "false");
- }
- }
-
- if (doFail)
- {
- GenericClusteringException e = new GenericClusteringException
- (GenericClusteringException.COMPLETED_NO, "Test failover from ejb interceptor", false);
-
- log.debug ("WE FAILOVER IN EJB INTERCEPTOR (explicit failover)!", e);
-
- throw e;
- }
- }
-}
Copied: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/ExplicitFailoverInterceptor.java (from rev 61832, branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/ExplicitFailoverInterceptor.java)
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/ExplicitFailoverInterceptor.java (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/ExplicitFailoverInterceptor.java 2007-03-29 12:31:57 UTC (rev 61842)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+
+package org.jboss.ejb3.test.ejbthree921;
+
+import org.jboss.ha.framework.interfaces.GenericClusteringException;
+import org.jboss.logging.Logger;
+
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+/**
+ * Used for testing clustering: allows to explicitly makes a call to node fail
+ * This will mimic a dead server. This is used as a ejb3 interceptor now.
+ * @author Ben Wang
+ *
+ */
+public class ExplicitFailoverInterceptor
+{
+ private Logger log = Logger.getLogger(ExplicitFailoverInterceptor.class);
+
+ @AroundInvoke
+ public Object invoke(InvocationContext ctx)
+ throws Exception
+ {
+ checkFailoverNeed (ctx);
+ return ctx.proceed();
+ }
+
+ protected void checkFailoverNeed (InvocationContext ctx)
+ throws Exception
+ {
+ if(ctx.getMethod().getName().equals("setUpFailover"))
+ {
+ return;
+ }
+
+ String failover = (String)System.getProperty ("JBossCluster-DoFail");
+ boolean doFail = false;
+
+ if (failover != null)
+ {
+ String strFailover = failover;
+ if (strFailover.equalsIgnoreCase ("true"))
+ {
+ doFail = true;
+ }
+ else if (strFailover.equalsIgnoreCase ("once"))
+ {
+ doFail = true;
+ System.setProperty ("JBossCluster-DoFail", "false");
+ }
+ }
+
+ if (doFail)
+ {
+ GenericClusteringException e = new GenericClusteringException
+ (GenericClusteringException.COMPLETED_NO, "Test failover from ejb interceptor", false);
+
+ log.debug ("WE FAILOVER IN EJB INTERCEPTOR (explicit failover)!", e);
+
+ throw e;
+ }
+ }
+}
Deleted: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/MyStateful.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/MyStateful.java 2007-03-29 09:59:29 UTC (rev 61832)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/MyStateful.java 2007-03-29 12:31:57 UTC (rev 61842)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2007, 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.ejbthree921;
-
-/**
- * @author carlo
- *
- */
-public interface MyStateful
-{
-
- void done();
-
- String getDescription();
-
- void remove(Person p);
-
- void save(Person p);
-
- void setDescription(String s);
-
- void setUpFailover(String failover);
-
- Person update(Person p);
-
-}
Copied: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/MyStateful.java (from rev 61832, branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/MyStateful.java)
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/MyStateful.java (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/MyStateful.java 2007-03-29 12:31:57 UTC (rev 61842)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, 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.ejbthree921;
+
+/**
+ * @author carlo
+ *
+ */
+public interface MyStateful
+{
+
+ void done();
+
+ String getDescription();
+
+ void remove(Person p);
+
+ void save(Person p);
+
+ void setDescription(String s);
+
+ void setUpFailover(String failover);
+
+ Person update(Person p);
+
+}
Deleted: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/MyStatefulBean.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/MyStatefulBean.java 2007-03-29 09:59:29 UTC (rev 61832)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/MyStatefulBean.java 2007-03-29 12:31:57 UTC (rev 61842)
@@ -1,104 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2007, 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.ejbthree921;
-
-import javax.ejb.PostActivate;
-import javax.ejb.PrePassivate;
-import javax.ejb.Remote;
-import javax.ejb.Remove;
-import javax.ejb.Stateful;
-import javax.interceptor.Interceptors;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
-
-import org.jboss.annotation.ejb.Clustered;
-import org.jboss.annotation.ejb.cache.tree.CacheConfig;
-import org.jboss.logging.Logger;
-
-/**
- * @author carlo
- *
- */
- at Clustered
- at Stateful
- at Remote(MyStateful.class)
- at Interceptors({ExplicitFailoverInterceptor.class})
-public class MyStatefulBean implements MyStateful
-{
- private static final Logger log = Logger.getLogger(MyStatefulBean.class);
-
- @PersistenceContext(type=PersistenceContextType.EXTENDED)
- private EntityManager em;
-
- private String description;
-
- @Remove
- public void done()
- {
-
- }
-
- public String getDescription()
- {
- return description;
- }
-
- @PostActivate
- protected void postActivate()
- {
- log.info("postActivate");
- }
-
- @PrePassivate
- protected void prePassivate()
- {
- log.info("prePassivate");
- }
-
- public void remove(Person p)
- {
- em.remove(p);
- }
-
- public void save(Person p)
- {
- em.persist(p);
- }
-
- public void setDescription(String s)
- {
- this.description = s;
- }
-
- public void setUpFailover(String failover)
- {
- // To setup the failover property
- log.info("Setting up failover property: " +failover);
- System.setProperty ("JBossCluster-DoFail", failover);
- }
-
- public Person update(Person p)
- {
- return em.merge(p);
- }
-}
Copied: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/MyStatefulBean.java (from rev 61832, branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/MyStatefulBean.java)
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/MyStatefulBean.java (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/MyStatefulBean.java 2007-03-29 12:31:57 UTC (rev 61842)
@@ -0,0 +1,104 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, 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.ejbthree921;
+
+import javax.ejb.PostActivate;
+import javax.ejb.PrePassivate;
+import javax.ejb.Remote;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.interceptor.Interceptors;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+
+import org.jboss.annotation.ejb.Clustered;
+import org.jboss.annotation.ejb.cache.tree.CacheConfig;
+import org.jboss.logging.Logger;
+
+/**
+ * @author carlo
+ *
+ */
+ at Clustered
+ at Stateful
+ at Remote(MyStateful.class)
+ at Interceptors({ExplicitFailoverInterceptor.class})
+public class MyStatefulBean implements MyStateful
+{
+ private static final Logger log = Logger.getLogger(MyStatefulBean.class);
+
+ @PersistenceContext(type=PersistenceContextType.EXTENDED)
+ private EntityManager em;
+
+ private String description;
+
+ @Remove
+ public void done()
+ {
+
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ @PostActivate
+ protected void postActivate()
+ {
+ log.info("postActivate");
+ }
+
+ @PrePassivate
+ protected void prePassivate()
+ {
+ log.info("prePassivate");
+ }
+
+ public void remove(Person p)
+ {
+ em.remove(p);
+ }
+
+ public void save(Person p)
+ {
+ em.persist(p);
+ }
+
+ public void setDescription(String s)
+ {
+ this.description = s;
+ }
+
+ public void setUpFailover(String failover)
+ {
+ // To setup the failover property
+ log.info("Setting up failover property: " +failover);
+ System.setProperty ("JBossCluster-DoFail", failover);
+ }
+
+ public Person update(Person p)
+ {
+ return em.merge(p);
+ }
+}
Deleted: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/Person.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/Person.java 2007-03-29 09:59:29 UTC (rev 61832)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/Person.java 2007-03-29 12:31:57 UTC (rev 61842)
@@ -1,74 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2007, 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.ejbthree921;
-
-import java.io.Serializable;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-
-/**
- * @author carlo
- *
- */
- at Entity
-public class Person implements Serializable
-{
- private static final long serialVersionUID = 1272038160166897327L;
-
- private Long id;
- private String name;
-
- public Person()
- {
-
- }
-
- public Person(String name)
- {
- this.name = name;
- }
-
- @Id
- @GeneratedValue(strategy= GenerationType.AUTO)
- public Long getId()
- {
- return id;
- }
-
- public void setId(Long id)
- {
- this.id = id;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-}
Copied: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/Person.java (from rev 61832, branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/Person.java)
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/Person.java (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/Person.java 2007-03-29 12:31:57 UTC (rev 61842)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, 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.ejbthree921;
+
+import java.io.Serializable;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+/**
+ * @author carlo
+ *
+ */
+ at Entity
+public class Person implements Serializable
+{
+ private static final long serialVersionUID = 1272038160166897327L;
+
+ private Long id;
+ private String name;
+
+ public Person()
+ {
+
+ }
+
+ public Person(String name)
+ {
+ this.name = name;
+ }
+
+ @Id
+ @GeneratedValue(strategy= GenerationType.AUTO)
+ public Long getId()
+ {
+ return id;
+ }
+
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+}
Copied: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/unit (from rev 61832, branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/unit)
Deleted: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/unit/PersistenceContextReplicationTestCase.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/unit/PersistenceContextReplicationTestCase.java 2007-03-29 09:59:29 UTC (rev 61832)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/unit/PersistenceContextReplicationTestCase.java 2007-03-29 12:31:57 UTC (rev 61842)
@@ -1,88 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, 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.ejb3.test.ejbthree921.unit;
-
-import java.util.Properties;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
-import junit.framework.Test;
-
-import org.jboss.ejb3.test.ejbthree921.MyStateful;
-import org.jboss.ejb3.test.ejbthree921.Person;
-import org.jboss.test.JBossTestCase;
-
-import org.jboss.test.JBossClusteredTestCase;
-
-/**
- * Comment
- *
- * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
-public class PersistenceContextReplicationTestCase extends JBossClusteredTestCase
-{
-
- public PersistenceContextReplicationTestCase(String name)
- {
- super(name);
- }
-
- protected InitialContext getInitialContext(int node) throws Exception {
- // Connect to the server0 JNDI
- String[] urls = getNamingURLs();
- Properties env1 = new Properties();
- env1.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
- env1.setProperty(Context.PROVIDER_URL, urls[node]);
- return new InitialContext(env1);
- }
-
- public void test1() throws Exception
- {
- MyStateful stateful = (MyStateful) getInitialContext(0).lookup("MyStatefulBean/remote");
- Person p = new Person("Brian");
- stateful.save(p);
- String expected = "Changing SFSB state";
- stateful.setDescription(expected);
- stateful.setUpFailover("once");
- try
- {
- String actual = stateful.getDescription();
- assertEquals(expected, actual);
- }
- catch(Exception e)
- {
- Throwable cause = e;
- while(cause.getCause() != null) cause = cause.getCause();
- throw (Exception) cause;
- }
- stateful.remove(p);
- stateful.done();
- }
-
- public static Test suite() throws Exception
- {
- return getDeploySetup(PersistenceContextReplicationTestCase.class, "ejbthree921.jar");
- }
-
-}
Copied: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/unit/PersistenceContextReplicationTestCase.java (from rev 61832, branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/unit/PersistenceContextReplicationTestCase.java)
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/unit/PersistenceContextReplicationTestCase.java (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree921/unit/PersistenceContextReplicationTestCase.java 2007-03-29 12:31:57 UTC (rev 61842)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, 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.ejb3.test.ejbthree921.unit;
+
+import java.util.Properties;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.test.ejbthree921.MyStateful;
+import org.jboss.ejb3.test.ejbthree921.Person;
+import org.jboss.test.JBossTestCase;
+
+import org.jboss.test.JBossClusteredTestCase;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class PersistenceContextReplicationTestCase extends JBossClusteredTestCase
+{
+
+ public PersistenceContextReplicationTestCase(String name)
+ {
+ super(name);
+ }
+
+ protected InitialContext getInitialContext(int node) throws Exception {
+ // Connect to the server0 JNDI
+ String[] urls = getNamingURLs();
+ Properties env1 = new Properties();
+ env1.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
+ env1.setProperty(Context.PROVIDER_URL, urls[node]);
+ return new InitialContext(env1);
+ }
+
+ public void test1() throws Exception
+ {
+ MyStateful stateful = (MyStateful) getInitialContext(0).lookup("MyStatefulBean/remote");
+ Person p = new Person("Brian");
+ stateful.save(p);
+ String expected = "Changing SFSB state";
+ stateful.setDescription(expected);
+ stateful.setUpFailover("once");
+ try
+ {
+ String actual = stateful.getDescription();
+ assertEquals(expected, actual);
+ }
+ catch(Exception e)
+ {
+ Throwable cause = e;
+ while(cause.getCause() != null) cause = cause.getCause();
+ throw (Exception) cause;
+ }
+ stateful.remove(p);
+ stateful.done();
+ }
+
+ public static Test suite() throws Exception
+ {
+ return getDeploySetup(PersistenceContextReplicationTestCase.class, "ejbthree921.jar");
+ }
+
+}
More information about the jboss-cvs-commits
mailing list