Hi,
I need to perform Junit test using OpenEjb and CDI, and have created below
junit test class to inject MobileLocal and NetworkSwitch ejb, appreciate the
advice for below queries.  Thanks in advance, Leanne

1) Am i right to say that i need to place a beans.xml file in
src/main/resources/META-INF of my IDE (Eclipse) project folder, so that
OpenEjb EJBContainer in test case class is able to search the ejb classes,
i.e. when i run the Junit test case class ?

2) Do i need to generate the jar which contain below ejb classes and
beans.xml in jar and place the jar in classpath, so that EJBcontainer able
to search in classpath, or EjbContainer will search the ejb classes in
target clasess folder in IDE project ?

public class NewTest extends TestCase {
    @EJB
    private MobileLocal mobile;

    @Before
    public void setUp() throws Exception {
        EJBContainer.createEJBContainer().getContext().bind("inject", 
        this);
    }
...
}

@Stateless
public class MobileLocal {

    @Inject
    private NetworkSwitch nwSwitch;

...
}



--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html

Reply via email to