[jboss-cvs] JBossAS SVN: r72733 - in trunk/testsuite: src/main/org/jboss/test/refs and 12 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Apr 25 10:33:41 EDT 2008
Author: scott.stark at jboss.org
Date: 2008-04-25 10:33:41 -0400 (Fri, 25 Apr 2008)
New Revision: 72733
Added:
trunk/testsuite/src/main/org/jboss/test/refs/clientorb/
trunk/testsuite/src/main/org/jboss/test/refs/clientorb/Client.java
trunk/testsuite/src/main/org/jboss/test/refs/resources/
trunk/testsuite/src/main/org/jboss/test/refs/resources/ResourceBase.java
trunk/testsuite/src/main/org/jboss/test/refs/resources/ResourceIF.java
trunk/testsuite/src/main/org/jboss/test/refs/resources/ResourceOnFieldBean.java
trunk/testsuite/src/main/org/jboss/test/refs/resources/ResourceOnMethodBean.java
trunk/testsuite/src/main/org/jboss/test/refs/resources/ResourcesOnClassBean.java
trunk/testsuite/src/main/org/jboss/test/refs/test/MappedResolverUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/refs/test/ResourceResolutionUnitTestCase.java
trunk/testsuite/src/resources/refs/ejblink/one/
trunk/testsuite/src/resources/refs/ejblink/one/ejb-jar.xml
trunk/testsuite/src/resources/refs/ejblink/one/jboss.xml
trunk/testsuite/src/resources/refs/ejblink/two/
trunk/testsuite/src/resources/refs/ejblink/two/ejb-jar.xml
trunk/testsuite/src/resources/refs/ejblink/two/jboss.xml
trunk/testsuite/src/resources/refs/resources/
trunk/testsuite/src/resources/refs/resources/jboss.xml
Removed:
trunk/testsuite/src/resources/refs/ejblink/one_ejb.xml
trunk/testsuite/src/resources/refs/ejblink/one_jboss.xml
trunk/testsuite/src/resources/refs/ejblink/two_ejb.xml
trunk/testsuite/src/resources/refs/ejblink/two_jboss.xml
Modified:
trunk/testsuite/imports/sections/refs.xml
trunk/testsuite/src/main/org/jboss/test/refs/client/Client.java
trunk/testsuite/src/main/org/jboss/test/refs/ejbs2/StatelessBean2.java
trunk/testsuite/src/main/org/jboss/test/refs/ejbs2x/interfaces/SessionHome.java
trunk/testsuite/src/main/org/jboss/test/refs/test/CircularRefResolutionUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/refs/test/RefResolutionUnitTestCase.java
trunk/testsuite/src/resources/refs/ejb2x/jboss.xml
Log:
Resource resolution tests
Modified: trunk/testsuite/imports/sections/refs.xml
===================================================================
--- trunk/testsuite/imports/sections/refs.xml 2008-04-25 14:30:58 UTC (rev 72732)
+++ trunk/testsuite/imports/sections/refs.xml 2008-04-25 14:33:41 UTC (rev 72733)
@@ -1,48 +1,113 @@
-<project name="tests-refs-jars">
- <target name="_jars-refs">
- <mkdir dir="${build.lib}"/>
+<project name="tests-refs-jars">
+ <target name="_jars-refs">
+ <mkdir dir="${build.lib}" />
- <jar destfile="${build.lib}/refs-client.jar">
- <manifest>
- <attribute name="Main-Class" value="org.jboss.test.refs.client.Client"/>
- </manifest>
- <!--
+ <jar destfile="${build.lib}/refs-client.jar">
+ <manifest>
+ <attribute name="Main-Class" value="org.jboss.test.refs.client.Client" />
+ </manifest>
+ <!--
<metainf dir="${build.resources}/refs">
<include name="jboss-client.xml"/>
</metainf>
-->
- <fileset dir="${build.classes}">
- <include name="org/jboss/test/refs/client/**"/>
- </fileset>
- </jar>
- <!-- A collection of ejb3 beans -->
- <jar destfile="${build.lib}/refs-ejb.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/refs/client/**" />
+ </fileset>
+ </jar>
+ <jar destfile="${build.lib}/refs-clientorb.jar">
+ <manifest>
+ <attribute name="Main-Class" value="org.jboss.test.refs.clientorb.Client" />
+ </manifest>
<fileset dir="${build.classes}">
- <include name="org/jboss/test/refs/ejbs/**"/>
+ <include name="org/jboss/test/refs/clientorb/**" />
</fileset>
+ </jar>
+
+ <!-- A collection of ejb3 beans -->
+ <jar destfile="${build.lib}/refs-ejb.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/refs/ejbs/**" />
+ </fileset>
</jar>
<!-- A collection of ejb3 beans referencing refs-ejb.jar beans -->
<jar destfile="${build.lib}/refs-ejb2.jar">
- <fileset dir="${build.classes}">
- <include name="org/jboss/test/refs/ejbs2/**"/>
- </fileset>
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/refs/ejbs2/**" />
+ </fileset>
</jar>
<!-- A collection of ejb2.1 beans with inter-jar refs -->
<jar destfile="${build.lib}/refs-ejb2x.jar">
- <metainf dir="${build.resources}/refs/ejb2x">
- <include name="*.xml"/>
- </metainf>
- <fileset dir="${build.classes}">
- <include name="org/jboss/test/refs/ejbs2x/**"/>
- </fileset>
+ <metainf dir="${build.resources}/refs/ejb2x">
+ <include name="*.xml" />
+ </metainf>
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/refs/ejbs2x/**" />
+ </fileset>
</jar>
- <jar destfile="${build.lib}/refs.ear">
+ <jar destfile="${build.lib}/refs-test-debug.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/util/Debug*.class" />
+ </fileset>
+ </jar>
+ <!-- A collection of ejb3 beans validating all resource types -->
+ <jar destfile="${build.lib}/refs-resources-ejb.jar">
+ <metainf dir="${build.resources}/refs/resources">
+ <include name="*.xml" />
+ </metainf>
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/refs/resources/**" />
+ </fileset>
+ </jar>
+
+ <jar destfile="${build.lib}/refs.ear">
+ <fileset dir="${build.lib}">
+ <include name="refs-client.jar" />
+ <include name="refs-ejb.jar" />
+ <include name="refs-ejb2.jar" />
+ <include name="refs-ejb2x.jar" />
+ </fileset>
+ <zipfileset file="${build.lib}/refs-test-debug.jar"
+ fullpath="lib/refs-test-debug.jar" />
+ </jar>
+
+ <jar destfile="${build.lib}/refs-resources.ear">
<fileset dir="${build.lib}">
- <include name="refs-client.jar" />
- <include name="refs-ejb.jar" />
- <include name="refs-ejb2.jar" />
- <include name="refs-ejb2x.jar" />
+ <include name="refs-clientorb.jar" />
+ <include name="refs-resources-ejb.jar" />
</fileset>
- </jar>
- </target>
+ <zipfileset file="${build.lib}/refs-test-debug.jar"
+ fullpath="lib/refs-test-debug.jar" />
+ </jar>
+
+ <!-- refs-one-ejb.jar -->
+ <jar destfile="${build.lib}/refs-one-ejb.jar">
+ <metainf dir="${build.resources}/refs/ejblink/one">
+ <include name="*.xml" />
+ </metainf>
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/refs/common/**" />
+ <include name="org/jboss/test/refs/ejblink/EjbLink1Bean*" />
+ </fileset>
+ </jar>
+ <!-- refs-two-ejb.jar -->
+ <jar destfile="${build.lib}/refs-two-ejb.jar">
+ <metainf dir="${build.resources}/refs/ejblink/two">
+ <include name="*.xml" />
+ </metainf>
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/refs/common/**" />
+ <include name="org/jboss/test/refs/ejblink/EjbLink2Bean*" />
+ <include name="org/jboss/test/refs/ejblink/EjbLink3Bean*" />
+ </fileset>
+ </jar>
+ <!-- refs-ejb3-ejblink.ear -->
+ <jar destfile="${build.lib}/refs-ejb3-ejblink.ear">
+ <fileset dir="${build.lib}">
+ <include name="refs-one-ejb.jar" />
+ <include name="refs-two-ejb.jar" />
+ <include name="refs-ejblink-client.jar" />
+ </fileset>
+ </jar>
+ </target>
</project>
Modified: trunk/testsuite/src/main/org/jboss/test/refs/client/Client.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/refs/client/Client.java 2008-04-25 14:30:58 UTC (rev 72732)
+++ trunk/testsuite/src/main/org/jboss/test/refs/client/Client.java 2008-04-25 14:33:41 UTC (rev 72733)
@@ -74,15 +74,8 @@
public void test1() throws Exception
{
log.info("Begin test1");
- try
- {
- statefulBean.init(props);
- statefulBean.test1();
- }
- catch (Exception e)
- {
- log.info("", e);
- }
+ statefulBean.init(props);
+ statefulBean.test1();
}
public void test2() throws Exception
{
Added: trunk/testsuite/src/main/org/jboss/test/refs/clientorb/Client.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/refs/clientorb/Client.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/refs/clientorb/Client.java 2008-04-25 14:33:41 UTC (rev 72733)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * 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.refs.clientorb;
+
+import javax.annotation.Resource;
+import javax.ejb.EJB;
+
+import org.jboss.test.refs.common.ServiceLocator;
+import org.jboss.test.refs.resources.ResourceIF;
+import org.omg.CORBA.ORB;
+
+/**
+ * Annotation only client with ORB injection
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class Client
+{
+ @EJB(beanName = "ResourceOnMethodBean")
+ private static ResourceIF resourceMethodBean;
+
+ @EJB(beanName = "ResourceOnFieldBean")
+ private static ResourceIF resourceFieldBean;
+
+ @EJB(beanName = "ResourcesOnClassBean")
+ private static ResourceIF resourceClassBean;
+
+ @Resource
+ private static ORB orb;
+
+ protected ResourceIF getResourceOnMethodBean()
+ {
+ return resourceMethodBean;
+ }
+
+ protected ResourceIF getResourceOnFieldBean()
+ {
+ return resourceFieldBean;
+ }
+
+ protected ResourceIF getResourcesOnClassBean()
+ {
+ return resourceClassBean;
+ }
+
+ public static void main(String[] args)
+ throws Exception
+ {
+ Client client = new Client();
+ client.clientOrbTest();
+ }
+
+ public void clientOrbTest() throws Exception
+ {
+ if (orb == null)
+ {
+ throw new Exception("orb is not injected");
+ }
+ System.out.print("ORB is injected: "+orb);
+ ORB orb2 = (ORB) ServiceLocator.lookup("java:comp/ORB");
+ if (orb2 == null)
+ {
+ throw new Exception("java:comp/ORB lookup is null");
+ }
+ }
+
+}
Modified: trunk/testsuite/src/main/org/jboss/test/refs/ejbs2/StatelessBean2.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/refs/ejbs2/StatelessBean2.java 2008-04-25 14:30:58 UTC (rev 72732)
+++ trunk/testsuite/src/main/org/jboss/test/refs/ejbs2/StatelessBean2.java 2008-04-25 14:33:41 UTC (rev 72733)
@@ -28,12 +28,14 @@
import javax.ejb.Stateless;
import javax.naming.Context;
import javax.naming.InitialContext;
+import javax.naming.NameNotFoundException;
import org.jboss.test.refs.ejbs.StatelessIF;
import org.jboss.test.refs.ejbs.StatelessIFExt;
+import org.jboss.test.util.Debug;
/**
- *
+ * A stateless bean that references beans in other deployments
* @author Scott.Stark at jboss.org
* @version $Revision$
*/
@@ -50,7 +52,7 @@
StatelessIF bean3;
@EJB(beanInterface=StatelessIFExt.class, beanName="StatelessBean")
StatelessIF bean4;
- @EJB(beanInterface=StatelessIFExt.class, beanName="StatelessBean#refs-ejb.jar")
+ @EJB(beanInterface=StatelessIFExt.class, beanName="refs-ejb.jar#StatelessBean")
StatelessIF bean5;
public void validate()
@@ -62,23 +64,76 @@
throw new IllegalStateException("bean2 is null");
if(bean3 == null)
throw new IllegalStateException("bean3 is null");
+ if((bean3 instanceof StatelessIFExt) == false)
+ throw new IllegalStateException("bean3 is not a StatelessIFExt");
+ if(bean4 == null)
+ throw new IllegalStateException("bean4 is null");
+ if(bean5 == null)
+ throw new IllegalStateException("bean5 is null");
validateENCLookup();
+ validateSessionContextLookup();
}
private void validateSessionContextLookup()
{
if(ctx == null)
throw new IllegalStateException("SessionContext is null");
- StatelessIF bean = (StatelessIF) ctx.lookup("bean1");
- if(bean == null)
- throw new IllegalStateException("SessionContext.lookup(bean1) is null");
+ for(int n = 1; n <= 5; n ++)
+ {
+ StatelessIF bean = (StatelessIF) ctx.lookup(getClass().getName()+"/bean"+n);
+ if(bean == null)
+ throw new IllegalStateException("SessionContext.lookup(bean"+n+") is null");
+ }
}
private void validateENCLookup()
throws Exception
{
InitialContext ic = new InitialContext();
Context enc = (Context) ic.lookup("java:comp/env");
- StatelessIF bean = (StatelessIF) enc.lookup("bean1");
- if(bean == null)
- throw new IllegalStateException("java:comp/env/bean1 is null");
+ StatelessIF bean1enc = null;
+ StatelessIF bean2enc = null;
+ StatelessIF bean3enc = null;
+ StatelessIF bean4enc = null;
+ StatelessIF bean5enc = null;
+ try
+ {
+ bean1enc = (StatelessIF) enc.lookup(getClass().getName()+"/bean1");
+ bean2enc = (StatelessIF) enc.lookup(getClass().getName()+"/bean2");
+ bean3enc = (StatelessIF) enc.lookup(getClass().getName()+"/bean3");
+ bean4enc = (StatelessIF) enc.lookup(getClass().getName()+"/bean4");
+ bean5enc = (StatelessIF) enc.lookup(getClass().getName()+"/bean5");
+ }
+ catch(NameNotFoundException e)
+ {
+ }
+ if(bean1enc == null)
+ {
+ StringBuffer tmp = new StringBuffer("java:comp/env/StatelessBean2/bean1 is null\n");
+ Debug.list(enc, " ", tmp, true);
+ throw new IllegalStateException(tmp.toString());
+ }
+ if(bean2enc == null)
+ {
+ StringBuffer tmp = new StringBuffer("java:comp/env/StatelessBean2/bean2 is null\n");
+ Debug.list(enc, " ", tmp, true);
+ throw new IllegalStateException(tmp.toString());
+ }
+ if(bean3enc == null)
+ {
+ StringBuffer tmp = new StringBuffer("java:comp/env/StatelessBean2/bean3 is null\n");
+ Debug.list(enc, " ", tmp, true);
+ throw new IllegalStateException(tmp.toString());
+ }
+ if(bean4enc == null)
+ {
+ StringBuffer tmp = new StringBuffer("java:comp/env/StatelessBean2/bean4 is null\n");
+ Debug.list(enc, " ", tmp, true);
+ throw new IllegalStateException(tmp.toString());
+ }
+ if(bean5enc == null)
+ {
+ StringBuffer tmp = new StringBuffer("java:comp/env/StatelessBean2/bean5 is null\n");
+ Debug.list(enc, " ", tmp, true);
+ throw new IllegalStateException(tmp.toString());
+ }
}
}
Modified: trunk/testsuite/src/main/org/jboss/test/refs/ejbs2x/interfaces/SessionHome.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/refs/ejbs2x/interfaces/SessionHome.java 2008-04-25 14:30:58 UTC (rev 72732)
+++ trunk/testsuite/src/main/org/jboss/test/refs/ejbs2x/interfaces/SessionHome.java 2008-04-25 14:33:41 UTC (rev 72733)
@@ -27,7 +27,7 @@
*/
public interface SessionHome extends javax.ejb.EJBHome
{
- Session create(String entityName)
+ Session create()
throws java.rmi.RemoteException, javax.ejb.CreateException;
}
Added: trunk/testsuite/src/main/org/jboss/test/refs/resources/ResourceBase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/refs/resources/ResourceBase.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/refs/resources/ResourceBase.java 2008-04-25 14:33:41 UTC (rev 72733)
@@ -0,0 +1,159 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * 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.refs.resources;
+
+import java.net.URL;
+
+import javax.ejb.EJBContext;
+import javax.jms.ConnectionFactory;
+import javax.jms.Queue;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.Topic;
+import javax.jms.TopicConnectionFactory;
+import javax.sql.DataSource;
+import javax.transaction.UserTransaction;
+
+import org.omg.CORBA.ORB;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public abstract class ResourceBase
+ implements ResourceIF
+{
+ abstract protected EJBContext getEJBContext();
+
+ abstract protected UserTransaction getUserTransaction();
+ abstract protected String getUserTransactionName();
+
+ abstract protected DataSource getDataSource();
+ abstract protected String getDataSourceName();
+
+ abstract protected DataSource getDataSource2();
+ abstract protected String getDataSource2Name();
+
+ abstract protected javax.mail.Session getMailSession();
+ abstract protected String getMailSessionName();
+
+ abstract protected URL getUrl();
+ abstract protected String getUrlName();
+
+ abstract protected QueueConnectionFactory getQueueConnectionFactory();
+ abstract protected String getQueueConnectionFactoryName();
+
+ abstract protected TopicConnectionFactory getTopicConnectionFactory();
+ abstract protected String getTopicConnectionFactoryName();
+
+ abstract protected ConnectionFactory getConnectionFactoryQ();
+ abstract protected String getConnectionFactoryQName();
+
+ abstract protected ConnectionFactory getConnectionFactoryT();
+ abstract protected String getConnectionFactoryTName();
+
+ abstract protected Queue getQueue();
+ abstract protected String getQueueName();
+
+ abstract protected Topic getTopic();
+ abstract protected String getTopicName();
+
+ abstract protected ORB getOrb();
+ abstract protected String getOrbName();
+
+ public void testConnectionFactoryQ() throws Exception
+ {
+ ConnectionFactory cf = this.getConnectionFactoryQ();
+ }
+
+ public void testConnectionFactoryT() throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void testDataSource() throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void testDataSource2() throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void testEJBContext() throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void testMailSession() throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void testOrb() throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void testQueue() throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void testQueueConnectionFactory() throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void testTopic() throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void testTopicConnectionFactory() throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void testUrl() throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void testUserTransaction() throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added: trunk/testsuite/src/main/org/jboss/test/refs/resources/ResourceIF.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/refs/resources/ResourceIF.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/refs/resources/ResourceIF.java 2008-04-25 14:33:41 UTC (rev 72733)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * 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.refs.resources;
+
+public interface ResourceIF
+{
+ public void testEJBContext() throws Exception ;
+
+ public void testUserTransaction() throws Exception ;
+
+ public void testDataSource() throws Exception ;
+
+ public void testDataSource2() throws Exception ;
+
+ public void testMailSession() throws Exception ;
+
+ public void testUrl() throws Exception ;
+
+ public void testTopicConnectionFactory() throws Exception ;
+
+ public void testQueueConnectionFactory() throws Exception ;
+
+ public void testConnectionFactoryQ() throws Exception ;
+
+ public void testConnectionFactoryT() throws Exception ;
+
+ public void testQueue() throws Exception ;
+
+ public void testTopic() throws Exception ;
+
+ public void testOrb() throws Exception ;
+
+}
Added: trunk/testsuite/src/main/org/jboss/test/refs/resources/ResourceOnFieldBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/refs/resources/ResourceOnFieldBean.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/refs/resources/ResourceOnFieldBean.java 2008-04-25 14:33:41 UTC (rev 72733)
@@ -0,0 +1,228 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * 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.refs.resources;
+
+import java.net.URL;
+
+import javax.annotation.Resource;
+import javax.annotation.Resource.AuthenticationType;
+import javax.ejb.Remote;
+import javax.ejb.SessionContext;
+import javax.ejb.Stateless;
+import javax.ejb.TransactionManagement;
+import javax.ejb.TransactionManagementType;
+import javax.jms.ConnectionFactory;
+import javax.jms.Queue;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.Topic;
+import javax.jms.TopicConnectionFactory;
+import javax.sql.DataSource;
+import javax.transaction.UserTransaction;
+
+import org.omg.CORBA.ORB;
+
+/**
+ * An ejb that injects all resource types using annotations on methods
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+ at Stateless(name = "ResourceOnFieldBean")
+ at Remote( { ResourceIF.class })
+ at TransactionManagement(TransactionManagementType.BEAN)
+public class ResourceOnFieldBean extends ResourceBase
+ implements ResourceIF
+{
+
+ @Resource(name = "session", description = "session context", type = SessionContext.class)
+ private SessionContext sessionContext;
+
+ @Resource(description = "user transaction", name = "myUserTransaction", type = UserTransaction.class)
+ private UserTransaction ut;
+
+ protected String getUserTransactionName()
+ {
+ return "myUserTransaction";
+ }
+
+ @Resource(name = "dataSource", description = "<resource-ref>")
+ private DataSource dataSource;
+
+ protected String getDataSourceName()
+ {
+ return "dataSource";
+ }
+
+ @Resource(name = "myDataSource2", type = DataSource.class, shareable = true, authenticationType = AuthenticationType.CONTAINER)
+ private DataSource dataSource2;
+
+ protected String getDataSource2Name()
+ {
+ return "myDataSource2";
+ }
+
+ @Resource(name = "mailSession")
+ private javax.mail.Session mailSession;
+
+ protected String getMailSessionName()
+ {
+ return "mailSession";
+ }
+
+ @Resource(name = "url")
+ private URL url;
+
+ protected String getUrlName()
+ {
+ return "url";
+ }
+
+ @Resource(name = "queueConnectionFactory")
+ private QueueConnectionFactory queueConnectionFactory;
+
+ protected String getQueueConnectionFactoryName()
+ {
+ return "queueConnectionFactory";
+ }
+
+ @Resource(name = "topicConnectionFactory")
+ private TopicConnectionFactory topicConnectionFactory;
+
+ protected String getTopicConnectionFactoryName()
+ {
+ return "topicConnectionFactory";
+ }
+
+ @Resource(name = "connectionFactoryQ")
+ private ConnectionFactory connectionFactoryQ;
+
+ protected String getConnectionFactoryQName()
+ {
+ return "connectionFactoryQ";
+ }
+
+ protected ConnectionFactory getConnectionFactoryQ()
+ {
+ return connectionFactoryQ;
+ }
+
+ @Resource(name = "connectionFactoryT")
+ private ConnectionFactory connectionFactoryT;
+
+ protected String getConnectionFactoryTName()
+ {
+ return "connectionFactoryT";
+ }
+
+ protected ConnectionFactory getConnectionFactoryT()
+ {
+ return connectionFactoryT;
+ }
+
+ @Resource(name = "topic")
+ private Topic topic;
+
+ protected String getTopicName()
+ {
+ return "topic";
+ }
+
+ @Resource(name = "queue")
+ private Queue queue;
+
+ protected String getQueueName()
+ {
+ return "queue";
+ }
+
+ @Resource(name = "myOrb", type = ORB.class, description = "corba orb", shareable = false)
+ private ORB orb;
+
+ protected String getOrbName()
+ {
+ return "myOrb";
+ }
+
+ public ResourceOnFieldBean()
+ {
+ }
+
+ public void remove()
+ {
+ }
+
+ protected javax.ejb.EJBContext getEJBContext()
+ {
+ return sessionContext;
+ }
+
+ protected DataSource getDataSource()
+ {
+ return dataSource;
+ }
+
+ protected DataSource getDataSource2()
+ {
+ return dataSource2;
+ }
+
+ protected javax.mail.Session getMailSession()
+ {
+ return mailSession;
+ }
+
+ protected URL getUrl()
+ {
+ return url;
+ }
+
+ protected QueueConnectionFactory getQueueConnectionFactory()
+ {
+ return queueConnectionFactory;
+ }
+
+ protected Queue getQueue()
+ {
+ return queue;
+ }
+
+ protected TopicConnectionFactory getTopicConnectionFactory()
+ {
+ return topicConnectionFactory;
+ }
+
+ protected Topic getTopic()
+ {
+ return topic;
+ }
+
+ protected UserTransaction getUserTransaction()
+ {
+ return ut;
+ }
+
+ protected ORB getOrb()
+ {
+ return this.orb;
+ }
+
+}
Added: trunk/testsuite/src/main/org/jboss/test/refs/resources/ResourceOnMethodBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/refs/resources/ResourceOnMethodBean.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/refs/resources/ResourceOnMethodBean.java 2008-04-25 14:33:41 UTC (rev 72733)
@@ -0,0 +1,293 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * 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.refs.resources;
+
+import java.net.URL;
+import javax.annotation.Resource.AuthenticationType;
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+import javax.ejb.SessionContext;
+import javax.annotation.Resource;
+import javax.ejb.TransactionManagement;
+import javax.ejb.TransactionManagementType;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.ConnectionFactory;
+import javax.jms.TopicConnectionFactory;
+import javax.sql.DataSource;
+import javax.transaction.UserTransaction;
+import javax.jms.Queue;
+import javax.jms.Topic;
+import org.omg.CORBA.ORB;
+
+/**
+ * An ejb that injects all resource types using annotations on methods
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+ at Stateless(name = "ResourceOnMethodBean")
+ at Remote( { ResourceIF.class })
+ at TransactionManagement(TransactionManagementType.BEAN)
+public class ResourceOnMethodBean extends ResourceBase
+ implements ResourceIF
+{
+ private SessionContext sessionContext;
+
+ private UserTransaction userTransaction;
+
+ private DataSource dataSource;
+
+ private DataSource dataSource2;
+
+ private javax.mail.Session mailSession;
+
+ private URL url;
+
+ private QueueConnectionFactory queueConnectionFactory;
+
+ private TopicConnectionFactory topicConnectionFactory;
+
+ private ConnectionFactory connectionFactoryQ;
+
+ private ConnectionFactory connectionFactoryT;
+
+ private Topic topic;
+
+ private Queue queue;
+
+ private ORB orb;
+
+ public ResourceOnMethodBean()
+ {
+ }
+
+ public void remove()
+ {
+ }
+
+
+ protected javax.ejb.EJBContext getEJBContext()
+ {
+ return sessionContext;
+ }
+
+ @Resource(name = "sessionContext", description = "session context", type = SessionContext.class)
+ private void setSessionContext(SessionContext sessionContext)
+ {
+ this.sessionContext = sessionContext;
+ }
+
+ protected DataSource getDataSource()
+ {
+ return dataSource;
+ }
+
+ @Resource(name = "dataSource")
+ private void setDataSource(DataSource dataSource)
+ {
+ this.dataSource = dataSource;
+ }
+
+ protected String getDataSourceName()
+ {
+ return "dataSource";
+ }
+
+ protected DataSource getDataSource2()
+ {
+ return dataSource2;
+ }
+
+ @Resource(name = "myDataSource2", type = DataSource.class, shareable = true, authenticationType = AuthenticationType.CONTAINER)
+ private void setDataSource2(DataSource dataSource2)
+ {
+ this.dataSource2 = dataSource2;
+ }
+
+ protected String getDataSource2Name()
+ {
+ return "myDataSource2";
+ }
+
+ protected javax.mail.Session getMailSession()
+ {
+ return mailSession;
+ }
+
+ @Resource(name = "mailSession")
+ private void setMailSession(javax.mail.Session mailSession)
+ {
+ this.mailSession = mailSession;
+ }
+
+ protected String getMailSessionName()
+ {
+ return "mailSession";
+ }
+
+ protected URL getUrl()
+ {
+ return url;
+ }
+
+ @Resource(name = "url")
+ private void setUrl(URL url)
+ {
+ this.url = url;
+ }
+
+ protected String getUrlName()
+ {
+ return "url";
+ }
+
+ protected QueueConnectionFactory getQueueConnectionFactory()
+ {
+ return queueConnectionFactory;
+ }
+
+ @Resource(name = "queueConnectionFactory")
+ private void setQueueConnectionFactory(
+ QueueConnectionFactory queueConnectionFactory)
+ {
+ this.queueConnectionFactory = queueConnectionFactory;
+ }
+
+ protected String getQueueConnectionFactoryName()
+ {
+ return "queueConnectionFactory";
+ }
+
+ protected TopicConnectionFactory getTopicConnectionFactory()
+ {
+ return topicConnectionFactory;
+ }
+
+ @Resource(name = "topicConnectionFactory")
+ private void setTopicConnectionFactory(TopicConnectionFactory topicConnectionFactory)
+ {
+ this.topicConnectionFactory = topicConnectionFactory;
+ }
+
+ protected String getTopicConnectionFactoryName()
+ {
+ return "topicConnectionFactory";
+ }
+
+ protected ConnectionFactory getConnectionFactoryT()
+ {
+ return connectionFactoryT;
+ }
+
+ @Resource(name = "connectionFactoryT")
+ private void setConnectionFactoryT(ConnectionFactory conn)
+ {
+ connectionFactoryT = conn;
+ }
+
+ protected String getConnectionFactoryTName()
+ {
+ return "connectionFactoryT";
+ }
+
+ protected ConnectionFactory getConnectionFactoryQ()
+ {
+ return connectionFactoryQ;
+ }
+
+ @Resource(name = "connectionFactoryQ")
+ private void setConnectionFactoryQ(ConnectionFactory conn)
+ {
+ connectionFactoryQ = conn;
+ }
+
+ protected String getConnectionFactoryQName()
+ {
+ return "connectionFactoryQ";
+ }
+
+ protected Topic getTopic()
+ {
+ return topic;
+ }
+
+ @Resource(name = "topic")
+ private void setTopic(Topic topic)
+ {
+ this.topic = topic;
+ }
+
+ protected String getTopicName()
+ {
+ return "topic";
+ }
+
+ protected Queue getQueue()
+ {
+ return queue;
+ }
+
+ @Resource(name = "queue")
+ private void setQueue(Queue queue)
+ {
+ this.queue = queue;
+ }
+
+ protected String getQueueName()
+ {
+ return "queue";
+ }
+
+ protected String getUserTransactionName()
+ {
+ return "myUserTransaction";
+ }
+
+ @Resource(description = "user transaction", name = "myUserTransaction", type = UserTransaction.class)
+ private void setUserTransaction(UserTransaction ut)
+ {
+ userTransaction = ut;
+ }
+
+ protected javax.transaction.UserTransaction getUserTransaction()
+ {
+ return userTransaction;
+ }
+
+
+ protected String getOrbName()
+ {
+ return "myOrb";
+ }
+
+ @Resource(name = "myOrb", type = ORB.class, description = "corba orb", shareable = false)
+ private void setOrb(ORB orb)
+ {
+ this.orb = orb;
+ }
+
+ protected ORB getOrb()
+ {
+ return this.orb;
+ }
+
+}
Added: trunk/testsuite/src/main/org/jboss/test/refs/resources/ResourcesOnClassBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/refs/resources/ResourcesOnClassBean.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/refs/resources/ResourcesOnClassBean.java 2008-04-25 14:33:41 UTC (rev 72733)
@@ -0,0 +1,220 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * 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.refs.resources;
+
+import java.net.URL;
+
+import javax.annotation.Resource;
+import javax.annotation.Resource.AuthenticationType;
+import javax.annotation.Resources;
+import javax.ejb.Remote;
+import javax.ejb.SessionContext;
+import javax.ejb.Stateless;
+import javax.ejb.TransactionManagement;
+import javax.ejb.TransactionManagementType;
+import javax.jms.ConnectionFactory;
+import javax.jms.Queue;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.Topic;
+import javax.jms.TopicConnectionFactory;
+import javax.mail.Session;
+import javax.naming.NamingException;
+import javax.sql.DataSource;
+import javax.transaction.UserTransaction;
+
+import org.jboss.test.refs.common.ServiceLocator;
+import org.omg.CORBA.ORB;
+
+/**
+ * An ejb that injects all resource types using annotations on the class
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+ at Stateless(name = "ResourcesOnClassBean")
+ at Remote( { ResourceIF.class })
+ at TransactionManagement(TransactionManagementType.BEAN)
+ at Resources( {
+ @Resource(description = "user transaction", name = "myUserTransaction", type = UserTransaction.class),
+ @Resource(name = "dataSource", type = DataSource.class, shareable = true, authenticationType = AuthenticationType.CONTAINER, description = "<resource-ref>"),
+ @Resource(name = "myDataSource2", type = DataSource.class, authenticationType = AuthenticationType.CONTAINER),
+ @Resource(name = "mailSession", type = Session.class),
+ @Resource(name = "url", type = URL.class),
+ @Resource(name = "queueConnectionFactory", type = QueueConnectionFactory.class),
+ @Resource(name = "topicConnectionFactory", type = TopicConnectionFactory.class),
+ @Resource(name = "connectionFactoryQ", type = ConnectionFactory.class),
+ @Resource(name = "connectionFactoryT", type = ConnectionFactory.class),
+ @Resource(name = "queue", type = Queue.class),
+ @Resource(name = "topic", type = Topic.class),
+ @Resource(name = "myOrb", type = ORB.class, description = "corba orb", shareable = false) })
+public class ResourcesOnClassBean extends ResourceBase
+ implements ResourceIF
+{
+ @Resource(name = "sessionContext", description = "session context", type = SessionContext.class)
+ private SessionContext sessionContext;
+
+ protected String getUserTransactionName()
+ {
+ return "myUserTransaction";
+ }
+
+ protected String getDataSourceName()
+ {
+ return "dataSource";
+ }
+
+ protected String getDataSource2Name()
+ {
+ return "myDataSource2";
+ }
+
+ protected String getMailSessionName()
+ {
+ return "mailSession";
+ }
+
+ protected String getUrlName()
+ {
+ return "url";
+ }
+
+ protected String getQueueConnectionFactoryName()
+ {
+ return "queueConnectionFactory";
+ }
+
+ protected String getTopicConnectionFactoryName()
+ {
+ return "topicConnectionFactory";
+ }
+
+ protected String getConnectionFactoryQName()
+ {
+ return "connectionFactoryQ";
+ }
+
+ protected String getConnectionFactoryTName()
+ {
+ return "connectionFactoryT";
+ }
+
+ protected String getTopicName()
+ {
+ return "topic";
+ }
+
+ protected String getQueueName()
+ {
+ return "queue";
+ }
+
+ protected String getOrbName()
+ {
+ return "myOrb";
+ }
+
+ public ResourcesOnClassBean()
+ {
+ }
+
+ public void remove()
+ {
+ }
+
+ protected javax.ejb.EJBContext getEJBContext()
+ {
+ return sessionContext;
+ }
+
+ protected DataSource getDataSource()
+ {
+ return (DataSource) getEJBContext().lookup(getDataSourceName());
+ }
+
+ protected DataSource getDataSource2()
+ {
+ return (DataSource) getEJBContext().lookup(getDataSource2Name());
+ }
+
+ protected javax.mail.Session getMailSession()
+ {
+ return (Session) getEJBContext().lookup(getMailSessionName());
+ }
+
+ protected URL getUrl()
+ {
+ return (URL) getEJBContext().lookup(getUrlName());
+ }
+
+ protected QueueConnectionFactory getQueueConnectionFactory()
+ {
+ return (QueueConnectionFactory) getEJBContext().lookup(
+ getQueueConnectionFactoryName());
+ }
+
+ protected TopicConnectionFactory getTopicConnectionFactory()
+ {
+ return (TopicConnectionFactory) getEJBContext().lookup(
+ getTopicConnectionFactoryName());
+ }
+
+ protected ConnectionFactory getConnectionFactoryQ()
+ {
+ return (ConnectionFactory) getEJBContext().lookup(
+ getConnectionFactoryQName());
+ }
+
+ protected ConnectionFactory getConnectionFactoryT()
+ {
+ return (ConnectionFactory) getEJBContext().lookup(
+ getConnectionFactoryTName());
+ }
+
+ protected Queue getQueue()
+ {
+ return (Queue) getEJBContext().lookup(getQueueName());
+ }
+
+ protected Topic getTopic()
+ {
+ return (Topic) getEJBContext().lookup(getTopicName());
+ }
+
+ protected javax.transaction.UserTransaction getUserTransaction()
+ {
+ return getEJBContext().getUserTransaction();
+ }
+
+ protected ORB getOrb()
+ {
+ try
+ {
+ return (ORB) ServiceLocator.lookup("java:comp/ORB");
+ }
+ catch (NamingException e)
+ {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+}
Modified: trunk/testsuite/src/main/org/jboss/test/refs/test/CircularRefResolutionUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/refs/test/CircularRefResolutionUnitTestCase.java 2008-04-25 14:30:58 UTC (rev 72732)
+++ trunk/testsuite/src/main/org/jboss/test/refs/test/CircularRefResolutionUnitTestCase.java 2008-04-25 14:33:41 UTC (rev 72733)
@@ -70,7 +70,7 @@
{
public static Test suite() throws Exception
{
- Test t1 = getDeploySetup(RefResolutionUnitTestCase.class, "refs.ear");
+ Test t1 = getDeploySetup(CircularRefResolutionUnitTestCase.class, "refs.ear");
return t1;
}
Copied: trunk/testsuite/src/main/org/jboss/test/refs/test/MappedResolverUnitTestCase.java (from rev 72011, branches/InjectionPrototype/testsuite/src/main/org/jboss/test/refs/test/MappedResolverUnitTestCase.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/refs/test/MappedResolverUnitTestCase.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/refs/test/MappedResolverUnitTestCase.java 2008-04-25 14:33:41 UTC (rev 72733)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * 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.refs.test;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.deployment.dependency.ContainerDependencyMetaData;
+import org.jboss.deployment.plugin.MappedDeploymentEndpointResolver;
+import org.jboss.deployment.spi.EndpointInfo;
+import org.jboss.deployment.spi.EndpointType;
+import org.jboss.test.refs.common.EjbLinkIF;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests of the MappedDeploymentEndpointResolver
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class MappedResolverUnitTestCase extends TestCase
+{
+ private Map<String, ContainerDependencyMetaData> endpointMap
+ = new HashMap<String, ContainerDependencyMetaData>();
+ private Map<String, String> endpointAlternateMap
+ = new HashMap<String, String>();
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ }
+
+ public void testEjbRefs()
+ {
+ String deploymentPath = "ejb1.jar";
+ MappedDeploymentEndpointResolver resolver = new MappedDeploymentEndpointResolver(
+ endpointMap, endpointAlternateMap, deploymentPath);
+ // Add ejb mappings to ejb1.jar
+ endpointMap.put("ejb/ejb1.jar#Ejb1InJar1", new ContainerDependencyMetaData("Ejb1InJar1", "Ejb1InJar1", "ejb1.jar"));
+ endpointMap.put("ejb/ejb1.jar#Ejb2InJar1", new ContainerDependencyMetaData("Ejb2InJar1", "Ejb2InJar1", "ejb1.jar"));
+ // A business-local mapping for Ejb1InJar1
+ endpointAlternateMap.put("ejb/ejb1.jar@"+EjbLinkIF.class.getName(), "ejb/ejb1.jar#Ejb1InJar1");
+ EndpointInfo info = resolver.getEndpointInfo("Ejb1InJar1", EndpointType.EJB, "ejb1.jar");
+ assertNotNull(info);
+ assertEquals("Ejb1InJar1", info.getName());
+ assertEquals("ejb1.jar", info.getPathName());
+
+ info = resolver.getEndpointInfo("../ejb1.jar#Ejb2InJar1", EndpointType.EJB, "ejb2.jar");
+ assertNotNull(info);
+ assertEquals("Ejb2InJar1", info.getName());
+ assertEquals("ejb1.jar", info.getPathName());
+
+ //
+ info = resolver.getEndpointInfo(EjbLinkIF.class, EndpointType.EJB, "ejb1.jar");
+ assertNotNull(info);
+ assertEquals("Ejb1InJar1", info.getName());
+ assertEquals("ejb1.jar", info.getPathName()); }
+}
Modified: trunk/testsuite/src/main/org/jboss/test/refs/test/RefResolutionUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/refs/test/RefResolutionUnitTestCase.java 2008-04-25 14:30:58 UTC (rev 72732)
+++ trunk/testsuite/src/main/org/jboss/test/refs/test/RefResolutionUnitTestCase.java 2008-04-25 14:33:41 UTC (rev 72733)
@@ -22,10 +22,15 @@
package org.jboss.test.refs.test;
import java.util.Date;
+import java.util.Properties;
import javax.ejb.Remote;
import javax.ejb.Stateless;
+import javax.naming.Context;
import javax.naming.InitialContext;
+import javax.naming.NameClassPair;
+import javax.naming.NameNotFoundException;
+import javax.naming.NamingEnumeration;
import junit.framework.Test;
@@ -58,6 +63,13 @@
-> refs-ejb.jar#StatelessBean
+ @EJB(beanInterface=StatelessIFExt.class)
-> refs-ejb.jar#StatelessBean
+ <!-- A collection of ejb2.1 beans with inter-jar refs -->
+ + refs-ejb2x.jar
+ - TargetSession (jndi-name=refs/TargetSession)
+ - TargetSessionReferencer (jndi-name=refs/TargetSessionReferencer)
+ + ejb-ref(ejb/TargetSessionViaEjbLink)
+ -> TargetSession
+
* @author Scott.Stark at jboss.org
* @version $Revision$
*/
@@ -79,9 +91,18 @@
throws Exception
{
InitialContext ctx = getInitialContext();
- Object ref = ctx.lookup("refs/StatelessBean2/remote");
- StatelessTest test = (StatelessTest) ref;
- test.validate();
+ try
+ {
+ Object ref = ctx.lookup("refs/StatelessBean2/remote");
+ StatelessTest test = (StatelessTest) ref;
+ test.validate();
+ }
+ catch(NameNotFoundException e)
+ {
+ getLog().info("+++ dump of global JNDI contents: ");
+ dumpGlobalJndi("refs", 0);
+ throw e;
+ }
}
/**
@@ -92,14 +113,48 @@
throws Throwable
{
String mainClassName = Client.class.getName();
- // must match JNDI name in jboss-client.xml or display-name in application-client.xml
- String applicationClientName = "refs_client";
+ // JNDI name in jboss-client.xml or display-name in application-client.xml, or client jar simple name
+ String applicationClientName = "refs-client";
String name = new Date().toString();
String args[] = { name };
ClientLauncher launcher = new ClientLauncher();
- launcher.launch(mainClassName, applicationClientName, args);
+ Properties env = getENCProps(applicationClientName);
+ launcher.launch(mainClassName, applicationClientName, args, env);
assertNotNull(Client.getStatefulBean());
assertNotNull(Client.getStatelessBean());
}
+
+ private Properties getENCProps(String applicationClientName)
+ {
+ Properties env = new Properties();
+ env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ env.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming.client");
+ env.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099");
+ env.setProperty("j2ee.clientName", applicationClientName);
+ return env;
+ }
+ protected void dumpGlobalJndi(String name, int depth)
+ throws Exception
+ {
+ InitialContext ctx = new InitialContext();
+ StringBuilder tmp = new StringBuilder();
+ for(int n = 0; n < depth; n ++)
+ tmp.append('+');
+ tmp.append(name);
+ getLog().info(tmp.toString());
+ NamingEnumeration<NameClassPair> iter = ctx.list(name);
+ while(iter.hasMore())
+ {
+ NameClassPair ncp = iter.next();
+ tmp.setLength(0);
+ for(int n = 0; n <= depth; n ++)
+ tmp.append('+');
+ tmp.append(ncp.getName());
+ getLog().info(tmp.toString());
+ if(ncp.getClassName().equals("javax.naming.Context"))
+ dumpGlobalJndi(name+"/"+ncp.getName(), depth+1);
+ }
+ }
}
Added: trunk/testsuite/src/main/org/jboss/test/refs/test/ResourceResolutionUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/refs/test/ResourceResolutionUnitTestCase.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/refs/test/ResourceResolutionUnitTestCase.java 2008-04-25 14:33:41 UTC (rev 72733)
@@ -0,0 +1,172 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * 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.refs.test;
+
+import java.util.Properties;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NameClassPair;
+import javax.naming.NamingEnumeration;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.client.ClientLauncher;
+import org.jboss.test.JBossTestCase;
+import org.jboss.test.JBossTestSetup;
+import org.jboss.test.refs.clientorb.Client;
+
+/**
+ * Tests of reference resolution. The ear consists of:
+ refs.ear
+ + refs-clientorb.jar
+ - @EJB(name = "ResourceOnMethodBean")
+ -> ResourceOnMethodBean
+ - @EJB(name = "ResourceOnFieldBean")
+ -> ResourceOnFieldBean
+ - @EJB(name = "ResourceOnFieldBean")
+ -> ResourceOnFieldBean
+ <!-- EJB3s with various @Resources -->
+ + refs-resources-ejb.jar
+ - @Stateless(ResourceOnMethodBean) (jndi-name=refs/resources/ResourceOnMethodBean)
+ - @Remote( { ResourceIF.class })
+ + @Resource(name = "sessionContext", description = "session context", type = SessionContext.class)
+ + @Resource(name = "dataSource")
+ + @Resource(name = "myDataSource2", type = DataSource.class, shareable = true, authenticationType = AuthenticationType.CONTAINER)
+ + @Resource(name = "mailSession")
+ + @Resource(name = "url")
+ + @Resource(name = "queueConnectionFactory")
+ + @Resource(name = "topicConnectionFactory")
+ + @Resource(name = "connectionFactoryT")
+ + @Resource(name = "connectionFactoryQ")
+ + @Resource(name = "topic")
+ + @Resource(name = "queue")
+ + @Resource(description = "user transaction", name = "myUserTransaction", type = UserTransaction.class)
+ + @Resource(name = "myOrb", type = ORB.class, description = "corba orb", shareable = false)
+ - @Stateless(name = "ResourceOnFieldBean")
+ - @Remote( { ResourceIF.class })
+ + @Resource(name = "session", description = "session context", type = SessionContext.class)
+ + @Resource(description = "user transaction", name = "myUserTransaction", type = UserTransaction.class)
+ + @Resource(name = "dataSource", description = "<resource-ref>")
+ + @Resource(name = "myDataSource2", type = DataSource.class, shareable = true, authenticationType = AuthenticationType.CONTAINER)
+ + @Resource(name = "mailSession")
+ + @Resource(name = "url")
+ + @Resource(name = "queueConnectionFactory")
+ + @Resource(name = "topicConnectionFactory")
+ + @Resource(name = "connectionFactoryQ")
+ + @Resource(name = "connectionFactoryT")
+ + @Resource(name = "topic")
+ + @Resource(name = "queue")
+ + @Resource(name = "myOrb", type = ORB.class, description = "corba orb", shareable = false)
+ - @Stateless(name = "ResourcesOnClassBean")
+ - @Remote( { ResourceIF.class })
+ - @Resources( {
+ @Resource(description = "user transaction", name = "myUserTransaction", type = UserTransaction.class),
+ @Resource(name = "dataSource", type = DataSource.class, shareable = true, authenticationType = AuthenticationType.CONTAINER, description = "<resource-ref>"),
+ @Resource(name = "myDataSource2", type = DataSource.class, authenticationType = AuthenticationType.CONTAINER),
+ @Resource(name = "mailSession", type = Session.class),
+ @Resource(name = "url", type = URL.class),
+ @Resource(name = "queueConnectionFactory", type = QueueConnectionFactory.class),
+ @Resource(name = "topicConnectionFactory", type = TopicConnectionFactory.class),
+ @Resource(name = "connectionFactoryQ", type = ConnectionFactory.class),
+ @Resource(name = "connectionFactoryT", type = ConnectionFactory.class),
+ @Resource(name = "queue", type = Queue.class),
+ @Resource(name = "topic", type = Topic.class),
+ @Resource(name = "myOrb", type = ORB.class, description = "corba orb", shareable = false)
+ })
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 70876 $
+ */
+public class ResourceResolutionUnitTestCase
+ extends JBossTestCase
+{
+ public static Test suite() throws Exception
+ {
+ return new JBossTestSetup(getDeploySetup(ResourceResolutionUnitTestCase.class, "refs-resources.ear"))
+ {
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ deploy (loader.getResource("jbossmessaging/test-destinations-service.xml").toString());
+ }
+
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ undeploy (loader.getResource("jbossmessaging/test-destinations-service.xml").toString());
+ }
+ };
+ }
+
+ public ResourceResolutionUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testClientORBResources()
+ throws Throwable
+ {
+ String mainClassName = Client.class.getName();
+ // JNDI name in jboss-client.xml or display-name in application-client.xml, or client jar simple name
+ String applicationClientName = "refs-clientorb";
+ String args[] = {};
+
+ ClientLauncher launcher = new ClientLauncher();
+ Properties env = getENCProps(applicationClientName);
+ launcher.launch(mainClassName, applicationClientName, args, env);
+ }
+
+ private Properties getENCProps(String applicationClientName)
+ {
+ Properties env = new Properties();
+ env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
+ "org.jnp.interfaces.NamingContextFactory");
+ env.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming.client");
+ env.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099");
+ env.setProperty("j2ee.clientName", applicationClientName);
+ return env;
+ }
+ protected void dumpGlobalJndi(String name, int depth)
+ throws Exception
+ {
+ InitialContext ctx = new InitialContext();
+ StringBuilder tmp = new StringBuilder();
+ for(int n = 0; n < depth; n ++)
+ tmp.append('+');
+ tmp.append(name);
+ getLog().info(tmp.toString());
+ NamingEnumeration<NameClassPair> iter = ctx.list(name);
+ while(iter.hasMore())
+ {
+ NameClassPair ncp = iter.next();
+ tmp.setLength(0);
+ for(int n = 0; n <= depth; n ++)
+ tmp.append('+');
+ tmp.append(ncp.getName());
+ getLog().info(tmp.toString());
+ if(ncp.getClassName().equals("javax.naming.Context"))
+ dumpGlobalJndi(name+"/"+ncp.getName(), depth+1);
+ }
+ }
+}
Modified: trunk/testsuite/src/resources/refs/ejb2x/jboss.xml
===================================================================
--- trunk/testsuite/src/resources/refs/ejb2x/jboss.xml 2008-04-25 14:30:58 UTC (rev 72732)
+++ trunk/testsuite/src/resources/refs/ejb2x/jboss.xml 2008-04-25 14:33:41 UTC (rev 72733)
@@ -6,11 +6,11 @@
<enterprise-beans>
<session>
<ejb-name>TargetSession</ejb-name>
- <jndi-name>refs/TargetSession</jndi-name>
+ <jndi-name>refs2x/TargetSession</jndi-name>
</session>
<session>
<ejb-name>TargetSessionReferencer</ejb-name>
- <jndi-name>refs/TargetSessionReferencer</jndi-name>
+ <jndi-name>refs2x/TargetSessionReferencer</jndi-name>
</session>
</enterprise-beans>
</jboss>
Added: trunk/testsuite/src/resources/refs/ejblink/one/ejb-jar.xml
===================================================================
--- trunk/testsuite/src/resources/refs/ejblink/one/ejb-jar.xml (rev 0)
+++ trunk/testsuite/src/resources/refs/ejblink/one/ejb-jar.xml 2008-04-25 14:33:41 UTC (rev 72733)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ version="3.0"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
+ <enterprise-beans>
+ <session>
+ <ejb-name>EjbLink1Bean</ejb-name>
+ <ejb-class>org.jboss.test.refs.ejblink.EjbLink1Bean</ejb-class>
+
+ <ejb-ref>
+ <ejb-ref-name>ejb/EjbLink2Bean</ejb-ref-name>
+ <ejb-ref-type>Session</ejb-ref-type>
+ <remote>org.jboss.test.refs.common.EjbLinkIF</remote>
+ <ejb-link>refs-two-ejb.jar#EjbLink2Bean</ejb-link>
+ </ejb-ref>
+
+ </session>
+ </enterprise-beans>
+</ejb-jar>
Added: trunk/testsuite/src/resources/refs/ejblink/one/jboss.xml
===================================================================
--- trunk/testsuite/src/resources/refs/ejblink/one/jboss.xml (rev 0)
+++ trunk/testsuite/src/resources/refs/ejblink/one/jboss.xml 2008-04-25 14:33:41 UTC (rev 72733)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss xmlns="http://www.jboss.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
+ version="3.0">
+ <enterprise-beans>
+ <ejb>
+ <ejb-name>EjbLink1Bean</ejb-name>
+ <jndi-name>ejb3_stateless_ejblink_one_EjbLink1Bean</jndi-name>
+ <ejb-ref>
+ <ejb-ref-name>ejb/EjbLink2Bean</ejb-ref-name>
+ </ejb-ref>
+ </ejb>
+
+ </enterprise-beans>
+</jboss>
Deleted: trunk/testsuite/src/resources/refs/ejblink/one_ejb.xml
===================================================================
--- trunk/testsuite/src/resources/refs/ejblink/one_ejb.xml 2008-04-25 14:30:58 UTC (rev 72732)
+++ trunk/testsuite/src/resources/refs/ejblink/one_ejb.xml 2008-04-25 14:33:41 UTC (rev 72733)
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- version="3.0"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
- <enterprise-beans>
- <session>
- <ejb-name>EjbLink1Bean</ejb-name>
- <ejb-class>org.jboss.test.refs.ejblink.EjbLink1Bean</ejb-class>
-
- <ejb-ref>
- <ejb-ref-name>ejb/EjbLink2Bean</ejb-ref-name>
- <ejb-ref-type>Session</ejb-ref-type>
- <remote>org.jboss.test.refs.common.EjbLinkIF</remote>
- <ejb-link>two_ejb.jar#EjbLink2Bean</ejb-link>
- </ejb-ref>
-
- </session>
- </enterprise-beans>
-</ejb-jar>
Deleted: trunk/testsuite/src/resources/refs/ejblink/one_jboss.xml
===================================================================
--- trunk/testsuite/src/resources/refs/ejblink/one_jboss.xml 2008-04-25 14:30:58 UTC (rev 72732)
+++ trunk/testsuite/src/resources/refs/ejblink/one_jboss.xml 2008-04-25 14:33:41 UTC (rev 72733)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<jboss xmlns="http://www.jboss.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.jboss.org/j2ee/schema
- http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
- version="5.0">
- <enterprise-beans>
- <ejb>
- <ejb-name>EjbLink1Bean</ejb-name>
- <jndi-name>ejb3_stateless_ejblink_one_EjbLink1Bean</jndi-name>
- <ejb-ref>
- <ejb-ref-name>ejb/EjbLink2Bean</ejb-ref-name>
- </ejb-ref>
- </ejb>
-
- </enterprise-beans>
-</jboss>
Added: trunk/testsuite/src/resources/refs/ejblink/two/ejb-jar.xml
===================================================================
--- trunk/testsuite/src/resources/refs/ejblink/two/ejb-jar.xml (rev 0)
+++ trunk/testsuite/src/resources/refs/ejblink/two/ejb-jar.xml 2008-04-25 14:33:41 UTC (rev 72733)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ version="3.0"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
+ <enterprise-beans>
+ <session>
+ <ejb-name>EjbLink2Bean</ejb-name>
+ <ejb-class>org.jboss.test.refs.ejblink.EjbLink2Bean</ejb-class>
+
+ <ejb-ref>
+ <ejb-ref-name>ejb/EjbLink1Bean</ejb-ref-name>
+ <ejb-ref-type>Session</ejb-ref-type>
+ <remote>org.jboss.test.refs.common.EjbLinkIF</remote>
+ <ejb-link>refs-one-ejb.jar#EjbLink1Bean</ejb-link>
+ </ejb-ref>
+
+ <ejb-local-ref>
+ <ejb-ref-name>ejb/EjbLink3Bean</ejb-ref-name>
+ <ejb-ref-type>Session</ejb-ref-type>
+ <local>org.jboss.test.refs.common.EjbLinkIF</local>
+ <ejb-link>EjbLink3Bean</ejb-link>
+ </ejb-local-ref>
+
+ </session>
+ </enterprise-beans>
+</ejb-jar>
Added: trunk/testsuite/src/resources/refs/ejblink/two/jboss.xml
===================================================================
--- trunk/testsuite/src/resources/refs/ejblink/two/jboss.xml (rev 0)
+++ trunk/testsuite/src/resources/refs/ejblink/two/jboss.xml 2008-04-25 14:33:41 UTC (rev 72733)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss xmlns="http://www.jboss.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
+ version="3.0">
+ <enterprise-beans>
+ <ejb>
+ <ejb-name>EjbLink2Bean</ejb-name>
+ <jndi-name>ejb3_stateless_ejblink_one_EjbLink2Bean</jndi-name>
+ <ejb-ref>
+ <ejb-ref-name>ejb/EjbLink1Bean</ejb-ref-name>
+ <!-- To avoid the circular reference -->
+ <ignore-dependency/>
+ </ejb-ref>
+ <ejb-ref>
+ <ejb-ref-name>ejb/EjbLink3Bean</ejb-ref-name>
+ </ejb-ref>
+ </ejb>
+
+ </enterprise-beans>
+</jboss>
Deleted: trunk/testsuite/src/resources/refs/ejblink/two_ejb.xml
===================================================================
--- trunk/testsuite/src/resources/refs/ejblink/two_ejb.xml 2008-04-25 14:30:58 UTC (rev 72732)
+++ trunk/testsuite/src/resources/refs/ejblink/two_ejb.xml 2008-04-25 14:33:41 UTC (rev 72733)
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- version="3.0"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
- <enterprise-beans>
- <session>
- <ejb-name>EjbLink2Bean</ejb-name>
- <ejb-class>org.jboss.test.refs.ejblink.EjbLink2Bean</ejb-class>
-
- <ejb-ref>
- <ejb-ref-name>ejb/EjbLink1Bean</ejb-ref-name>
- <ejb-ref-type>Session</ejb-ref-type>
- <remote>org.jboss.test.refs.common.EjbLinkIF</remote>
- <ejb-link>one_ejb.jar#EjbLink1Bean</ejb-link>
- </ejb-ref>
-
- <ejb-local-ref>
- <ejb-ref-name>ejb/EjbLink3Bean</ejb-ref-name>
- <ejb-ref-type>Session</ejb-ref-type>
- <local>org.jboss.test.refs.common.EjbLinkIF</local>
- <ejb-link>EjbLink3Bean</ejb-link>
- </ejb-local-ref>
-
- </session>
- </enterprise-beans>
-</ejb-jar>
Deleted: trunk/testsuite/src/resources/refs/ejblink/two_jboss.xml
===================================================================
--- trunk/testsuite/src/resources/refs/ejblink/two_jboss.xml 2008-04-25 14:30:58 UTC (rev 72732)
+++ trunk/testsuite/src/resources/refs/ejblink/two_jboss.xml 2008-04-25 14:33:41 UTC (rev 72733)
@@ -1,19 +0,0 @@
-<jboss xmlns="http://www.jboss.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.jboss.org/j2ee/schema
- http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
- version="5.0">
- <enterprise-beans>
- <ejb>
- <ejb-name>EjbLink2Bean</ejb-name>
- <jndi-name>ejb3_stateless_ejblink_one_EjbLink2Bean</jndi-name>
- <ejb-ref>
- <ejb-ref-name>ejb/EjbLink1Bean</ejb-ref-name>
- </ejb-ref>
- <ejb-ref>
- <ejb-ref-name>ejb/EjbLink3Bean</ejb-ref-name>
- </ejb-ref>
- </ejb>
-
- </enterprise-beans>
-</jboss>
Added: trunk/testsuite/src/resources/refs/resources/jboss.xml
===================================================================
--- trunk/testsuite/src/resources/refs/resources/jboss.xml (rev 0)
+++ trunk/testsuite/src/resources/refs/resources/jboss.xml 2008-04-25 14:33:41 UTC (rev 72733)
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss xmlns="http://www.jboss.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee
+ http://www.jboss.org/j2ee/schema/jboss_5_0.xsd" version="3.0">
+ <unauthenticated-principal>guest</unauthenticated-principal>
+ <enterprise-beans>
+ <ejb id="ResourceOnFieldBean">
+ <ejb-name>ResourceOnFieldBean</ejb-name>
+ <jndi-name>refs/resources/ResourceOnFieldBean</jndi-name>
+ <resource-ref>
+ <res-ref-name>dataSource</res-ref-name>
+ <jndi-name>java:DefaultDS</jndi-name>
+ </resource-ref>
+ <resource-ref>
+ <res-ref-name>myDataSource2</res-ref-name>
+ <jndi-name>java:DefaultDS</jndi-name>
+ </resource-ref>
+ <resource-ref>
+ <res-ref-name>mailSession</res-ref-name>
+ <jndi-name>java:/Mail</jndi-name>
+ </resource-ref>
+ <resource-ref>
+ <res-ref-name>url</res-ref-name>
+ <res-url>http://localhost:8080</res-url>
+ </resource-ref>
+ <resource-ref>
+ <res-ref-name>queueConnectionFactory</res-ref-name>
+ <jndi-name>java:/ConnectionFactory</jndi-name>
+ </resource-ref>
+ <resource-ref>
+ <res-ref-name>topicConnectionFactory</res-ref-name>
+ <jndi-name>java:/ConnectionFactory</jndi-name>
+ </resource-ref>
+ <resource-ref>
+ <res-ref-name>connectionFactoryQ</res-ref-name>
+ <jndi-name>java:/ConnectionFactory</jndi-name>
+ </resource-ref>
+ <resource-ref>
+ <res-ref-name>connectionFactoryT</res-ref-name>
+ <jndi-name>java:/ConnectionFactory</jndi-name>
+ </resource-ref>
+ <message-destination-ref>
+ <message-destination-ref-name>queue</message-destination-ref-name>
+ <jndi-name>queue/testQueue</jndi-name>
+ </message-destination-ref>
+ <message-destination-ref>
+ <message-destination-ref-name>topic</message-destination-ref-name>
+ <jndi-name>topic/testTopic</jndi-name>
+ </message-destination-ref>
+ </ejb>
+ <ejb id="ResourceOnMethodBean">
+ <ejb-name>ResourceOnMethodBean</ejb-name>
+ <jndi-name>refs/resources/ResourceOnMethodBean</jndi-name>
+ <resource-ref>
+ <res-ref-name>dataSource</res-ref-name>
+ <jndi-name>java:DefaultDS</jndi-name>
+ </resource-ref>
+ <resource-ref>
+ <res-ref-name>myDataSource2</res-ref-name>
+ <jndi-name>java:DefaultDS</jndi-name>
+ </resource-ref>
+ <resource-ref>
+ <res-ref-name>mailSession</res-ref-name>
+ <jndi-name>java:/Mail</jndi-name>
+ </resource-ref>
+ <resource-ref>
+ <res-ref-name>url</res-ref-name>
+ <res-url>http://localhost:8080</res-url>
+ </resource-ref>
+ <resource-ref>
+ <res-ref-name>queueConnectionFactory</res-ref-name>
+ <jndi-name>java:/ConnectionFactory</jndi-name>
+ </resource-ref>
+ <resource-ref>
+ <res-ref-name>topicConnectionFactory</res-ref-name>
+ <jndi-name>java:/ConnectionFactory</jndi-name>
+ </resource-ref>
+ <resource-ref>
+ <res-ref-name>connectionFactoryQ</res-ref-name>
+ <jndi-name>java:/ConnectionFactory</jndi-name>
+ </resource-ref>
+ <resource-ref>
+ <res-ref-name>connectionFactoryT</res-ref-name>
+ <jndi-name>java:/ConnectionFactory</jndi-name>
+ </resource-ref>
+ <message-destination-ref>
+ <message-destination-ref-name>queue</message-destination-ref-name>
+ <jndi-name>queue/testQueue</jndi-name>
+ </message-destination-ref>
+ <message-destination-ref>
+ <message-destination-ref-name>topic</message-destination-ref-name>
+ <jndi-name>topic/testTopic</jndi-name>
+ </message-destination-ref>
+ </ejb>
+ <ejb id="ResourcesOnClassBean">
+ <ejb-name>ResourcesOnClassBean</ejb-name>
+ <jndi-name>refs/resources/ResourcesOnClassBean</jndi-name>
+ <resource-ref>
+ <res-ref-name>dataSource</res-ref-name>
+ <jndi-name>java:DefaultDS</jndi-name>
+ </resource-ref>
+ <resource-ref>
+ <res-ref-name>myDataSource2</res-ref-name>
+ <jndi-name>java:DefaultDS</jndi-name>
+ </resource-ref>
+ <resource-ref>
+ <res-ref-name>mailSession</res-ref-name>
+ <jndi-name>java:/Mail</jndi-name>
+ </resource-ref>
+ <resource-ref>
+ <res-ref-name>url</res-ref-name>
+ <res-url>http://localhost:8080</res-url>
+ </resource-ref>
+ <resource-ref>
+ <res-ref-name>queueConnectionFactory</res-ref-name>
+ <jndi-name>java:/ConnectionFactory</jndi-name>
+ </resource-ref>
+ <resource-ref>
+ <res-ref-name>topicConnectionFactory</res-ref-name>
+ <jndi-name>java:/ConnectionFactory</jndi-name>
+ </resource-ref>
+ <resource-ref>
+ <res-ref-name>connectionFactoryQ</res-ref-name>
+ <jndi-name>java:/ConnectionFactory</jndi-name>
+ </resource-ref>
+ <resource-ref>
+ <res-ref-name>connectionFactoryT</res-ref-name>
+ <jndi-name>java:/ConnectionFactory</jndi-name>
+ </resource-ref>
+ <message-destination-ref>
+ <message-destination-ref-name>queue</message-destination-ref-name>
+ <jndi-name>queue/testQueue</jndi-name>
+ </message-destination-ref>
+ <message-destination-ref>
+ <message-destination-ref-name>topic</message-destination-ref-name>
+ <jndi-name>topic/testTopic</jndi-name>
+ </message-destination-ref>
+ </ejb>
+ </enterprise-beans>
+</jboss>
More information about the jboss-cvs-commits
mailing list