1 Reply Latest reply on Nov 26, 2015 8:55 AM by Tomas Remes

    Arquillian + JSF (weld embedded)

    Oleg Buchhammer Newbie

      Hello,

       

      I am trying to follow the "Getting Started" Example of Arquillian and the tutorial "Funtional Testing using Drone and Graphene" and I'm afraid without any success.

      My POM:

       

      <properties>

              <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

              <failOnMissingWebXml>false</failOnMissingWebXml>

              <browser>firefox</browser>

          </properties>

       

          <!-- Dependency to Arquillian -->

          <dependencyManagement>

              <dependencies>

                  <dependency>

                      <groupId>org.jboss.arquillian</groupId>

                      <artifactId>arquillian-bom</artifactId>

                      <version>1.1.10.Final</version>

                      <scope>import</scope>

                      <type>pom</type>

                  </dependency>

                  <dependency>

                      <groupId>org.jboss.arquillian.extension</groupId>

                      <artifactId>arquillian-drone-bom</artifactId>

                      <version>1.3.1.Final</version>

                      <type>pom</type>

                      <scope>import</scope>

                  </dependency>

                  <dependency>

                      <groupId>org.jboss.arquillian.selenium</groupId>

                      <artifactId>selenium-bom</artifactId>

                      <version>2.43.1</version>

                      <type>pom</type>

                      <scope>import</scope>

                  </dependency>

              </dependencies>

          </dependencyManagement>

       

          <build>

              <plugins>

                  <plugin>

                      <artifactId>maven-compiler-plugin</artifactId>

                      <version>3.3</version>

                      <configuration>

                          <source>1.8</source>

                          <target>1.8</target>

                      </configuration>

                  </plugin>

       

                  <!-- Needed for arquillian -->

                  <plugin>

                      <artifactId>maven-surefire-plugin</artifactId>

                      <version>2.17</version>

                  </plugin>

       

                  <plugin>

                      <artifactId>maven-dependency-plugin</artifactId>

                      <executions>

                          <execution>

                              <id>unpack</id>

                              <phase>process-test-classes</phase>

                              <goals>

                                  <goal>unpack</goal>

                              </goals>

                              <configuration>

                                  <artifactItems>

                                      <artifactItem>

                                          <groupId>org.jboss.as</groupId>

                                          <artifactId>jboss-as-dist</artifactId>

                                          <version>7.1.1.Final</version>

                                          <type>zip</type>

                                          <overWrite>false</overWrite>

                                          <outputDirectory>target</outputDirectory>

                                      </artifactItem>

                                  </artifactItems>

                              </configuration>

                          </execution>

                      </executions>

                  </plugin>

              </plugins>

       

              <!-- test resource filtering evaluates ${browser} expression in arquillian.xml -->

              <testResources>

                  <testResource>

                      <directory>src/test/resources</directory>

                      <filtering>true</filtering>

                  </testResource>

              </testResources>

          </build>

       

          <dependencies>

              <dependency>

                  <groupId>junit</groupId>

                  <artifactId>junit</artifactId>

                  <version>4.8.1</version>

                  <scope>test</scope>

              </dependency>

       

              <dependency>

                  <groupId>org.jboss.arquillian.junit</groupId>

                  <artifactId>arquillian-junit-container</artifactId>

                  <scope>test</scope>

              </dependency>

       

              <!-- Graphene -->

              <dependency>

                  <groupId>org.jboss.arquillian.graphene</groupId>

                  <artifactId>graphene-webdriver</artifactId>

                  <version>2.0.3.Final</version>

                  <type>pom</type>

                  <scope>test</scope>

              </dependency>

       

              <dependency>

                  <artifactId>guava</artifactId>

                  <groupId>com.google.guava</groupId>

                  <type>jar</type>

                  <version>15.0</version>

              </dependency>

       

              <dependency>

                  <groupId>org.seleniumhq.selenium</groupId>

                  <artifactId>selenium-firefox-driver</artifactId>

                  <scope>test</scope>

              </dependency>

          </dependencies>

       

          <!-- Container configuration by profiles -->

          <profiles>

              <!-- Weld EE embedded -->

              <profile>

                  <id>arquillian-weld-ee-embedded</id>

                  <properties>

                      <browser>firefox</browser>

                  </properties>

                  <activation>

                      <activeByDefault>true</activeByDefault>

                  </activation>

                  <dependencies>

                      <dependency>

                          <groupId>org.jboss.spec</groupId>

                          <artifactId>jboss-javaee-6.0</artifactId>

                          <version>1.0.0.Final</version>

                          <type>pom</type>

                          <scope>test</scope>

                      </dependency>

                      <dependency>

                          <groupId>org.jboss.arquillian.container</groupId>

                          <artifactId>arquillian-weld-ee-embedded-1.1</artifactId>

                          <version>1.0.0.CR3</version>

                          <scope>test</scope>

                      </dependency>

                      <dependency>

                          <groupId>org.jboss.weld</groupId>

                          <artifactId>weld-core</artifactId>

                          <version>1.1.5.Final</version>

                          <scope>test</scope>

                      </dependency>

                      <dependency>

                          <groupId>org.slf4j</groupId>

                          <artifactId>slf4j-simple</artifactId>

                          <version>1.6.4</version>

                          <scope>test</scope>

                      </dependency>

                  </dependencies>

              </profile>

      ...


      And my Test class looks like this:

       

      import javax.inject.Inject;

       

      import org.jboss.arquillian.container.test.api.Deployment;

      import org.jboss.arquillian.drone.api.annotation.Drone;

      import org.jboss.arquillian.junit.Arquillian;

      import org.jboss.shrinkwrap.api.spec.WebArchive;

      import org.junit.Test;

      import org.junit.runner.RunWith;

      import org.openqa.selenium.WebDriver;

       

      @RunWith(Arquillian.class)

      public class TestLoginPage

      {

          @Inject

          private MyBean myBean;

         

          @Drone

          private WebDriver browser;

         

          @Deployment(testable = false)

          public static WebArchive createDeployment()

          {

              WebArchive war = Deployments.createDeploymentWeldEmbeddedJSF();

              war.addClass(MyBean.class);

              System.out.println(war.toString(true));

              return war;

          }

         

          @Test

          public void testClient()

          {

              System.out.println(myBean);

          }

       

      }

       

      I get following error:

       

      java.lang.IllegalAccessError: tried to access method com.google.common.collect.MapMaker.makeComputingMap(Lcom/google/common/base/Function;)Ljava/util/concurrent/ConcurrentMap; from class org.jboss.weld.logging.WeldMessageConveyor

          at org.jboss.weld.logging.WeldMessageConveyor.<init>(WeldMessageConveyor.java:61)

          at org.jboss.weld.logging.WeldMessageConveyerFactory.getDefaultMessageConveyer(WeldMessageConveyerFactory.java:27)

          at org.jboss.weld.logging.LoggerFactory.<init>(LoggerFactory.java:37)

          at org.jboss.weld.logging.LoggerFactory.loggerFactory(LoggerFactory.java:51)

          at org.jboss.weld.bootstrap.WeldBootstrap.<clinit>(WeldBootstrap.java:124)

          at org.jboss.arquillian.container.weld.ee.embedded_1_1.mock.TestContainer.<init>(TestContainer.java:211)

          at org.jboss.arquillian.container.weld.ee.embedded_1_1.WeldEEMockContainer.deploy(WeldEEMockContainer.java:93)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:161)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:128)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:271)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:127)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

          at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:57)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:78)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.container.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:50)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)

          at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:95)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:80)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachDeployment(ContainerDeployController.java:263)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:239)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:79)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)

          at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

          at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:101)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

          at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:73)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:92)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)

          at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:87)

          at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:201)

          at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:422)

          at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:54)

          at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:218)

          at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

          at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:166)

          at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)

          at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)

          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)

          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)

          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

       

      java.lang.IllegalStateException: Unexpected callable present in Drone Context, should be already instantiated at this moment.

          at org.jboss.arquillian.drone.impl.InstanceOrCallableInstanceImpl.asInstance(InstanceOrCallableInstanceImpl.java:57)

          at org.jboss.arquillian.drone.impl.DroneEnhancer.deenhanceDrone(DroneEnhancer.java:119)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)

          at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

          at org.jboss.arquillian.drone.impl.DroneDestructor.destroyClassScopedDrone(DroneDestructor.java:93)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

          at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:73)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:92)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)

          at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.afterClass(EventTestRunnerAdaptor.java:94)

          at org.jboss.arquillian.junit.Arquillian$3$1.evaluate(Arquillian.java:223)

          at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:422)

          at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:54)

          at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:218)

          at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

          at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:166)

          at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)

          at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)

          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)

          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)

          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

       

       

       

      Guava I added because of an exception I got before -> missing class com.google.common.base.Optional.

      But after adding it, I get the error above...

       

      someboby any idea?

      Thenk you!!