binding doesn't use this context, and not sure it will use this name
(well no in fact). The context can be accessed through
SystemInstance.get().getComponent(ContainerSystem.class).getJNDIContext()
btw.

But not using scanning would make it smoother
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014/1/14 Michiel De Smet <[email protected]>:
> I want to rebind some EJB's to their mock counterparts after initializing
> the initial context trough class path scanning.
>
> I tried following but this did not work:
> @LocalClient
> class MyTestClass() {
> ...
> initialContext = new InitialContext(properties);
> IFoo foo = EasyMock.createNiceMock(IFoo.class);
> ...
> initialContext.rebind("FooImplLocal", foo);
> initialContext.bind("inject", this);
> ...
> }
>
> The binding succeeds without a NamingException but however the original EJB
> is injected in the MyTestClass...
>
>
> Any ideas?

Reply via email to