[jboss-cvs] JBossAS SVN: r66021 - in trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062: unit and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Oct 11 07:26:44 EDT 2007
Author: wolfc
Date: 2007-10-11 07:26:44 -0400 (Thu, 11 Oct 2007)
New Revision: 66021
Added:
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/Calculator.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/CalculatorBean.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/SuperBean.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/SuperInterface.java
Modified:
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/Tester.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/TesterBean.java
trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/unit/DefaultLocalBusinessUnitTestCase.java
Log:
EJBTHREE-1062: expanded unit test
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/Calculator.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/Calculator.java (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/Calculator.java 2007-10-11 11:26:44 UTC (rev 66021)
@@ -0,0 +1,33 @@
+/*
+ * 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.ejbthree1062;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public interface Calculator extends SuperInterface
+{
+
+}
Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/Calculator.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/CalculatorBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/CalculatorBean.java (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/CalculatorBean.java 2007-10-11 11:26:44 UTC (rev 66021)
@@ -0,0 +1,43 @@
+/*
+ * 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.ejbthree1062;
+
+import javax.ejb.Local;
+import javax.ejb.Stateless;
+
+/**
+ * The calculator bean extends one interface and a superclass.
+ * The calculator interface extends the super interface implemented by the superclass, so
+ * in effect the calculator bean only implements the calculator interface.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Stateless
+ at Local
+public class CalculatorBean extends SuperBean implements Calculator
+{
+ public int add(int a, int b)
+ {
+ return a + b;
+ }
+}
Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/CalculatorBean.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/SuperBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/SuperBean.java (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/SuperBean.java 2007-10-11 11:26:44 UTC (rev 66021)
@@ -0,0 +1,33 @@
+/*
+ * 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.ejbthree1062;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public abstract class SuperBean implements SuperInterface
+{
+
+}
Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/SuperBean.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/SuperInterface.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/SuperInterface.java (rev 0)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/SuperInterface.java 2007-10-11 11:26:44 UTC (rev 66021)
@@ -0,0 +1,33 @@
+/*
+ * 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.ejbthree1062;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public interface SuperInterface
+{
+ int add(int a, int b);
+}
Property changes on: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/SuperInterface.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/Tester.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/Tester.java 2007-10-11 10:41:28 UTC (rev 66020)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/Tester.java 2007-10-11 11:26:44 UTC (rev 66021)
@@ -27,10 +27,10 @@
* Comment
*
* @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
+ * @version $Revision$
*/
@Remote
-public interface Tester extends CommonInterface
+public interface Tester extends CommonInterface, SuperInterface
{
}
Modified: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/TesterBean.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/TesterBean.java 2007-10-11 10:41:28 UTC (rev 66020)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/TesterBean.java 2007-10-11 11:26:44 UTC (rev 66021)
@@ -28,16 +28,25 @@
* Comment
*
* @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
+ * @version $Revision$
*/
@Stateless
public class TesterBean implements Tester
{
@EJB
+ private Calculator calculator;
+
+ @EJB
private MyStatelessLocal bean;
+ public int add(int a, int b)
+ {
+ return calculator.add(a, b);
+ }
+
public String sayHiTo(String name)
{
return bean.sayHiTo(name);
}
+
}
Modified: trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/unit/DefaultLocalBusinessUnitTestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/unit/DefaultLocalBusinessUnitTestCase.java 2007-10-11 10:41:28 UTC (rev 66020)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/ejbthree1062/unit/DefaultLocalBusinessUnitTestCase.java 2007-10-11 11:26:44 UTC (rev 66021)
@@ -37,7 +37,7 @@
* tion on the bean class or interface or by means of the deployment descriptor.
*
* @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision: $
+ * @version $Revision$
*/
public class DefaultLocalBusinessUnitTestCase extends JBossTestCase
{
@@ -51,6 +51,22 @@
return getDeploySetup(DefaultLocalBusinessUnitTestCase.class, "ejbthree1062.jar");
}
+ public void testCalculator() throws Exception
+ {
+ // Guard for errors
+ try
+ {
+ getInitialContext().lookup("CalculatorBean/local");
+ }
+ catch(NameNotFoundException e)
+ {
+ fail("CalculatorBean was not deployed properly");
+ }
+ Tester tester = (Tester) getInitialContext().lookup("TesterBean/remote");
+ int actual = tester.add(1, 2);
+ assertEquals(3, actual);
+ }
+
public void testSayHiTo() throws Exception
{
// Guard for errors
More information about the jboss-cvs-commits
mailing list