6 Replies Latest reply on Mar 2, 2011 8:17 AM by Stan Silvert

    Does JSFUnit 2.x support EARs?

    Denis Kniazhev Newbie

      Hello everyone,

      I've been playing with JSFUnit2 for past couple of days, and I found it great. However, one questions captures my mind right now: does it support EAR files? For what I'm seeing now, it doesn't - I have the following deployment method:

          public static EnterpriseArchive createArchive() {
              EnterpriseArchive enterpriseArchive = ...//get somehow
              return enterpriseArchive;


      My test looks like this (pretty useful):

          public void test() {
              int doNothing = 0;


      And my test  fails with the following error:

      Caused by: java.lang.ClassCastException: org.jboss.shrinkwrap.impl.base.spec.EnterpriseArchiveImpl cannot be cast to org.jboss.shrinkwrap.api.spec.WebArchive
          at org.jboss.jsfunit.arquillian.JSFUnitApplicationArchiveProcessor.process(JSFUnitApplicationArchiveProcessor.java:41)
          at org.jboss.arquillian.impl.ClientDeploymentGenerator.applyApplicationProcessors(ClientDeploymentGenerator.java:85)
          at org.jboss.arquillian.impl.ClientDeploymentGenerator.generate(ClientDeploymentGenerator.java:60)


      Indeed, in JSFUnitApplicationArchiveProcessor there is the following piece of code:

         public void process(Archive<?> archive, TestClass tc)
            WebArchive webArchive = (WebArchive)archive;              //this is where the error is thrown


      So, it tries to cast my EnterpriseArchive to WebArchive. But EnterpriseArchive is not a descendant of WebArchive, they are distinct class hierarchies.


      My question is - does JSFUnit 2.x support EARs at all or am I just doing something wrong?