mardi 18 octobre 2016

Class org.jboss.weld.util.reflection.Reflections can not access a member of class model.business.UserFacade with modifiers "protected"

i'm developping a web application and i wish to test my EJBs with arquillian against Payara Server.

this is my test cass:

package model.business
...
...
@RunWith(Arquillian.class)
public class UserFacadeArquillianTest {

@Inject
UserFacade userFacade;


public UserFacadeArquillianTest() {
}

@Deployment
public static JavaArchive createDeployment() {
    return ShrinkWrap.create(JavaArchive.class, "test.jar")
        .addPackage(User.class.getPackage())
            .addClass(UserFacade.class)
            .addClass(AbstractFacade.class)
            .addPackage(NotFoundException.class.getPackage())
        .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
        .addAsResource("META-INF/persistence.xml", "META-INF/persistence.xml");
}

@PersistenceContext(unitName = "testPU")
EntityManager em;

@Before
public void setUp() {
    userFacade.setEm(em); // .setEm is protected
}

...

UserFacade class is in the same package of test class, so... why on testing it returns this error?

org.jboss.arquillian.test.spi.ArquillianProxyException: org.jboss.weld.exceptions.WeldException : Class org.jboss.weld.util.reflection.Reflections can not access a member of class model.business.UserFacade with modifiers "protected" [Proxied because : Original exception caused: class java.lang.ClassNotFoundException: org.jboss.weld.exceptions.WeldException]
at model.business.UserFacadeArquillianTest.setUp(UserFacadeArquillianTest.java:75)

Aucun commentaire:

Enregistrer un commentaire