[jboss-cvs] JBossAS SVN: r71453 - in projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30: unit and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun Mar 30 18:49:59 EDT 2008


Author: ALRubinger
Date: 2008-03-30 18:49:59 -0400 (Sun, 30 Mar 2008)
New Revision: 71453

Added:
   projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/LocalSession30Business.java
   projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/StatefulSession30RemoteBusiness.java
Modified:
   projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/LocalSession30.java
   projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/Session30Bean.java
   projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/StatefulSession30.java
   projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/StatefulSession30Bean.java
   projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/unit/ReferenceTestCase.java
Log:
[EJBTHREE-1245] Resolved CCEs due to improper casting to local/remote from business interfaces in reference21_30 tests

Modified: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/LocalSession30.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/LocalSession30.java	2008-03-30 15:16:00 UTC (rev 71452)
+++ projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/LocalSession30.java	2008-03-30 22:49:59 UTC (rev 71453)
@@ -27,8 +27,8 @@
  * @version <tt>$Revision$</tt>
  * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
  */
-public interface LocalSession30 extends EJBLocalObject
+public interface LocalSession30 extends EJBLocalObject, LocalSession30Business
 {
-   public String access();
+   
 }
 

Added: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/LocalSession30Business.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/LocalSession30Business.java	                        (rev 0)
+++ projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/LocalSession30Business.java	2008-03-30 22:49:59 UTC (rev 71453)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.reference21_30;
+
+/**
+ * LocalSession30Business
+ * 
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public interface LocalSession30Business
+{
+   public String access();
+}

Modified: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/Session30Bean.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/Session30Bean.java	2008-03-30 15:16:00 UTC (rev 71452)
+++ projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/Session30Bean.java	2008-03-30 22:49:59 UTC (rev 71453)
@@ -30,9 +30,7 @@
 
 import org.jboss.ejb3.Container;
 import org.jboss.ejb3.annotation.LocalBinding;
-import org.jboss.ejb3.annotation.LocalHomeBinding;
 import org.jboss.ejb3.annotation.RemoteBinding;
-import org.jboss.ejb3.annotation.RemoteHomeBinding;
 import org.jboss.logging.Logger;
 
 /**
@@ -40,12 +38,12 @@
  * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
  */
 @Stateless(name="Session30")
- at Remote(Session30.class)
- at Local(LocalSession30.class)
+ at Remote({Session30.class, Session30RemoteBusiness.class})
+ at Local({LocalSession30.class, LocalSession30Business.class})
 @RemoteBinding(jndiBinding = "Session30Remote")
 @LocalBinding(jndiBinding = "LocalSession30")
 @EJBs({@EJB(name="injected", beanInterface=org.jboss.ejb3.test.reference21_30.Session21.class, beanName="Session21")})
-public class Session30Bean 
+public class Session30Bean implements Session30RemoteBusiness, LocalSession30Business
 {
    private static final Logger log = Logger.getLogger(Session30Bean.class);
 

Modified: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/StatefulSession30.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/StatefulSession30.java	2008-03-30 15:16:00 UTC (rev 71452)
+++ projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/StatefulSession30.java	2008-03-30 22:49:59 UTC (rev 71453)
@@ -27,14 +27,8 @@
  * @version <tt>$Revision$</tt>
  * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
  */
-public interface StatefulSession30 extends EJBObject
+public interface StatefulSession30 extends EJBObject, StatefulSession30RemoteBusiness
 {
-   void setValue(String value);
-   
-   String getValue();
-   
-   String accessLocalStateless();
-   
-   String accessLocalHome();
+
 }
 

Modified: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/StatefulSession30Bean.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/StatefulSession30Bean.java	2008-03-30 15:16:00 UTC (rev 71452)
+++ projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/StatefulSession30Bean.java	2008-03-30 22:49:59 UTC (rev 71453)
@@ -38,11 +38,13 @@
  */
 @Stateful(name="StatefulSession30")
 @Local({LocalStatefulSession30Business.class, LocalStatefulSession30.class})
- at Remote(StatefulSession30.class)
+ at Remote({StatefulSession30.class,StatefulSession30RemoteBusiness.class})
 @RemoteBinding(jndiBinding = "StatefulSession30Remote")
 @LocalBinding(jndiBinding = "LocalStatefulSession30")
-public class StatefulSession30Bean implements java.io.Serializable
+public class StatefulSession30Bean implements java.io.Serializable, StatefulSession30RemoteBusiness
 {
+   private static final long serialVersionUID = -8986168637251530390L;
+
    private static final Logger log = Logger.getLogger(StatefulSession30Bean.class);
    
    private String value = null;
@@ -87,7 +89,7 @@
       {
          InitialContext jndiContext = new InitialContext();
          StatefulSession30LocalHome home = (StatefulSession30LocalHome)jndiContext.lookup("HomedStatefulSession30/localHome");
-         LocalStatefulSession30Business session = (LocalStatefulSession30Business)home.create();
+         LocalStatefulSession30 session = (LocalStatefulSession30)home.create();
          session.setLocalValue("LocalHome");
          return session.getLocalValue();
       } catch (Exception e)

Added: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/StatefulSession30RemoteBusiness.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/StatefulSession30RemoteBusiness.java	                        (rev 0)
+++ projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/StatefulSession30RemoteBusiness.java	2008-03-30 22:49:59 UTC (rev 71453)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.reference21_30;
+
+/**
+ * StatefulSession30RemoteBusiness
+ * 
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public interface StatefulSession30RemoteBusiness
+{
+   void setValue(String value);
+   
+   String getValue();
+   
+   String accessLocalStateless();
+   
+   String accessLocalHome();
+}

Modified: projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/unit/ReferenceTestCase.java
===================================================================
--- projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/unit/ReferenceTestCase.java	2008-03-30 15:16:00 UTC (rev 71452)
+++ projects/ejb3/trunk/core/src/test/java/org/jboss/ejb3/test/reference21_30/unit/ReferenceTestCase.java	2008-03-30 22:49:59 UTC (rev 71453)
@@ -28,14 +28,18 @@
 import javax.ejb.Handle;
 import javax.ejb.HomeHandle;
 import javax.naming.InitialContext;
+
+import junit.framework.Test;
+
 import org.jboss.ejb3.test.reference21_30.Session21;
 import org.jboss.ejb3.test.reference21_30.Session30;
 import org.jboss.ejb3.test.reference21_30.Session30Home;
+import org.jboss.ejb3.test.reference21_30.Session30RemoteBusiness;
 import org.jboss.ejb3.test.reference21_30.StatefulSession30;
 import org.jboss.ejb3.test.reference21_30.StatefulSession30Home;
+import org.jboss.ejb3.test.reference21_30.StatefulSession30RemoteBusiness;
 import org.jboss.logging.Logger;
 import org.jboss.test.JBossTestCase;
-import junit.framework.Test;
 
 /**
  * Test for EJB3.0/EJB2.1 references
@@ -141,7 +145,7 @@
    {
       InitialContext jndiContext = new InitialContext();
       
-      StatefulSession30 session = (StatefulSession30) jndiContext.lookup("StatefulSession30Remote");
+      StatefulSession30RemoteBusiness session = (StatefulSession30RemoteBusiness) jndiContext.lookup("StatefulSession30Remote");
       assertNotNull(session);
       session.setValue("testing");
       String value = session.getValue();
@@ -193,7 +197,7 @@
    {
       InitialContext jndiContext = new InitialContext();
       
-      StatefulSession30 session = (StatefulSession30) jndiContext.lookup("StatefulSession30Remote");
+      StatefulSession30RemoteBusiness session = (StatefulSession30RemoteBusiness) jndiContext.lookup("StatefulSession30Remote");
       
       String access = session.accessLocalHome();
       assertEquals("LocalHome", access);
@@ -203,12 +207,13 @@
    {
       InitialContext jndiContext = new InitialContext();
       
-      StatefulSession30 statefulSession = (StatefulSession30) jndiContext.lookup("StatefulSession30Remote");
+      StatefulSession30RemoteBusiness statefulSession = (StatefulSession30RemoteBusiness) jndiContext
+            .lookup("StatefulSession30Remote");
       assertNotNull(statefulSession);
       String access = statefulSession.accessLocalStateless();
       assertEquals("Session30", access);
       
-      Session30 session = (Session30) jndiContext.lookup("Session30Remote");
+      Session30RemoteBusiness session = (Session30RemoteBusiness) jndiContext.lookup("Session30Remote");
       assertNotNull(session);
       access = session.accessLocalStateful();
       assertEquals("default", access);
@@ -224,12 +229,13 @@
    {
       InitialContext jndiContext = new InitialContext();
            
-      StatefulSession30 session1 = (StatefulSession30) jndiContext.lookup("StatefulSession30Remote");
-      assertNotNull(session1);
+      StatefulSession30RemoteBusiness session1 = (StatefulSession30RemoteBusiness) jndiContext
+            .lookup("StatefulSession30Remote");      assertNotNull(session1);
       session1.setValue("testing");
       assertEquals("testing", session1.getValue());
       
-      StatefulSession30 session2 = (StatefulSession30) jndiContext.lookup("StatefulSession30Remote");
+      StatefulSession30RemoteBusiness session2 = (StatefulSession30RemoteBusiness) jndiContext
+            .lookup("StatefulSession30Remote");
       assertNotNull(session2);
       assertEquals("default", session2.getValue());
      
@@ -257,7 +263,8 @@
       assertNotNull(session7);
       assertEquals("secondinit", session7.getValue());
       
-      StatefulSession30 session8 = (StatefulSession30) jndiContext.lookup("StatefulSession30Remote");
+      StatefulSession30RemoteBusiness session8 = (StatefulSession30RemoteBusiness) jndiContext
+            .lookup("StatefulSession30Remote");
       assertNotNull(session8);
       assertEquals("default", session8.getValue());
       




More information about the jboss-cvs-commits mailing list