[jboss-cvs] JBossAS SVN: r63033 - in branches/Branch_4_2/ejb3: src/resources/test and 5 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon May 14 10:29:10 EDT 2007
Author: wolfc
Date: 2007-05-14 10:29:10 -0400 (Mon, 14 May 2007)
New Revision: 63033
Added:
branches/Branch_4_2/ejb3/src/resources/test/ejbthree724/
branches/Branch_4_2/ejb3/src/resources/test/ejbthree724/META-INF/
branches/Branch_4_2/ejb3/src/resources/test/ejbthree724/META-INF/application.xml
branches/Branch_4_2/ejb3/src/resources/test/ejbthree724/META-INF/persistence.xml
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree724/
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree724/MyStateless.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree724/MyStatelessBean.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree724/Person.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree724/unit/
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree724/unit/RelativeJarFileUnitTestCase.java
Modified:
branches/Branch_4_2/ejb3/build-test.xml
Log:
EJBTHREE-724: unit test
Modified: branches/Branch_4_2/ejb3/build-test.xml
===================================================================
--- branches/Branch_4_2/ejb3/build-test.xml 2007-05-14 11:09:16 UTC (rev 63032)
+++ branches/Branch_4_2/ejb3/build-test.xml 2007-05-14 14:29:10 UTC (rev 63033)
@@ -1736,6 +1736,30 @@
</jar>
</target>
+ <target name="ejbthree724"
+ description="Builds all jar files."
+ depends="compile-classes">
+
+ <mkdir dir="${build.lib}"/>
+
+ <jar jarfile="${build.lib}/ejbthree724-persistence.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/ejb3/test/ejbthree724/Person.class"/>
+ </fileset>
+ </jar>
+
+ <jar jarfile="${build.lib}/ejbthree724-session.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/ejb3/test/ejbthree724/MyStateless*.class"/>
+ </fileset>
+ <zipfileset dir="${build.resources}/test/ejbthree724" includes="META-INF/persistence.xml"/>
+ </jar>
+
+ <ear earfile="${build.lib}/ejbthree724.ear" appxml="${build.resources}/test/ejbthree724/META-INF/application.xml">
+ <fileset dir="${build.lib}" includes="ejbthree724-*.jar"/>
+ </ear>
+ </target>
+
<target name="ejbthree751"
description="Builds all jar files."
depends="compile-classes">
@@ -3142,7 +3166,7 @@
<target name="jars" depends="propertyreplacement, persistenceunits, invalidtxmdb, descriptortypo, libdeployment, homeinterface, timestampentity, servicexmbean, arjuna, mdbtransactions, unauthenticatedprincipal, clusteredservice, invoker, classloader,
circulardependency, jsp, timerdependency, servicedependency, servlet, stateless14, webservices, ear, ejbthree440,
- ejbthree454, ejbthree653, ejbthree670, ejbthree712, ejbthree751, ejbthree832, ejbthree921,
+ ejbthree454, ejbthree653, ejbthree670, ejbthree712, ejbthree724, ejbthree751, ejbthree832, ejbthree921,
aspectdomain, ejbcontext, schema, mail, scopedclassloader, dependency, jaxws,
pkg, securitydomain, enventry,
jms/managed, naming, bmt, jca/inflowmdb, pool, jms, security, reference21_30, factory, dd/web, txexceptions,
@@ -3655,6 +3679,9 @@
<param name="test" value="ejbthree712"/>
</antcall>
<antcall target="test" inheritRefs="true">
+ <param name="test" value="ejbthree724"/>
+ </antcall>
+ <antcall target="test" inheritRefs="true">
<param name="test" value="ejbthree751"/>
</antcall>
<antcall target="test" inheritRefs="true">
Added: branches/Branch_4_2/ejb3/src/resources/test/ejbthree724/META-INF/application.xml
===================================================================
--- branches/Branch_4_2/ejb3/src/resources/test/ejbthree724/META-INF/application.xml (rev 0)
+++ branches/Branch_4_2/ejb3/src/resources/test/ejbthree724/META-INF/application.xml 2007-05-14 14:29:10 UTC (rev 63033)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE application PUBLIC
+ "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
+ "http://java.sun.com/dtd/application_1_3.dtd">
+
+<application>
+ <display-name>EJBTHREE-724 Test</display-name>
+
+ <module>
+ <java>ejbthree724-persistence.jar</java>
+ </module>
+ <module>
+ <ejb>ejbthree724-session.jar</ejb>
+ </module>
+</application>
Added: branches/Branch_4_2/ejb3/src/resources/test/ejbthree724/META-INF/persistence.xml
===================================================================
--- branches/Branch_4_2/ejb3/src/resources/test/ejbthree724/META-INF/persistence.xml (rev 0)
+++ branches/Branch_4_2/ejb3/src/resources/test/ejbthree724/META-INF/persistence.xml 2007-05-14 14:29:10 UTC (rev 63033)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence>
+ <persistence-unit name="manager1">
+ <jta-data-source>java:/DefaultDS</jta-data-source>
+ <jar-file>ejbthree724-persistence.jar</jar-file>
+ <properties>
+ <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+ </properties>
+ </persistence-unit>
+</persistence>
Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree724/MyStateless.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree724/MyStateless.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree724/MyStateless.java 2007-05-14 14:29:10 UTC (rev 63033)
@@ -0,0 +1,31 @@
+/*
+ * 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.ejbthree724;
+
+/**
+ * @author carlo
+ *
+ */
+public interface MyStateless
+{
+ long save(Person p);
+}
Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree724/MyStatelessBean.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree724/MyStatelessBean.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree724/MyStatelessBean.java 2007-05-14 14:29:10 UTC (rev 63033)
@@ -0,0 +1,45 @@
+/*
+ * 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.ejbthree724;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+/**
+ * @author carlo
+ *
+ */
+ at Stateless
+ at Remote(MyStateless.class)
+public class MyStatelessBean implements MyStateless
+{
+ @PersistenceContext
+ private EntityManager em;
+
+ public long save(Person p)
+ {
+ em.persist(p);
+ return p.getId();
+ }
+}
Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree724/Person.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree724/Person.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree724/Person.java 2007-05-14 14:29:10 UTC (rev 63033)
@@ -0,0 +1,74 @@
+/*
+ * 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.ejbthree724;
+
+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 = 1L;
+
+ 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;
+ }
+}
Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree724/unit/RelativeJarFileUnitTestCase.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree724/unit/RelativeJarFileUnitTestCase.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/ejbthree724/unit/RelativeJarFileUnitTestCase.java 2007-05-14 14:29:10 UTC (rev 63033)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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.ejbthree724.unit;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.test.ejbthree724.MyStateless;
+import org.jboss.ejb3.test.ejbthree724.Person;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Jar files should be found relative of the root of the persistence unit. (EJB3 Persistence 6.2.1.6)
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class RelativeJarFileUnitTestCase extends JBossTestCase
+{
+
+ public RelativeJarFileUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testRelativeJarFileBeanAccess() throws Exception
+ {
+ Person p = new Person("Heiko");
+
+ MyStateless bean = (MyStateless) getInitialContext().lookup("ejbthree724/MyStatelessBean/remote");
+
+ bean.save(p);
+ }
+
+ public static Test suite() throws Exception
+ {
+ return getDeploySetup(RelativeJarFileUnitTestCase.class, "ejbthree724.ear");
+ }
+}
More information about the jboss-cvs-commits
mailing list