0 Replies Latest reply on Oct 8, 2014 6:10 AM by vata2999

    Arquillian Seam no active session context

    vata2999

      I'm trying to use Arquillian with Seam 2 when I try to reach a Seam Component I get this error

       

      java.lang.IllegalStateException: No active session context
      

       

      I know it's because of Seam life cycle has not started I wonder why ?

       

      I'm using

       

      <dependency>
        <groupId>org.jboss.as</groupId>
        <artifactId>jboss-as-arquillian-container-managed</artifactId>
        <version>7.2.0.Final</version>
        <scope>test</scope>
        </dependency>
      

       

      here is my code

       

      @RunWith(Arquillian.class)
      //@RunAsClient
      public class DbUtilTest
      {
      
      
          @Deployment(testable = false)
          public static Archive<?> createDeployment()
          {
              //TODO : get from System.getProperties(testDeployment)
              String testDeployment = "/home/omidbiz/blog-ear/target/blog.ear";//can not deploy exploded archive
              String deploymentName = testDeployment.substring(testDeployment.lastIndexOf("/") + 1);
      
      
              Class<? extends Archive<?>> deploymentClass = EnterpriseArchive.class;
      
      
              return ShrinkWrap.create(ZipImporter.class, deploymentName).importFrom(new File(testDeployment)).as(deploymentClass);
          }
      
      
          @Test
      //    @InSequence(1)
          public void simpleEntryTest() {
      
      
              String id = "simpleBlogEntry";
              String title = "Simple blog entry";
              String excerpt = "This is an excerpt";
              String body = "This is a simple blog entry posted for testing purposes.";
      
      
             System.out.println(id);
             DBUtil dbUtil = DBUtil.instance();
             List<Blog> list = dbUtil.getBlogFilterByPermissionDate();
             System.out.println(list);
          }
          
          
      }
      

       

       

      BTW Arquillian can not deploy exploded archive is it correct ? aslak.aslak.conduct.no