[jboss-cvs] JBossAS SVN: r72450 - in trunk/testsuite: src/main/org/jboss/test/ee5client and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Apr 18 12:36:56 EDT 2008


Author: scott.stark at jboss.org
Date: 2008-04-18 12:36:56 -0400 (Fri, 18 Apr 2008)
New Revision: 72450

Added:
   trunk/testsuite/src/main/org/jboss/test/ee5client/ejb/
   trunk/testsuite/src/main/org/jboss/test/ee5client/ejb/HelloWorldBean.java
   trunk/testsuite/src/main/org/jboss/test/ee5client/ejb/HelloWorldService.java
   trunk/testsuite/src/main/org/jboss/test/ee5client/ejb/MessageReplierBean.java
Removed:
   trunk/testsuite/src/main/org/jboss/test/ee5client/HelloWorldBean.java
   trunk/testsuite/src/main/org/jboss/test/ee5client/HelloWorldService.java
   trunk/testsuite/src/main/org/jboss/test/ee5client/MessageReplierBean.java
Modified:
   trunk/testsuite/imports/sections/ee5client.xml
   trunk/testsuite/src/main/org/jboss/test/ee5client/client/HelloWorldClient.java
   trunk/testsuite/src/main/org/jboss/test/ee5client/unit/AppClientUnitTestCase.java
Log:
Correct the ee5 AppClientUnitTestCase packaging

Modified: trunk/testsuite/imports/sections/ee5client.xml
===================================================================
--- trunk/testsuite/imports/sections/ee5client.xml	2008-04-18 15:48:10 UTC (rev 72449)
+++ trunk/testsuite/imports/sections/ee5client.xml	2008-04-18 16:36:56 UTC (rev 72450)
@@ -2,6 +2,7 @@
 <target name="_jars-ee5client">
       <mkdir dir="${build.lib}"/>
 
+	   <!-- The app client jar -->
       <jar jarfile="${build.lib}/ee5client-test-client.jar" manifest="${build.resources}/ee5client/Manifest">
          <zipfileset prefix="META-INF" dir="${build.resources}/ee5client">
             <include name="application-client.xml"/>
@@ -12,10 +13,10 @@
             <include name="org/jboss/test/ee5client/client/HelloWorldClient.class"/>
          </fileset>
       </jar>
-
+      <!-- The ejb jar -->
       <jar jarfile="${build.lib}/ee5client-test.jar">
          <fileset dir="${build.classes}">
-            <include name="org/jboss/test/ee5client/unit/*.class"/>
+            <include name="org/jboss/test/ee5client/ejb/*.class"/>
          </fileset>
       </jar>
 

Deleted: trunk/testsuite/src/main/org/jboss/test/ee5client/HelloWorldBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/ee5client/HelloWorldBean.java	2008-04-18 15:48:10 UTC (rev 72449)
+++ trunk/testsuite/src/main/org/jboss/test/ee5client/HelloWorldBean.java	2008-04-18 16:36:56 UTC (rev 72450)
@@ -1,41 +0,0 @@
-/*
-  * 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.test.ee5client;
-
-import javax.ejb.Remote;
-import javax.ejb.Stateless;
-
-/**
- * Comment
- *
- * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
- at Stateless
- at Remote(HelloWorldService.class)
-public class HelloWorldBean implements HelloWorldService
-{
-   public String sayHelloTo(String name)
-   {
-      return "Hi " + name;
-   }
-}

Deleted: trunk/testsuite/src/main/org/jboss/test/ee5client/HelloWorldService.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/ee5client/HelloWorldService.java	2008-04-18 15:48:10 UTC (rev 72449)
+++ trunk/testsuite/src/main/org/jboss/test/ee5client/HelloWorldService.java	2008-04-18 16:36:56 UTC (rev 72450)
@@ -1,33 +0,0 @@
-/*
-  * 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.test.ee5client;
-
-/**
- * Comment
- *
- * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
-public interface HelloWorldService
-{
-   String sayHelloTo(String name);
-}

Deleted: trunk/testsuite/src/main/org/jboss/test/ee5client/MessageReplierBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/ee5client/MessageReplierBean.java	2008-04-18 15:48:10 UTC (rev 72449)
+++ trunk/testsuite/src/main/org/jboss/test/ee5client/MessageReplierBean.java	2008-04-18 16:36:56 UTC (rev 72450)
@@ -1,86 +0,0 @@
-/*
-  * 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.test.ee5client;
-
-import javax.annotation.Resource;
-import javax.ejb.ActivationConfigProperty;
-import javax.ejb.EJBException;
-import javax.ejb.MessageDriven;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-
-import org.jboss.logging.Logger;
-
-/**
- * This message bean will just reply the message.
- *
- * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
- */
- at MessageDriven(activationConfig = {
-   @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
-   @ActivationConfigProperty(propertyName="destination", propertyValue="queue/messageReplier")
-})
-public class MessageReplierBean implements MessageListener
-{
-   private static final Logger log = Logger.getLogger(MessageReplierBean.class);
-   
-   @Resource(mappedName="java:ConnectionFactory")
-   private ConnectionFactory connectionFactory;
-   
-   public void onMessage(Message message)
-   {
-      try
-      {
-         if(message.getJMSReplyTo() != null)
-         {
-            Destination destination = message.getJMSReplyTo();
-            
-            Connection conn = connectionFactory.createConnection();
-            try
-            {
-               Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-               MessageProducer producer = session.createProducer(destination);
-               producer.send(destination, message);
-               producer.close();
-               session.close();
-            }
-            finally
-            {
-               conn.close();
-            }
-         }
-         else
-            log.info("no reply to specified");
-      }
-      catch(JMSException e)
-      {
-         throw new EJBException(e);
-      }
-   }
-}

Modified: trunk/testsuite/src/main/org/jboss/test/ee5client/client/HelloWorldClient.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/ee5client/client/HelloWorldClient.java	2008-04-18 15:48:10 UTC (rev 72449)
+++ trunk/testsuite/src/main/org/jboss/test/ee5client/client/HelloWorldClient.java	2008-04-18 16:36:56 UTC (rev 72450)
@@ -32,7 +32,7 @@
 import javax.jms.Session;
 import javax.jms.TextMessage;
 
-import org.jboss.test.ee5client.HelloWorldService;
+import org.jboss.test.ee5client.ejb.HelloWorldService;
 
 /**
  * Comment

Copied: trunk/testsuite/src/main/org/jboss/test/ee5client/ejb/HelloWorldBean.java (from rev 72168, trunk/testsuite/src/main/org/jboss/test/ee5client/HelloWorldBean.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/ee5client/ejb/HelloWorldBean.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/ee5client/ejb/HelloWorldBean.java	2008-04-18 16:36:56 UTC (rev 72450)
@@ -0,0 +1,41 @@
+/*
+  * 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.test.ee5client.ejb;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Stateless
+ at Remote(HelloWorldService.class)
+public class HelloWorldBean implements HelloWorldService
+{
+   public String sayHelloTo(String name)
+   {
+      return "Hi " + name;
+   }
+}

Copied: trunk/testsuite/src/main/org/jboss/test/ee5client/ejb/HelloWorldService.java (from rev 72168, trunk/testsuite/src/main/org/jboss/test/ee5client/HelloWorldService.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/ee5client/ejb/HelloWorldService.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/ee5client/ejb/HelloWorldService.java	2008-04-18 16:36:56 UTC (rev 72450)
@@ -0,0 +1,33 @@
+/*
+  * 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.test.ee5client.ejb;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public interface HelloWorldService
+{
+   String sayHelloTo(String name);
+}

Copied: trunk/testsuite/src/main/org/jboss/test/ee5client/ejb/MessageReplierBean.java (from rev 72168, trunk/testsuite/src/main/org/jboss/test/ee5client/MessageReplierBean.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/ee5client/ejb/MessageReplierBean.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/ee5client/ejb/MessageReplierBean.java	2008-04-18 16:36:56 UTC (rev 72450)
@@ -0,0 +1,86 @@
+/*
+  * 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.test.ee5client.ejb;
+
+import javax.annotation.Resource;
+import javax.ejb.ActivationConfigProperty;
+import javax.ejb.EJBException;
+import javax.ejb.MessageDriven;
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+
+import org.jboss.logging.Logger;
+
+/**
+ * This message bean will just reply the message.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at MessageDriven(activationConfig = {
+   @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
+   @ActivationConfigProperty(propertyName="destination", propertyValue="queue/messageReplier")
+})
+public class MessageReplierBean implements MessageListener
+{
+   private static final Logger log = Logger.getLogger(MessageReplierBean.class);
+   
+   @Resource(mappedName="java:ConnectionFactory")
+   private ConnectionFactory connectionFactory;
+   
+   public void onMessage(Message message)
+   {
+      try
+      {
+         if(message.getJMSReplyTo() != null)
+         {
+            Destination destination = message.getJMSReplyTo();
+            
+            Connection conn = connectionFactory.createConnection();
+            try
+            {
+               Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+               MessageProducer producer = session.createProducer(destination);
+               producer.send(destination, message);
+               producer.close();
+               session.close();
+            }
+            finally
+            {
+               conn.close();
+            }
+         }
+         else
+            log.info("no reply to specified");
+      }
+      catch(JMSException e)
+      {
+         throw new EJBException(e);
+      }
+   }
+}

Modified: trunk/testsuite/src/main/org/jboss/test/ee5client/unit/AppClientUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/ee5client/unit/AppClientUnitTestCase.java	2008-04-18 15:48:10 UTC (rev 72449)
+++ trunk/testsuite/src/main/org/jboss/test/ee5client/unit/AppClientUnitTestCase.java	2008-04-18 16:36:56 UTC (rev 72450)
@@ -22,7 +22,12 @@
 package org.jboss.test.ee5client.unit;
 
 import java.util.Date;
+import java.util.Properties;
 
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
 import junit.framework.Test;
 
 import org.jboss.ejb3.client.ClientLauncher;
@@ -50,7 +55,8 @@
       String args[] = { name };
       
       ClientLauncher launcher = new ClientLauncher();
-      launcher.launch(mainClassName, applicationClientName, args);
+      Properties env = getENCProps(applicationClientName);
+      launcher.launch(mainClassName, applicationClientName, args, env);
       
       {
          String actual = HelloWorldClient.getResult();
@@ -64,7 +70,16 @@
          assertEquals("postConstruct should be called once", expected, actual);
       }
    }
-   
+   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;
+   }
    public static Test suite() throws Exception
    {
       return getDeploySetup(AppClientUnitTestCase.class, "ee5client-jms-service.xml,ee5client-test.ear");




More information about the jboss-cvs-commits mailing list