0 Replies Latest reply on May 27, 2013 11:07 AM by Wang Liyu

    Arquillian with Weld2.0

    Wang Liyu Apprentice

      Not sure if anyone has the same problem, recently I was trying to upgrade our project from Weld1.1.x to Weld.2.0, the code is working perfect, but I can't run the test (we use Gradle to build project), here are some issues I found.

       

      First I can't use embeded container, Gradle testRuntime classpath will include testCompile classpath, so if use the embeded container, when CDI container startup, it will found 2 duplicate bean defination for each bean. I can't use JBoss7 (because I have to use a 3rd party JCA sar that only support JBoss4 & I can't make JBoss7 connect to JBoss4). so now I got JBoss6 Remote/Tomcat 6 Remote/Tomcat7 Managed sort working.

       

      Second Arquillian doesn't support Conversation, so I have to create function like:

       

      @Before
          public void begin() {
              logger.info("about to activate the conversation context, the current instances {}", this);
              if (this.ctx == null) {
                  logger.info("the conversation context is null and get from the BeanManager");
                  this.ctx = Container.instance().deploymentManager().instance().select(HttpConversationContext.class).get();
              }
              this.ctx.activate(HorizonMockProvider.CID);
              logger.info("activated the conversation context with ID {}", HorizonMockProvider.CID);
          }
      
      
      And it worked fine with JBoss6 Remote, but with Tomcat7, it can't be initiated, because there is no HttpRequest to associated to the ConversationContext first.
      
      And can anyone create Tomcat7 Remote Container? it's come handy when using Gradle with Eclipse. I don't want to import runtimeClasspath into eclipse classpath.
      
      Could anyone from Arquillian team write some instructions?
      
      Thanks