[jboss-cvs] JBossAS SVN: r63382 - in trunk/ejb3: src/resources/test and 5 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jun 7 04:49:10 EDT 2007


Author: wolfc
Date: 2007-06-07 04:49:10 -0400 (Thu, 07 Jun 2007)
New Revision: 63382

Added:
   trunk/ejb3/src/resources/test/ejbthree989/
   trunk/ejb3/src/resources/test/ejbthree989/META-INF/
   trunk/ejb3/src/resources/test/ejbthree989/META-INF/jboss.xml
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree989/
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree989/ResUrlChecker.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree989/ResUrlCheckerBean.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree989/unit/
   trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree989/unit/ResUrlCheckerTestCase.java
Modified:
   trunk/ejb3/build-test.xml
Log:
EJBTHREE-989: unit test

Modified: trunk/ejb3/build-test.xml
===================================================================
--- trunk/ejb3/build-test.xml	2007-06-07 07:00:39 UTC (rev 63381)
+++ trunk/ejb3/build-test.xml	2007-06-07 08:49:10 UTC (rev 63382)
@@ -2021,6 +2021,13 @@
       <build-simple-jar name="ejbthree985"/>
    </target>
    
+   <target name="ejbthree989"
+      description="Builds a simple jar file."
+      depends="compile-classes">
+      
+      <build-simple-jar name="ejbthree989"/>
+   </target>
+   
    <target name="jaxws"
       description="Builds a simple jar."
       depends="compile-classes">
@@ -3339,7 +3346,7 @@
    <target name="jars" depends="appclient, tck5sec, invalidtxmdb, descriptortypo, libdeployment, homeinterface, timestampentity, arjuna, mdbtransactions, unauthenticatedprincipal, clusteredservice, invoker, classloader, 
       circulardependency, jsp, timerdependency, servicedependency, servlet, stateless14, webservices, ear, ejbthree440, 
       ejbthree454, ejbthree653, ejbthree670, ejbthree712, ejbthree724, ejbthree751, ejbthree921, ejbthree936, ejbthree939,
-      ejbthree953, ejbthree957, ejbthree959, ejbthree963, ejbthree967, ejbthree971, ejbthree973, ejbthree985,
+      ejbthree953, ejbthree957, ejbthree959, ejbthree963, ejbthree967, ejbthree971, ejbthree973, ejbthree985, ejbthree989,
       aspectdomain, ejbcontext, schema, mail, scopedclassloader, dependency, 
       securitydomain, enventry, 
       jms/managed, naming, bmt, jca/inflowmdb, pool, jms, security, reference21_30, factory, dd/web, txexceptions, 
@@ -4206,6 +4213,9 @@
       <antcall target="test" inheritRefs="true">
          <param name="test" value="ejbthree985"/>
       </antcall>
+      <antcall target="test" inheritRefs="true">
+         <param name="test" value="ejbthree989"/>
+      </antcall>
    </target>
 
    <target name="entity-tests" depends="init" description="Execute all tests">

Added: trunk/ejb3/src/resources/test/ejbthree989/META-INF/jboss.xml
===================================================================
--- trunk/ejb3/src/resources/test/ejbthree989/META-INF/jboss.xml	                        (rev 0)
+++ trunk/ejb3/src/resources/test/ejbthree989/META-INF/jboss.xml	2007-06-07 08:49:10 UTC (rev 63382)
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<jboss
+        xmlns="http://java.sun.com/xml/ns/javaee"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+                            http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
+        version="3.0">
+   <enterprise-beans>
+      <session>
+         <ejb-name>ResUrlCheckerBean</ejb-name>
+         <resource-ref>
+         	<res-ref-name>url2</res-ref-name>
+         	<res-url>http://localhost/url2</res-url>
+         </resource-ref>
+      </session>
+   </enterprise-beans>
+</jboss>
\ No newline at end of file


Property changes on: trunk/ejb3/src/resources/test/ejbthree989/META-INF/jboss.xml
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree989/ResUrlChecker.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree989/ResUrlChecker.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree989/ResUrlChecker.java	2007-06-07 08:49:10 UTC (rev 63382)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree989;
+
+import java.net.URL;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public interface ResUrlChecker
+{
+   URL getURL1();
+   URL getURL2();
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree989/ResUrlChecker.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree989/ResUrlCheckerBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree989/ResUrlCheckerBean.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree989/ResUrlCheckerBean.java	2007-06-07 08:49:10 UTC (rev 63382)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree989;
+
+import java.net.URL;
+
+import javax.annotation.Resource;
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+
+/**
+ * Let's see what we can do with resources of the URL breed.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Stateless
+ at Remote(ResUrlChecker.class)
+public class ResUrlCheckerBean implements ResUrlChecker
+{
+   @Resource(mappedName="http://localhost")
+   private URL url1;
+   
+   // coming in via res-url
+   @Resource(name="url2")
+   private URL url2;
+   
+   public URL getURL1()
+   {
+      return url1;
+   }
+   
+   public URL getURL2()
+   {
+      return url2;
+   }
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree989/ResUrlCheckerBean.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree989/unit/ResUrlCheckerTestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree989/unit/ResUrlCheckerTestCase.java	                        (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree989/unit/ResUrlCheckerTestCase.java	2007-06-07 08:49:10 UTC (rev 63382)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.ejbthree989.unit;
+
+import java.net.URL;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.test.ejbthree989.ResUrlChecker;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Test to see if resources of type URL work.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision$
+ */
+public class ResUrlCheckerTestCase extends JBossTestCase
+{
+   public ResUrlCheckerTestCase(String name)
+   {
+      super(name);
+   }
+
+   private ResUrlChecker lookupBean() throws Exception
+   {
+      return (ResUrlChecker) getInitialContext().lookup("ResUrlCheckerBean/remote");
+   }
+   
+   public void test1() throws Exception
+   {
+      ResUrlChecker bean = lookupBean();
+      // defined in ResUrlCheckerBean
+      URL expected = new URL("http://localhost");
+      URL actual = bean.getURL1();
+      assertEquals(expected, actual);
+   }
+   
+   public void test2() throws Exception
+   {
+      ResUrlChecker bean = lookupBean();
+      // defined in jboss.xml
+      URL expected = new URL("http://localhost/url2");
+      URL actual = bean.getURL2();
+      assertEquals(expected, actual);
+   }
+   
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(ResUrlCheckerTestCase.class, "ejbthree989.jar");
+   }
+}


Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree989/unit/ResUrlCheckerTestCase.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native




More information about the jboss-cvs-commits mailing list