0 Replies Latest reply on Feb 17, 2014 5:14 PM by Euber Almeida

    Warp Extension Test Error

    Euber Almeida Newbie

      Only happens on 1.0.0.Alpha6, Alpha5 works good.

       

      I got this error when try run the test:

       

      Test:

      package org.arquillian.example;
      
      import java.net.URL;
      
      import org.jboss.arquillian.container.test.api.Deployment;
      import org.jboss.arquillian.container.test.api.RunAsClient;
      import org.jboss.arquillian.drone.api.annotation.Drone;
      import org.jboss.arquillian.junit.Arquillian;
      import org.jboss.arquillian.test.api.ArquillianResource;
      import org.jboss.arquillian.warp.Activity;
      import org.jboss.arquillian.warp.Inspection;
      import org.jboss.arquillian.warp.Warp;
      import org.jboss.arquillian.warp.WarpTest;
      import org.jboss.shrinkwrap.api.spec.WebArchive;
      import org.junit.Test;
      import org.junit.runner.RunWith;
      import org.openqa.selenium.WebDriver;
      
      @RunWith(Arquillian.class)
      @WarpTest
      @RunAsClient
      public class HomePageWarpTest {
      
      @Drone
      private WebDriver browser;
      
      @ArquillianResource
        private URL contextPath;
      
      @Deployment(testable = true)
      public static WebArchive createDeployment() {
      return Deployments.createLoginScreenDeployment();
      }
      
      
      @Test
      public void dummyTest() {
      
      Warp
      .initiate(new Activity() {
      
      public void perform() {
      browser.navigate().to(contextPath + "index.jsf");
      }})
      
      .inspect(new Inspection() {
      private static final long serialVersionUID = 1L;
      });
      
      
      
      
      
      
      
      
      
      
      }
      
      }
      
      

       

       

       

       

      Error:

       

      java.lang.NoSuchMethodError: java.net.Inet4Address.getLoopbackAddress()Ljava/net/InetAddress;
      at org.jboss.arquillian.warp.impl.client.proxy.DefaultURLMapping.getProxyAddress(DefaultURLMapping.java:73)
      at org.jboss.arquillian.warp.impl.client.proxy.DefaultURLMapping.getProxyHost(DefaultURLMapping.java:69)
      at org.jboss.arquillian.warp.impl.client.proxy.DefaultURLMapping.newProxyUrlWithPort(DefaultURLMapping.java:61)
      at org.jboss.arquillian.warp.impl.client.proxy.DefaultURLMapping.getProxyURL(DefaultURLMapping.java:49)
      at org.jboss.arquillian.warp.impl.client.proxy.ProxyURLProvider.getProxyUrl(ProxyURLProvider.java:79)
      at org.jboss.arquillian.warp.impl.client.proxy.ProxyURLProvider.lookup(ProxyURLProvider.java:71)
      at org.jboss.arquillian.graphene.location.ContextRootStoreInitializer.getContextRoot(ContextRootStoreInitializer.java:54)
      at org.jboss.arquillian.graphene.location.ContextRootStoreInitializer.setupLocationForClass(ContextRootStoreInitializer.java:47)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      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:135)
      at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
      at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
      at org.jboss.arquillian.test.impl.TestInstanceEnricher.enrich(TestInstanceEnricher.java:48)
      at org.jboss.arquillian.container.test.impl.ClientTestInstanceEnricher.enrich(ClientTestInstanceEnricher.java:51)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      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.test.impl.client.ContainerEventController.createContext(ContainerEventController.java:142)
      at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createBeforeContext(ContainerEventController.java:124)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      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.createTestContext(TestContextHandler.java:89)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      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:75)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      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.createSuiteContext(TestContextHandler.java:60)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      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:135)
      at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
      at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.before(EventTestRunnerAdaptor.java:95)
      at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:222)
      at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)
      at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)
      at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
      at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:185)
      at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)
      at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)
      at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
      at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      
      
      

       

      POM

      <?xml version="1.0" encoding="UTF-8"?>
      <!-- JBoss, Home of Professional Open Source Copyright 2013, Red Hat, Inc.
      and/or its affiliates, and individual contributors by the @authors tag. See
      the copyright.txt in the distribution for a full listing of individual contributors.
      Licensed under the Apache License, Version 2.0 (the "License"); you may not
      use this file except in compliance with the License. You may obtain a copy
      of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
      by applicable law or agreed to in writing, software distributed under the
      License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
      OF ANY KIND, either express or implied. See the License for the specific
      language governing permissions and limitations under the License. -->
      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
      <modelVersion>4.0.0</modelVersion>
      
      <groupId>com.test</groupId>
      <artifactId>FuncionalTesteDrone</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <packaging>war</packaging>
      <name>FuncionalTeste</name>
      <description>A starter Java EE 6 webapp project for use on JBoss AS 7 / EAP 6, generated from the jboss-javaee6-webapp archetype</description>
      
      <url>http://jboss.org/jbossas</url>
      <licenses>
      <license>
      <name>Apache License, Version 2.0</name>
      <distribution>repo</distribution>
      <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
      </license>
      </licenses>
      
      <properties>
      <!-- Explicitly declaring the source encoding eliminates the following
      message: -->
      <!-- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered
      resources, i.e. build is platform dependent! -->
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      
      <!-- JBoss dependency versions -->
      <version.jboss.maven.plugin>7.4.Final</version.jboss.maven.plugin>
      
      <!-- Define the version of the JBoss BOMs we want to import to specify
      tested stacks. -->
      <version.jboss.bom>1.0.7.Final</version.jboss.bom>
      <!-- Alternatively, comment out the above line, and un-comment the line
      below to use version 1.0.4.Final-redhat-4 which is a release certified to
      work with JBoss EAP 6. It requires you have access to the JBoss EAP 6 maven
      repository. -->
      <!-- <version.jboss.bom>1.0.4.Final-redhat-4</version.jboss.bom>> -->
      
      <!-- other plugin versions -->
      <version.surefire.plugin>2.10</version.surefire.plugin>
      <version.war.plugin>2.1.1</version.war.plugin>
      
      <!-- maven-compiler-plugin -->
      <maven.compiler.target>1.6</maven.compiler.target>
      <maven.compiler.source>1.6</maven.compiler.source>
      
      <browser>phantomjs</browser> <!-- PhantomJS will be our default browser if no profile is specified -->
      <version.org.jboss.arquillian>1.1.1.Final</version.org.jboss.arquillian>
      <version.org.jboss.arquillian.drone>1.2.1.Final</version.org.jboss.arquillian.drone>
      <version.org.jboss.arquillian.graphene2>2.0.0.Final</version.org.jboss.arquillian.graphene2>
      <version.org.jboss.arquillian.graphene>1.0.0.Final</version.org.jboss.arquillian.graphene>
      <version.org.jboss.arquillian.warp>1.0.0.Alpha6</version.org.jboss.arquillian.warp>
      </properties>
      
      <dependencyManagement>
      <dependencies>
      <!-- Arquillian Core dependencies -->
      <dependency>
      <groupId>org.jboss.arquillian</groupId>
      <artifactId>arquillian-bom</artifactId>
      <version>${version.org.jboss.arquillian}</version>
      <type>pom</type>
      <scope>import</scope>
      </dependency>
      <!-- Arquillian Drone dependencies and WebDriver/Selenium dependencies -->
      <dependency>
      <groupId>org.jboss.arquillian.extension</groupId>
      <artifactId>arquillian-drone-bom</artifactId>
      <version>${version.org.jboss.arquillian.drone}</version>
      <type>pom</type>
      <scope>import</scope>
      </dependency>
      
      <dependency>
      <groupId>org.jboss.arquillian.extension</groupId>
      <artifactId>arquillian-warp-bom</artifactId>
      <version>${version.org.jboss.arquillian.warp}</version>
      <type>pom</type>
      <scope>import</scope>
      </dependency>
      <!-- JBoss distributes a complete set of Java EE 6 APIs including a Bill
      of Materials (BOM). A BOM specifies the versions of a "stack" (or a collection)
      of artifacts. We use this here so that we always get the correct versions
      of artifacts. Here we use the jboss-javaee-6.0-with-tools stack (you can
      read this as the JBoss stack of the Java EE 6 APIs, with some extras tools
      for your project, such as Arquillian for testing) and the jboss-javaee-6.0-with-hibernate
      stack you can read this as the JBoss stack of the Java EE 6 APIs, with extras
      from the Hibernate family of projects) -->
      <dependency>
      <groupId>org.jboss.bom</groupId>
      <artifactId>jboss-javaee-6.0-with-hibernate</artifactId>
      <version>${version.jboss.bom}</version>
      <type>pom</type>
      <scope>import</scope>
      </dependency>
      </dependencies>
      </dependencyManagement>
      
      <dependencies>
      
      <!-- First declare the APIs we depend on and need for compilation. All
      of them are provided by JBoss AS 7 -->
      
      <!-- Import the CDI API, we use provided scope as the API is included in
      JBoss AS 7 -->
      <dependency>
      <groupId>javax.enterprise</groupId>
      <artifactId>cdi-api</artifactId>
      <scope>provided</scope>
      </dependency>
      
      <!-- Import the Common Annotations API (JSR-250), we use provided scope
      as the API is included in JBoss AS 7 -->
      <dependency>
      <groupId>org.jboss.spec.javax.annotation</groupId>
      <artifactId>jboss-annotations-api_1.1_spec</artifactId>
      <scope>provided</scope>
      </dependency>
      
      <!-- Import the JAX-RS API, we use provided scope as the API is included
      in JBoss AS 7 -->
      <dependency>
      <groupId>org.jboss.spec.javax.ws.rs</groupId>
      <artifactId>jboss-jaxrs-api_1.1_spec</artifactId>
      <scope>provided</scope>
      </dependency>
      
      <!-- Import the JPA API, we use provided scope as the API is included in
      JBoss AS 7 -->
      <dependency>
      <groupId>org.hibernate.javax.persistence</groupId>
      <artifactId>hibernate-jpa-2.0-api</artifactId>
      <scope>provided</scope>
      </dependency>
      
      <!-- Import the EJB API, we use provided scope as the API is included in
      JBoss AS 7 -->
      <dependency>
      <groupId>org.jboss.spec.javax.ejb</groupId>
      <artifactId>jboss-ejb-api_3.1_spec</artifactId>
      <scope>provided</scope>
      </dependency>
      
      <!-- JSR-303 (Bean Validation) Implementation -->
      <!-- Provides portable constraints such as @Email -->
      <!-- Hibernate Validator is shipped in JBoss AS 7 -->
      <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-validator</artifactId>
      <scope>provided</scope>
      <exclusions>
      <exclusion>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      </exclusion>
      </exclusions>
      </dependency>
      
      <!-- Import the JSF API, we use provided scope as the API is included in
      JBoss AS 7 -->
      <dependency>
      <groupId>org.jboss.spec.javax.faces</groupId>
      <artifactId>jboss-jsf-api_2.1_spec</artifactId>
      <scope>provided</scope>
      </dependency>
      
      <!-- Now we declare any tools needed -->
      
      <!-- Annotation processor to generate the JPA 2.0 metamodel classes for
      typesafe criteria queries -->
      <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-jpamodelgen</artifactId>
      <scope>provided</scope>
      </dependency>
      
      <!-- Annotation processor that raising compilation errors whenever constraint
      annotations are incorrectly used. -->
      <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-validator-annotation-processor</artifactId>
      <scope>provided</scope>
      </dependency>
      
      <!-- Needed for running tests (you may also use TestNG) -->
      <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.8.1</version>
      <scope>test</scope>
      </dependency>
      
      <!-- Optional, but highly recommended -->
      <!-- Arquillian allows you to test enterprise code such as EJBs and Transactional(JTA)
      JPA from JUnit/TestNG -->
      <dependency>
      <groupId>org.jboss.arquillian.junit</groupId>
      <artifactId>arquillian-junit-container</artifactId>
      <scope>test</scope>
      </dependency>
      
      <dependency>
      <groupId>org.jboss.arquillian.protocol</groupId>
      <artifactId>arquillian-protocol-servlet</artifactId>
      <scope>test</scope>
      </dependency>
      
      <dependency>
      <groupId>org.jboss.arquillian.graphene</groupId>
      <artifactId>graphene-webdriver</artifactId>
      <version>${version.org.jboss.arquillian.graphene2}</version>
      <type>pom</type>
      <scope>test</scope>
      </dependency>
      
      <dependency>
      <groupId>org.jboss.arquillian.extension</groupId>
      <artifactId>arquillian-drone-webdriver-depchain</artifactId>
      <type>pom</type>
      <scope>test</scope>
      </dependency>
      
      <dependency>
      <groupId>org.jboss.arquillian.extension</groupId>
      <artifactId>arquillian-warp</artifactId>
      <type>pom</type>
      <scope>test</scope>
      </dependency>
      
      <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <version>1.9.5</version>
      </dependency>
      </dependencies>
      
      <build>
      <!-- Maven will append the version to the finalName (which is the name
      given to the generated war, and hence the context root) -->
      <finalName>${project.artifactId}</finalName>
      <plugins>
      <plugin>
      <artifactId>maven-war-plugin</artifactId>
      <version>${version.war.plugin}</version>
      <configuration>
      <!-- Java EE 6 doesn't require web.xml, Maven needs to catch up! -->
      <failOnMissingWebXml>false</failOnMissingWebXml>
      </configuration>
      </plugin>
      <!-- The JBoss AS plugin deploys your war to a local JBoss AS container -->
      <!-- To use, run: mvn package jboss-as:deploy -->
      <plugin>
      <groupId>org.jboss.as.plugins</groupId>
      <artifactId>jboss-as-maven-plugin</artifactId>
      <version>${version.jboss.maven.plugin}</version>
      </plugin>
      </plugins>
      
      <testResources>
      <testResource>
      <directory>src/test/resources</directory>
      <filtering>true</filtering>
      </testResource>
      </testResources>
      </build>
      
      <profiles>
      <profile>
      <!-- The default profile skips all tests, though you can tune it to run
      just unit tests based on a custom pattern -->
      <!-- Seperate profiles are provided for running all tests, including Arquillian
      tests that execute in the specified container -->
      <id>default</id>
      <activation>
      <activeByDefault>true</activeByDefault>
      </activation>
      <build>
      <plugins>
      <plugin>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>${version.surefire.plugin}</version>
      <configuration>
      <skip>true</skip>
      </configuration>
      </plugin>
      </plugins>
      </build>
      </profile>
      
      <profile>
      <!-- An optional Arquillian testing profile that executes tests in your
      JBoss AS instance -->
      <!-- This profile will start a new JBoss AS instance, and execute the
      test, shutting it down when done -->
      <!-- Run with: mvn clean test -Parq-jbossas-managed -->
      <id>arq-jbossas-managed</id>
      <dependencies>
      <dependency>
      <groupId>org.jboss.as</groupId>
      <artifactId>jboss-as-arquillian-container-managed</artifactId>
      <scope>test</scope>
      </dependency>
      </dependencies>
      </profile>
      
      <profile>
      <!-- An optional Arquillian testing profile that executes tests in a remote
      JBoss AS instance -->
      <!-- Run with: mvn clean test -Parq-jbossas-remote -->
      <id>arq-jbossas-remote</id>
      <dependencies>
      <dependency>
      <groupId>org.jboss.as</groupId>
      <artifactId>jboss-as-arquillian-container-remote</artifactId>
      <version>7.1.1.Final</version>
      <scope>test</scope>
      </dependency>
      </dependencies>
      </profile>
      
      <profile>
      <!-- When built in OpenShift the 'openshift' profile will be used when
      invoking mvn. -->
      <!-- Use this profile for any OpenShift specific customization your app
      will need. -->
      <!-- By default that is to put the resulting archive into the 'deployments'
      folder. -->
      <!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html -->
      <id>openshift</id>
      <build>
      <plugins>
      <plugin>
      <artifactId>maven-war-plugin</artifactId>
      <version>${version.war.plugin}</version>
      <configuration>
      <outputDirectory>deployments</outputDirectory>
      <warName>ROOT</warName>
      </configuration>
      </plugin>
      </plugins>
      </build>
      </profile>
      <profile>
      <id>firefox</id>
      <properties>
      <browser>firefox</browser>
      </properties>
      </profile>
      <profile>
      <id>chrome</id>
      <properties>
      <browser>chrome</browser>
      </properties>
      </profile>
      
      </profiles>
      </project>