Hi,
I attach small test for this issue
I attached this test in JIRA (OPENEJB-1358) too.

Jarek

W dniu 2014-01-16 19:48, David Blevins pisze:
Hi Jarek!

Really great you're interested in contributing and welcome aboard :)

If you want to submit a small test we can check in for OPENEJB-1358, I'll commit it and 
then we can close that JIRA as "Cannot Reproduce" confident that at least that 
bug will not show up in the future -- if it ever existed.  If the user in question was 
actually doing something else and simply did not put the right detail in the message 
(happens sometimes), then he can let us know.

And then you'll have your first contribution!


-David

On Jan 14, 2014, at 6:04 AM, Jarosław Dąbrowski <[email protected]> 
wrote:

Hello,
I use OpenEjb mainly to test my applications and OpenEjb is very useful.
I would like to help you to improve this framework.
I read "Contribution Tips" and found task in JIRA (OPENEJB-1358).
This task is open and unresolved but it is invalid.
I write test with
        context.bind("some/component/name", String.class);
        context.lookup("some/component/name"); // throws NameNotFoundException
and it works OK.
What should I do now?

Greetings
Jarek





package org.apache.openejb;

import java.util.HashMap;
import java.util.Map;

import javax.ejb.embeddable.EJBContainer;
import javax.naming.Context;
import javax.naming.NamingException;

import org.apache.openejb.jee.EjbJar;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 * This test was create because of issue OPENEJB-1358.
 * Shows that issue is invalid
 */
public class OpenEjbContainerBindTest {
        /** container */
        private static EJBContainer ejbContainer = null;

        @BeforeClass
        public static void openEjbContainer() {
                Map<String, Object> map = new HashMap<String, Object>();
                final EjbJar ejbJar = new EjbJar();
                map.put(EJBContainer.MODULES, ejbJar);
                ejbContainer = (OpenEjbContainer) 
EJBContainer.createEJBContainer(map);
        }

        @Test
        public void bindTest() {
                try {
                        Context context = ejbContainer.getContext();
                        context.bind("java:some/component/name", String.class);
                        Object obj = context.lookup("java:some/component/name");
                        Assert.assertTrue("obj should be not null", obj != 
null);
                } catch (NamingException e) {
                        Assert.assertTrue("NamingException: "+e, false);
                }
        }

        @AfterClass
        public static void closeEjbContainer() {
                ejbContainer.close();
        }

}
  • Hello Helio Frota
    • Hello Jarosław Dąbrowski
      • Re: Hello David Blevins
        • Re: Hello Jarosław Dąbrowski

Reply via email to