diff --git a/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnterpriseBeansMetaData.java b/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnterpriseBeansMetaData.java index 78d97db..cd4e502 100644 --- a/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnterpriseBeansMetaData.java +++ b/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnterpriseBeansMetaData.java @@ -21,7 +21,10 @@ */ package org.jboss.metadata.ejb.jboss; +import java.util.HashMap; + import javax.xml.bind.annotation.XmlTransient; +import javax.xml.bind.annotation.XmlType; import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData; import org.jboss.metadata.ejb.spec.EnterpriseBeansMap; @@ -195,8 +198,6 @@ public class JBossEnterpriseBeansMetaData public void merge(JBossEnterpriseBeansMetaData override, JBossEnterpriseBeansMetaData original) { - super.merge(override, original); - /* HashMap ejbClassToName = new HashMap(); if(override != null) { @@ -215,7 +216,6 @@ public class JBossEnterpriseBeansMetaData } } } - */ // first get the original beans without the corresponding override entry if(original != null) @@ -230,12 +230,9 @@ public class JBossEnterpriseBeansMetaData if(match == null) { // Lookup by the unqualified ejb class - /* String xmlEjbName = ejbClassToName.get(ejbName); if(xmlEjbName == null) add(bean); - */ - add(bean); } } else @@ -255,7 +252,6 @@ public class JBossEnterpriseBeansMetaData { String name = bean.getEjbName(); annBean = original.get(name); - /* if(annBean == null) { // Lookup by the unqualified ejb class @@ -269,7 +265,6 @@ public class JBossEnterpriseBeansMetaData annBean = original.get(className); } } - */ } // Merge diff --git a/src/test/java/org/jboss/test/metadata/jbmeta154/StatefulTimeout.java b/src/test/java/org/jboss/test/metadata/jbmeta154/StatefulTimeout.java deleted file mode 100644 index 80abf8a..0000000 --- a/src/test/java/org/jboss/test/metadata/jbmeta154/StatefulTimeout.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.test.metadata.jbmeta154; - -/** - * @author Carlo de Wolf - * @version $Revision: $ - */ -public interface StatefulTimeout -{ - -} diff --git a/src/test/java/org/jboss/test/metadata/jbmeta154/StatefulTimeoutBean.java b/src/test/java/org/jboss/test/metadata/jbmeta154/StatefulTimeoutBean.java deleted file mode 100644 index 004abb7..0000000 --- a/src/test/java/org/jboss/test/metadata/jbmeta154/StatefulTimeoutBean.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.test.metadata.jbmeta154; - -import javax.ejb.Remote; -import javax.ejb.Stateful; - -/** - * @author Carlo de Wolf - * @version $Revision: $ - */ -@Stateful -@Remote(StatefulTimeout.class) -public class StatefulTimeoutBean implements StatefulTimeout -{ -} diff --git a/src/test/java/org/jboss/test/metadata/jbmeta154/unit/MergeBeanDefinitionsTestCase.java b/src/test/java/org/jboss/test/metadata/jbmeta154/unit/MergeBeanDefinitionsTestCase.java deleted file mode 100644 index e702788..0000000 --- a/src/test/java/org/jboss/test/metadata/jbmeta154/unit/MergeBeanDefinitionsTestCase.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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.test.metadata.jbmeta154.unit; - -import java.lang.reflect.AnnotatedElement; -import java.util.Collection; - -import org.jboss.metadata.annotation.creator.ejb.jboss.JBoss50Creator; -import org.jboss.metadata.annotation.finder.AnnotationFinder; -import org.jboss.metadata.annotation.finder.DefaultAnnotationFinder; -import org.jboss.metadata.ejb.jboss.JBoss50MetaData; -import org.jboss.metadata.ejb.jboss.JBossMetaData; -import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData; -import org.jboss.metadata.ejb.spec.EjbJar30MetaData; -import org.jboss.metadata.ejb.spec.EjbJarMetaData; -import org.jboss.test.metadata.common.PackageScanner; -import org.jboss.test.metadata.common.ScanPackage; -import org.jboss.test.metadata.ejb.AbstractEJBEverythingTest; -import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver; -import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver; - -/** - * @author Carlo de Wolf - * @version $Revision: $ - */ -public class MergeBeanDefinitionsTestCase extends AbstractEJBEverythingTest -{ - public MergeBeanDefinitionsTestCase(String name) - { - super(name); - } - - public static SchemaBindingResolver initResolver() - { - DefaultSchemaResolver resolver = new DefaultSchemaResolver(); -// resolver.addClassBindingForLocation("ejb-jar_2_0.dtd", EjbJar20MetaData.class); -// resolver.addClassBindingForLocation("ejb-jar_2_1.xsd", EjbJar21MetaData.class); - resolver.addClassBindingForLocation("ejb-jar_3_0.xsd", EjbJar30MetaData.class); -// resolver.addClassBindingForLocation("jboss_3_0.dtd", JBoss50DTDMetaData.class); -// resolver.addClassBindingForLocation("jboss_3_2.dtd", JBoss50DTDMetaData.class); -// resolver.addClassBindingForLocation("jboss_4_0.dtd", JBoss50DTDMetaData.class); -// resolver.addClassBindingForLocation("jboss_4_2.dtd", JBoss50DTDMetaData.class); -// resolver.addClassBindingForLocation("jboss_5_0.dtd", JBoss50DTDMetaData.class); - resolver.addClassBindingForLocation("jboss_5_0.xsd", JBoss50MetaData.class); - // Set the JBoss50DTDMetaData class as the default for the jboss root element -// resolver.addClassBindingForLocation("jboss", JBoss50DTDMetaData.class); - // Workaround wildard resolution slowness - resolver.addClassBinding("http://www.jboss.com/xml/ns/javaee", JBoss50MetaData.class); - return resolver; - } - - @ScanPackage("org.jboss.test.metadata.jbmeta154") - public void test1() throws Exception - { - EjbJarMetaData ejbJarMetaData = unmarshal("ejb-jar.xml", EjbJarMetaData.class); - - AnnotationFinder finder = new DefaultAnnotationFinder(); - JBoss50Creator creator = new JBoss50Creator(finder); - - Collection> classes = PackageScanner.loadClasses(); - - JBoss50MetaData annotatedMetaData = creator.create(classes); - - JBossMetaData specMetaData = new JBoss50MetaData(); - specMetaData.merge(null, ejbJarMetaData); - - JBoss50MetaData mergedMetaData = new JBoss50MetaData(); - mergedMetaData.merge(specMetaData, annotatedMetaData); - - assertEquals("Both the annotated and the described bean should be here", 2, mergedMetaData.getEnterpriseBeans().size()); - - JBossSessionBeanMetaData annotatedBean = (JBossSessionBeanMetaData) mergedMetaData.getEnterpriseBean("StatefulTimeoutBean"); - assertNotNull(annotatedBean); - - JBossSessionBeanMetaData describedBean = (JBossSessionBeanMetaData) mergedMetaData.getEnterpriseBean("StatefulTimeoutBean2"); - assertNotNull(describedBean); - } -} diff --git a/src/test/resources/org/jboss/test/metadata/jbmeta154/unit/ejb-jar.xml b/src/test/resources/org/jboss/test/metadata/jbmeta154/unit/ejb-jar.xml deleted file mode 100644 index 2662398..0000000 --- a/src/test/resources/org/jboss/test/metadata/jbmeta154/unit/ejb-jar.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - StatefulTimeoutBean2 - org.jboss.test.metadata.jbmeta154.StatefulTimeoutBean - Stateful - - - \ No newline at end of file