openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r799047 - in /incubator/openwebbeans/trunk/webbeans-ejb: ./ src/main/java/META-INF/ src/main/java/org/apache/webbeans/ejb/ src/main/java/org/apache/webbeans/ejb/util/ src/test/java/org/apache/webbeans/ejb/ src/test/java/org/apache/webbeans/...
Date Wed, 29 Jul 2009 20:13:14 GMT
Author: gerdogdu
Date: Wed Jul 29 20:13:13 2009
New Revision: 799047

URL: http://svn.apache.org/viewvc?rev=799047&view=rev
Log:
Adding test. Update accodring to tests.

Added:
    incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/META-INF/
    incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/META-INF/MANIFEST.MF   (with props)
    incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/bean/SimpleBean.java
  (with props)
    incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/bean/SimpleBeanLocal.java
  (with props)
    incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/bean/SimpleBeanTest.java
  (with props)
    incubator/openwebbeans/trunk/webbeans-ejb/src/test/resources/
    incubator/openwebbeans/trunk/webbeans-ejb/src/test/resources/META-INF/
    incubator/openwebbeans/trunk/webbeans-ejb/src/test/resources/META-INF/ejb-jar.xml   (with
props)
Modified:
    incubator/openwebbeans/trunk/webbeans-ejb/pom.xml
    incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java
    incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/util/EjbUtility.java
    incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/EjbTestContext.java
    incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/apitype/Balki_ClassView.java
    incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/apitype/EjbApiTypeTest.java
    incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/scope/Babus_Broken.java
    incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/scope/Babus_Normal.java
    incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/scope/EjbScopeTypeTest.java
    incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/validator/Babos_Broken_Decorator.java
    incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/validator/Babos_Broken_Interceptor.java
    incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/validator/EjbValidatorTest.java

Modified: incubator/openwebbeans/trunk/webbeans-ejb/pom.xml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-ejb/pom.xml?rev=799047&r1=799046&r2=799047&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-ejb/pom.xml (original)
+++ incubator/openwebbeans/trunk/webbeans-ejb/pom.xml Wed Jul 29 20:13:13 2009
@@ -34,14 +34,6 @@
 			<artifactId>openwebbeans-impl</artifactId>
 		</dependency>
 		
-        <dependency>
-            <groupId>org.apache.openwebbeans</groupId>
-            <artifactId>openwebbeans-impl</artifactId>
-            <version>1.0.0-incubating-SNAPSHOT</version>
-            <classifier>tests</classifier>
-            <scope>test</scope>
-        </dependency>
-
 		<dependency>
 		    <groupId>org.apache.geronimo.specs</groupId>
 		    <artifactId>geronimo-el_1.0_spec</artifactId>

Added: incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/META-INF/MANIFEST.MF?rev=799047&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/META-INF/MANIFEST.MF (added)
+++ incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/META-INF/MANIFEST.MF Wed Jul 29
20:13:13 2009
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+

Propchange: incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/META-INF/MANIFEST.MF
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java?rev=799047&r1=799046&r2=799047&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/EjbPlugin.java
Wed Jul 29 20:13:13 2009
@@ -59,6 +59,11 @@
     @Override
     public <T> Bean<T> defineSessionBean(Class<T> clazz)
     {
+        if(!isSessionBean(clazz))
+        {
+            throw new IllegalArgumentException("Given class is not an session bean class");
+        }
+        
         DeploymentInfo info = null;
         SessionBeanType type = SessionBeanType.STATELESS;
         

Modified: incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/util/EjbUtility.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/util/EjbUtility.java?rev=799047&r1=799046&r2=799047&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/util/EjbUtility.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-ejb/src/main/java/org/apache/webbeans/ejb/util/EjbUtility.java
Wed Jul 29 20:13:13 2009
@@ -17,7 +17,9 @@
 package org.apache.webbeans.ejb.util;
 
 import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
@@ -27,17 +29,21 @@
 import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.Producer;
 
+import org.apache.openejb.DeploymentInfo;
 import org.apache.webbeans.component.ProducerFieldBean;
 import org.apache.webbeans.component.ProducerMethodBean;
 import org.apache.webbeans.component.creation.BeanCreator.MetaDataProvider;
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.ejb.component.EjbBean;
 import org.apache.webbeans.ejb.component.creation.EjbBeanCreatorImpl;
+import org.apache.webbeans.exception.WebBeansConfigurationException;
+import org.apache.webbeans.exception.WebBeansException;
 import org.apache.webbeans.portable.AnnotatedElementFactory;
 import org.apache.webbeans.portable.events.ProcessAnnotatedTypeImpl;
 import org.apache.webbeans.portable.events.ProcessInjectionTargetImpl;
 import org.apache.webbeans.portable.events.ProcessProducerImpl;
 import org.apache.webbeans.portable.events.ProcessSessionBeanImpl;
+import org.apache.webbeans.util.ClassUtil;
 import org.apache.webbeans.util.WebBeansUtil;
 
 @SuppressWarnings("unchecked")
@@ -76,6 +82,7 @@
         ejbBeanCreator.defineBindingType();
         ejbBeanCreator.defineName(WebBeansUtil.getSimpleWebBeanDefaultName(clazz.getSimpleName()));
           
         Set<ProducerMethodBean<?>> producerMethodBeans = ejbBeanCreator.defineProducerMethods();
       
+        checkProducerMethods(producerMethodBeans, ejbBean);
         Set<ProducerFieldBean<?>> producerFieldBeans = ejbBeanCreator.defineProducerFields();
          
         ejbBeanCreator.defineDisposalMethods();
         ejbBeanCreator.defineInjectedFields();
@@ -145,4 +152,44 @@
             BeanManagerImpl.getManager().getBeans().addAll(producerFieldBeans);
         }        
     }
+    
+    private static void checkProducerMethods(Set<ProducerMethodBean<?>> producerMethodBeans,
EjbBean<?> bean)
+    {
+        for(ProducerMethodBean<?> producerMethodBean : producerMethodBeans)
+        {
+            Method producerMethod = producerMethodBean.getCreatorMethod();
+            if(!ClassUtil.isStatic(producerMethod.getModifiers()))
+            {
+                if(!isBusinessMethod(producerMethod, bean))
+                {
+                    throw new WebBeansConfigurationException("Producer Method Bean must be
business method of session bean : " + bean);
+                }
+            }
+        }        
+    }
+    
+    public static boolean isBusinessMethod(Method method, EjbBean<?> bean)
+    {
+        DeploymentInfo info = bean.getDeploymentInfo();
+        List<Class> businessLocals = info.getBusinessLocalInterfaces();
+        for(Class clz : businessLocals)
+        {
+            try
+            {
+                clz.getMethod(method.getName(), method.getParameterTypes());
+                
+                return true;
+            }
+            catch (SecurityException e)
+            {
+                throw new WebBeansException("Security exception",e);
+            }
+            catch (NoSuchMethodException e)
+            {
+                continue;
+            }
+        }
+        
+        return false;
+    }
 }
\ No newline at end of file

Modified: incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/EjbTestContext.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/EjbTestContext.java?rev=799047&r1=799046&r2=799047&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/EjbTestContext.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/EjbTestContext.java
Wed Jul 29 20:13:13 2009
@@ -16,18 +16,55 @@
  */
 package org.apache.webbeans.ejb;
 
+import org.apache.openejb.OpenEJB;
+import org.apache.webbeans.container.BeanManagerImpl;
+import org.apache.webbeans.container.activity.ActivityManager;
 import org.apache.webbeans.ejb.component.EjbBean;
-import org.apache.webbeans.test.servlet.TestContext;
+import org.apache.webbeans.plugins.PluginLoader;
 
-public abstract class EjbTestContext extends TestContext
-{
+public abstract class EjbTestContext
+{    
+    
     protected EjbTestContext(String name)
     {
-        super(name);
+        ActivityManager.getInstance().setRootActivity(new BeanManagerImpl());
     }
+ 
+    
+    protected static void initEjb()
+    {
+        try
+        {
+            PluginLoader.getInstance().startUp();
+            
+            System.out.println("INIT EJB");
+            
+            OpenEJB.init(System.getProperties());
 
+            
+        }catch(Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+    
+    protected static void destroyEjb()
+    {
+        try
+        {
+            System.out.println("DESTROY EJB");
+            
+            OpenEJB.destroy();
+            
+        }catch(Exception e)
+        {
+            
+        }
+    }
+    
     protected <T> EjbBean<T> defineEjbBean(Class<T> ejbClass)
     {
-        return new EjbBean<T>(ejbClass);
+        EjbPlugin plugin = new EjbPlugin();
+       return (EjbBean<T>)plugin.defineSessionBean(ejbClass);
     }
 }

Added: incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/bean/SimpleBean.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/bean/SimpleBean.java?rev=799047&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/bean/SimpleBean.java
(added)
+++ incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/bean/SimpleBean.java
Wed Jul 29 20:13:13 2009
@@ -0,0 +1,30 @@
+/*
+ * 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 org.apache.webbeans.ejb.bean;
+
+import javax.ejb.Stateless;
+import javax.enterprise.inject.Produces;
+
+@Stateless
+public class SimpleBean implements SimpleBeanLocal
+{
+
+    @Override
+    @Produces
+    public String hello(String hi)
+    {
+        return null;
+    }
+
+}

Propchange: incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/bean/SimpleBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/bean/SimpleBeanLocal.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/bean/SimpleBeanLocal.java?rev=799047&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/bean/SimpleBeanLocal.java
(added)
+++ incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/bean/SimpleBeanLocal.java
Wed Jul 29 20:13:13 2009
@@ -0,0 +1,23 @@
+/*
+ * 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 org.apache.webbeans.ejb.bean;
+
+import javax.ejb.Local;
+
+@Local
+public interface SimpleBeanLocal
+{
+    public String hello(String hi);
+    
+}

Propchange: incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/bean/SimpleBeanLocal.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/bean/SimpleBeanTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/bean/SimpleBeanTest.java?rev=799047&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/bean/SimpleBeanTest.java
(added)
+++ incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/bean/SimpleBeanTest.java
Wed Jul 29 20:13:13 2009
@@ -0,0 +1,58 @@
+/*
+ * 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 org.apache.webbeans.ejb.bean;
+
+import junit.framework.Assert;
+
+import org.apache.webbeans.ejb.EjbPlugin;
+import org.apache.webbeans.ejb.EjbTestContext;
+import org.apache.webbeans.ejb.component.EjbBean;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class SimpleBeanTest extends EjbTestContext
+{
+    public SimpleBeanTest()
+    {
+        super(SimpleBeanTest.class.getName());
+    }
+    
+    @BeforeClass
+    public static void setup()
+    {
+        initEjb();
+    }
+    
+    @AfterClass
+    public static void destroy()
+    {
+        destroyEjb();
+    }
+
+    @Test
+    public void testLocalMethod()
+    {
+        EjbPlugin plugin = new EjbPlugin();
+        boolean value = plugin.isSessionBean(SimpleBean.class);
+        
+        Assert.assertTrue(value);
+        
+        EjbBean<SimpleBean> bean = (EjbBean<SimpleBean>)plugin.defineSessionBean(SimpleBean.class);
+        Assert.assertNotNull(bean);
+        
+        
+        
+    }
+}

Propchange: incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/bean/SimpleBeanTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/apitype/Balki_ClassView.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/apitype/Balki_ClassView.java?rev=799047&r1=799046&r2=799047&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/apitype/Balki_ClassView.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/apitype/Balki_ClassView.java
Wed Jul 29 20:13:13 2009
@@ -17,8 +17,10 @@
 package org.apache.webbeans.ejb.definition.apitype;
 
 import javax.ejb.Stateless;
+import javax.jws.WebService;
 
 @Stateless
+@WebService
 public class Balki_ClassView
 {
 

Modified: incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/apitype/EjbApiTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/apitype/EjbApiTypeTest.java?rev=799047&r1=799046&r2=799047&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/apitype/EjbApiTypeTest.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/apitype/EjbApiTypeTest.java
Wed Jul 29 20:13:13 2009
@@ -22,8 +22,9 @@
 import org.apache.webbeans.ejb.EjbTestContext;
 import org.apache.webbeans.ejb.component.EjbBean;
 import org.apache.webbeans.ejb.util.EjbDefinitionUtility;
+import org.junit.AfterClass;
 import org.junit.Assert;
-import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class EjbApiTypeTest extends EjbTestContext
@@ -33,10 +34,16 @@
         super(EjbApiTypeTest.class.getName());
     }
     
-    @Before
-    public void init()
+    @BeforeClass
+    public static void init()
     {
-        super.init();
+        initEjb();
+    }
+    
+    @AfterClass
+    public static void after()
+    {
+        destroyEjb();
     }
     
     @Test
@@ -47,7 +54,7 @@
         
         Set<Type> types = bean.getTypes();
         
-        Assert.assertEquals(3, types.size());
+        Assert.assertEquals(2, types.size());
     }
     
     @Test
@@ -58,7 +65,7 @@
         
         Set<Type> types = bean.getTypes();
         
-        Assert.assertEquals(3, types.size());
+        Assert.assertEquals(2, types.size());
     }
     
     @Test
@@ -80,7 +87,7 @@
         
         Set<Type> types = bean.getTypes();
         
-        Assert.assertEquals(2, types.size());
+        Assert.assertEquals(1, types.size());
     }
     
 

Modified: incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/scope/Babus_Broken.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/scope/Babus_Broken.java?rev=799047&r1=799046&r2=799047&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/scope/Babus_Broken.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/scope/Babus_Broken.java
Wed Jul 29 20:13:13 2009
@@ -18,9 +18,11 @@
 
 import javax.ejb.Stateless;
 import javax.enterprise.context.ApplicationScoped;
+import javax.jws.WebService;
 
 @Stateless
 @ApplicationScoped
+@WebService
 public class Babus_Broken
 {
 

Modified: incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/scope/Babus_Normal.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/scope/Babus_Normal.java?rev=799047&r1=799046&r2=799047&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/scope/Babus_Normal.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/scope/Babus_Normal.java
Wed Jul 29 20:13:13 2009
@@ -17,8 +17,10 @@
 package org.apache.webbeans.ejb.definition.scope;
 
 import javax.ejb.Stateless;
+import javax.jws.WebService;
 
 @Stateless
+@WebService
 public class Babus_Normal
 {
 

Modified: incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/scope/EjbScopeTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/scope/EjbScopeTypeTest.java?rev=799047&r1=799046&r2=799047&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/scope/EjbScopeTypeTest.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/scope/EjbScopeTypeTest.java
Wed Jul 29 20:13:13 2009
@@ -15,8 +15,9 @@
 
 import org.apache.webbeans.ejb.EjbTestContext;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
+import org.junit.AfterClass;
 import org.junit.Assert;
-import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class EjbScopeTypeTest extends EjbTestContext
@@ -26,10 +27,16 @@
         super(EjbScopeTypeTest.class.getName());
     }
 
-    @Before
-    public void init()
+    @BeforeClass
+    public static void init()
     {
-        super.init();
+        initEjb();
+    }
+    
+    @AfterClass
+    public static void after()
+    {
+        destroyEjb();
     }
 
     @Test
@@ -47,8 +54,7 @@
             result = e;
         }
 
-        //TODO Add scope check
-        Assert.assertNull(result);
+        Assert.assertNotNull(result);
     }
     
     @Test

Modified: incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/validator/Babos_Broken_Decorator.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/validator/Babos_Broken_Decorator.java?rev=799047&r1=799046&r2=799047&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/validator/Babos_Broken_Decorator.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/validator/Babos_Broken_Decorator.java
Wed Jul 29 20:13:13 2009
@@ -18,9 +18,11 @@
 
 import javax.decorator.Decorator;
 import javax.ejb.Stateless;
+import javax.jws.WebService;
 
 @Stateless
 @Decorator
+@WebService
 public class Babos_Broken_Decorator
 {
 

Modified: incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/validator/Babos_Broken_Interceptor.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/validator/Babos_Broken_Interceptor.java?rev=799047&r1=799046&r2=799047&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/validator/Babos_Broken_Interceptor.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/validator/Babos_Broken_Interceptor.java
Wed Jul 29 20:13:13 2009
@@ -18,9 +18,11 @@
 
 import javax.ejb.Stateless;
 import javax.interceptor.Interceptor;
+import javax.jws.WebService;
 
 @Stateless
 @Interceptor
+@WebService
 public class Babos_Broken_Interceptor
 {
 

Modified: incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/validator/EjbValidatorTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/validator/EjbValidatorTest.java?rev=799047&r1=799046&r2=799047&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/validator/EjbValidatorTest.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-ejb/src/test/java/org/apache/webbeans/ejb/definition/validator/EjbValidatorTest.java
Wed Jul 29 20:13:13 2009
@@ -33,7 +33,7 @@
     @Before
     public void init()
     {
-        super.init();        
+        
     }
     
     @Test

Added: incubator/openwebbeans/trunk/webbeans-ejb/src/test/resources/META-INF/ejb-jar.xml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-ejb/src/test/resources/META-INF/ejb-jar.xml?rev=799047&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-ejb/src/test/resources/META-INF/ejb-jar.xml (added)
+++ incubator/openwebbeans/trunk/webbeans-ejb/src/test/resources/META-INF/ejb-jar.xml Wed
Jul 29 20:13:13 2009
@@ -0,0 +1 @@
+<ejb-jar/>
\ No newline at end of file

Propchange: incubator/openwebbeans/trunk/webbeans-ejb/src/test/resources/META-INF/ejb-jar.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message