[jboss-cvs] JBossAS SVN: r60440 - in branches/Branch_4_2/ejb3: src/test/org/jboss/ejb3/test/dependency and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Feb 8 16:58:20 EST 2007
Author: bdecoste
Date: 2007-02-08 16:58:20 -0500 (Thu, 08 Feb 2007)
New Revision: 60440
Added:
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/dependency/A.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/dependency/ABean.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/dependency/B.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/dependency/BBean.java
branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/dependency/unit/DeploymentUnitTestCase.java
Modified:
branches/Branch_4_2/ejb3/build-test.xml
Log:
fix and test for @Depends and @EJB on same field or method
Modified: branches/Branch_4_2/ejb3/build-test.xml
===================================================================
--- branches/Branch_4_2/ejb3/build-test.xml 2007-02-08 21:31:33 UTC (rev 60439)
+++ branches/Branch_4_2/ejb3/build-test.xml 2007-02-08 21:58:20 UTC (rev 60440)
@@ -55,10 +55,10 @@
<property file="local.properties"/>
<!-- Cluster node0 defaults -->
- <property name="node0" value="localhost" />
+ <property name="node0" value="${env.MYTESTIP_1}" />
<property name="node0.http.url" value="http://${node0}:8080" />
<property name="node0.jndi.url" value="jnp://${node0}:1099" />
- <property name="node1" value="${hostname}" />
+ <property name="node1" value="${env.MYTESTIP_2}" />
<property name="node1.http.url" value="http://${node1}:8080" />
<property name="node1.jndi.url" value="jnp://${node1}:1099" />
@@ -655,6 +655,22 @@
</fileset>
</jar>
+ <jar jarfile="${build.lib}/A.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/ejb3/test/dependency/ABean.class"/>
+ <include name="org/jboss/ejb3/test/dependency/A.class"/>
+ <include name="org/jboss/ejb3/test/dependency/B.class"/>
+ <!--exclude name="org/jboss/ejb3/test/dependency/Another*.class"/-->
+ </fileset>
+ </jar>
+
+ <jar jarfile="${build.lib}/B.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/ejb3/test/dependency/BBean.class"/>
+ <include name="org/jboss/ejb3/test/dependency/B.class"/>
+ </fileset>
+ </jar>
+
<jar jarfile="${build.lib}/ejbdepends.jar">
<fileset dir="${build.classes}">
<include name="org/jboss/ejb3/test/dependency/*2*.class"/>
@@ -2070,6 +2086,23 @@
</fileset>
</jar>
</target>
+
+ <target name="timestampentity"
+ description="Builds all jar files."
+ depends="compile-classes">
+
+ <mkdir dir="${build.lib}"/>
+
+ <jar jarfile="${build.lib}/timestampentity-test.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/ejb3/test/timestampentity/*.class"/>
+ <include name="org/jboss/ejb3/test/timestampentity/entity/*.class"/>
+ </fileset>
+ <fileset dir="${resources}/test/timestampentity">
+ <include name="META-INF/persistence.xml"/>
+ </fileset>
+ </jar>
+ </target>
<target name="mdbtransactions"
description="Builds all jar files."
@@ -2841,7 +2874,7 @@
</jar>
</target>
- <target name="jars" depends="arjuna, mdbtransactions, unauthenticatedprincipal, clusteredservice, invoker, classloader,
+ <target name="jars" depends="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,
securitydomain, enventry,
@@ -3013,7 +3046,7 @@
<jvmarg line="${jvmargs}" />
<classpath>
- <path refid="asm.asm.classpath"/>
+ <!--path refid="asm.asm.classpath"/-->
<path refid="hibernate.hibernate.classpath"/>
<pathelement location="${build.classes}"/>
<pathelement location="${resources}/test"/>
@@ -3325,9 +3358,9 @@
<antcall target="test" inheritRefs="true">
<param name="test" value="exception"/>
</antcall>
- <antcall target="test" inheritRefs="true">
+ <!--antcall target="test" inheritRefs="true">
<param name="test" value="microbench"/>
- </antcall>
+ </antcall-->
<antcall target="test" inheritRefs="true">
<param name="test" value="ejbthree712"/>
</antcall>
Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/dependency/A.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/dependency/A.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/dependency/A.java 2007-02-08 21:58:20 UTC (rev 60440)
@@ -0,0 +1,6 @@
+package org.jboss.ejb3.test.dependency;
+
+public interface A {
+
+ String getHelloB();
+}
Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/dependency/ABean.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/dependency/ABean.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/dependency/ABean.java 2007-02-08 21:58:20 UTC (rev 60440)
@@ -0,0 +1,23 @@
+package org.jboss.ejb3.test.dependency;
+
+import javax.ejb.EJB;
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+
+import org.jboss.annotation.ejb.Depends;
+import org.jboss.logging.Logger;
+
+ at Stateless(name="ejb/A")
+ at Remote(A.class)
+public class ABean implements A {
+
+ private static final Logger log = Logger.getLogger(ABean.class);
+
+ @Depends("jboss.j2ee:jar=B.jar,name=ejb/B,service=EJB3")
+ @EJB
+ private B bInstance;
+
+ public String getHelloB() {
+ return bInstance.sayHello();
+ }
+}
Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/dependency/B.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/dependency/B.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/dependency/B.java 2007-02-08 21:58:20 UTC (rev 60440)
@@ -0,0 +1,7 @@
+package org.jboss.ejb3.test.dependency;
+
+public interface B {
+
+ String sayHello();
+
+}
Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/dependency/BBean.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/dependency/BBean.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/dependency/BBean.java 2007-02-08 21:58:20 UTC (rev 60440)
@@ -0,0 +1,14 @@
+package org.jboss.ejb3.test.dependency;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+
+ at Stateless(name="ejb/B")
+ at Remote(B.class)
+public class BBean implements B {
+
+ public String sayHello() {
+ return "Hello";
+ }
+
+}
Added: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/dependency/unit/DeploymentUnitTestCase.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/dependency/unit/DeploymentUnitTestCase.java (rev 0)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/dependency/unit/DeploymentUnitTestCase.java 2007-02-08 21:58:20 UTC (rev 60440)
@@ -0,0 +1,54 @@
+/*
+ * 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.dependency.unit;
+
+import org.jboss.ejb3.test.dependency.A;
+import org.jboss.logging.Logger;
+import org.jboss.test.JBossTestCase;
+import junit.framework.Test;
+
+/**
+ * @version <tt>$Revision: 57207 $</tt>
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ */
+public class DeploymentUnitTestCase
+ extends JBossTestCase
+{
+ private static final Logger log = Logger.getLogger(DeploymentUnitTestCase.class);
+
+ public DeploymentUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testDependency() throws Exception
+ {
+ A bean = (A) getInitialContext().lookup("ejb/A/remote");
+ bean.getHelloB();
+ }
+
+ public static Test suite() throws Exception
+ {
+ return getDeploySetup(DeploymentUnitTestCase.class, "B.jar, A.jar");
+ }
+
+}
More information about the jboss-cvs-commits
mailing list