Author: slaws
Date: Fri Aug  7 11:16:41 2009
New Revision: 801951

URL: http://svn.apache.org/viewvc?rev=801951&view=rev
Log:
TUSCANY-3198 - keep generated EJB component implementations distinct. They were 
being resolved down to one because the hashcode was not based on any unique EJB 
information

Added:
    
tuscany/branches/sca-java-1.x/itest/contribution-jee-samples/ejb-nonenhanced/src/main/java/sample/ejb3/HelloworldService7aBean.java
   (with props)
Modified:
    
tuscany/branches/sca-java-1.x/itest/contribution-jee/src/test/java/org/apache/tuscany/sca/test/contribution/jee/SCAJarEarNonenhancedTestCase.java
    
tuscany/branches/sca-java-1.x/modules/contribution-jee/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/EJBImplementationGeneratedImpl.java

Added: 
tuscany/branches/sca-java-1.x/itest/contribution-jee-samples/ejb-nonenhanced/src/main/java/sample/ejb3/HelloworldService7aBean.java
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/itest/contribution-jee-samples/ejb-nonenhanced/src/main/java/sample/ejb3/HelloworldService7aBean.java?rev=801951&view=auto
==============================================================================
--- 
tuscany/branches/sca-java-1.x/itest/contribution-jee-samples/ejb-nonenhanced/src/main/java/sample/ejb3/HelloworldService7aBean.java
 (added)
+++ 
tuscany/branches/sca-java-1.x/itest/contribution-jee-samples/ejb-nonenhanced/src/main/java/sample/ejb3/HelloworldService7aBean.java
 Fri Aug  7 11:16:41 2009
@@ -0,0 +1,41 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package sample.ejb3;
+
+import javax.ejb.Stateless;
+
+/**
+ * Another HelloworldService EJB implementation with no SCA enhancement
+ * A test for TUSCANY-3198
+ */
+...@stateless
+public class HelloworldService7aBean implements HelloworldService7, 
HelloworldLocal7 {
+
+    public String getGreetings(String name) {
+        String greeting = "Hello remote " + name;
+        System.out.println(greeting);
+        return greeting;
+    }
+    
+    public String getGreetingsLocal(String name) {
+        String greeting = "Hello local " + name;
+        System.out.println(greeting);
+        return greeting;
+    }
+
+}

Propchange: 
tuscany/branches/sca-java-1.x/itest/contribution-jee-samples/ejb-nonenhanced/src/main/java/sample/ejb3/HelloworldService7aBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
tuscany/branches/sca-java-1.x/itest/contribution-jee-samples/ejb-nonenhanced/src/main/java/sample/ejb3/HelloworldService7aBean.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: 
tuscany/branches/sca-java-1.x/itest/contribution-jee/src/test/java/org/apache/tuscany/sca/test/contribution/jee/SCAJarEarNonenhancedTestCase.java
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/itest/contribution-jee/src/test/java/org/apache/tuscany/sca/test/contribution/jee/SCAJarEarNonenhancedTestCase.java?rev=801951&r1=801950&r2=801951&view=diff
==============================================================================
--- 
tuscany/branches/sca-java-1.x/itest/contribution-jee/src/test/java/org/apache/tuscany/sca/test/contribution/jee/SCAJarEarNonenhancedTestCase.java
 (original)
+++ 
tuscany/branches/sca-java-1.x/itest/contribution-jee/src/test/java/org/apache/tuscany/sca/test/contribution/jee/SCAJarEarNonenhancedTestCase.java
 Fri Aug  7 11:16:41 2009
@@ -127,7 +127,7 @@
         Assert.assertNotNull(composite);
         
         Assert.assertEquals(2, composite.getComponents().size());
-        Assert.assertEquals(2, 
composite.getComponents().get(1).getImplementation().getServices().size());
+        Assert.assertEquals(4, 
composite.getComponents().get(1).getImplementation().getServices().size());
         Assert.assertEquals("HelloworldService7Bean_HelloworldService7", 
composite.getComponents().get(1).getImplementation().getServices().get(0).getName());
         
         domain.buildComposite(composite);

Modified: 
tuscany/branches/sca-java-1.x/modules/contribution-jee/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/EJBImplementationGeneratedImpl.java
URL: 
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/contribution-jee/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/EJBImplementationGeneratedImpl.java?rev=801951&r1=801950&r2=801951&view=diff
==============================================================================
--- 
tuscany/branches/sca-java-1.x/modules/contribution-jee/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/EJBImplementationGeneratedImpl.java
 (original)
+++ 
tuscany/branches/sca-java-1.x/modules/contribution-jee/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/EJBImplementationGeneratedImpl.java
 Fri Aug  7 11:16:41 2009
@@ -66,5 +66,12 @@
        public void setEjbModuleInfo(EjbModuleInfo ejbModuleInfo) {
                this.ejbModuleInfo = ejbModuleInfo;
        }
+       
+       // make sure the generated implementation can be distinguished 
+       // based on the ejb info that is referenced
+       @Override
+       public int hashCode() {
+           return getEJBInfo().hashCode();
+       }
     
 }


Reply via email to