-
Bug
-
Resolution: Done
-
Major
-
1.1.6.Final, 1.1.7.Final, 1.1.8.Final
-
None
When i try to run the following unit test, it gives me a stackOverflowError with weld 1.1.6 and 1.1.7 - but it worked with 1.1.5!
the problem seems to be a recursive loop, while trying to initialize the unit test itself for using its producer.
when you move the Producer to an static innerclass and add it to the shrinkwrap definition, this test works.
package com.kobil.ssms.kernel.logic.licencing;
import javax.enterprise.inject.Produces;
import javax.inject.Inject;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
- @author Manuel Hartl / FlexSecure GmbH
*
*/
@RunWith(Arquillian.class)
public class WeldInjectionStackOverflow {
@Deployment
public static JavaArchive createTestArchive() { return ShrinkWrap.create(JavaArchive.class, "test.jar").addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); }
public static interface Service
{ public int dummy(); };
@Produces
Service getSevice() throws LicenceException {
return new Service() {
@Override
public int dummy()
};
}
@Inject
private Service service;
@Test
public void checkInjection() throws Exception
}
- duplicates
-
WELD-1281 Consumer and Producer in same file gives infinite method recursion
- Resolved