1 Reply Latest reply on Aug 18, 2012 7:43 AM by aaron1

    Is testing a ManagedBean which has a @ManagedProperty possible?

    aaron1 Newbie

      Hi,

       

      I've been testing my EJBs fine. And now I'm attempting to test my ManagedBeans.

       

      I can @Inject a ManagedBean fine. But when a ManagedBean has itself has a @ManagedProperty import, that import is null.

       

      Is there way to import a ManagedBean and have its @ManagedProperty imported too?

       

      Cheers, Aaron

       

      P.S

       

      1) I believe I'm running Weld because of this output line:

      11:48:51,099 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016002: Processing weld deployment test.war

       

      2) This is how I'm starting my Arquillian archive:

      @Deployment

                public static Archive<?> createTestArchive() {

                          return ShrinkWrap

                                              .create(WebArchive.class, "test.war")

                                              .addClasses(...)

                                              .addAsResource("log4j.properties", "log4j.properties")

                                              .addAsResource("META-INF/persistence.xml", "META-INF/persistence.xml")

        .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");

      }