0 Replies Latest reply on Jan 13, 2016 4:49 PM by chiken38

    Arquillian TestResult SetEnd Method not found

    chiken38

      Hello everybody,

       

      First of all, please excuse my french-english

       

      I have some troubles and i tried some tricks proposed in previous topics, but i had no results.

      My problem is actually the following, when i execute the test from the profile Parq-jbossas-managed of my pom (mvn clean test -Parq-jbossas-managed).

       

      I simply try the arquillian Tutorial and obtain this stack of error :

       

      java.lang.NoSuchMethodError: org.jboss.arquillian.test.spi.TestResult.setEnd(J)V

        at org.jboss.arquillian.protocol.jmx.JMXMethodExecutor.invoke(JMXMethodExecutor.java:75)

        at org.jboss.arquillian.container.test.impl.execution.RemoteTestExecuter.execute(RemoteTestExecuter.java:109)

        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.execution.ClientTestExecuter.execute(ClientTestExecuter.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.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.createTestContext(ContainerEventController.java:129)

        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.createTestContext(TestContextHandler.java:130)

        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.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.core.impl.ManagerImpl.fire(ManagerImpl.java:145)

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

        at org.jboss.arquillian.junit.Arquillian$8.evaluate(Arquillian.java:363)

        at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:245)

        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$5.evaluate(Arquillian.java:259)

        at org.jboss.arquillian.junit.Arquillian$7.evaluate(Arquillian.java:321)

        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)

        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)

        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)

        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)

        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)

        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)

        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)

        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)

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

        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:363)

        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)

       

      my pom is :

       

      <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/xsd/maven-4.0.0.xsd">

        <modelVersion>4.0.0</modelVersion>

        <groupId>fr.esisar.prosensor</groupId>

        <artifactId>prosensor</artifactId>

        <version>0.0.1-SNAPSHOT</version>

        <packaging>war</packaging>

       

       

        <properties>

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

        <maven.compiler.target>1.7</maven.compiler.target>

        <maven.compiler.source>1.7</maven.compiler.source>

        <version.surefire.plugin>2.19</version.surefire.plugin>

        </properties>

        <dependencyManagement>

        <dependencies>

        <dependency>

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

        <artifactId>arquillian-bom</artifactId>

        <version>1.1.10</version>

        <scope>provided</scope>

        <type>pom</type>

        </dependency>

        </dependencies>

        </dependencyManagement>

        <dependencies>

        <dependency>

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

        <artifactId>jboss-as-arquillian-container-managed</artifactId>

        <version>7.2.0.Final</version>

        <scope>test</scope>

        </dependency>

        <dependency>

       

       

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

        <artifactId>jboss-as-server</artifactId>

        <version>7.1.1.Final</version>

        </dependency>

       

       

        <dependency>

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

        <artifactId>arquillian-core-api</artifactId>

        <version>1.1.10.Final</version>

        <scope>test</scope>

        </dependency>

        <dependency>

        <groupId>javax.enterprise</groupId>

        <artifactId>cdi-api</artifactId>

        <version>1.0-SP1</version>

        <scope>provided</scope>

        </dependency>

        <!-- Import the Common Annotations API (JSR-250), we use provided scope

        as the API is included in JBoss EAP 6 -->

        <dependency>

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

        <artifactId>jboss-annotations-api_1.1_spec</artifactId>

        <version>1.0.1.Final</version>

        </dependency>

       

       

        <!-- Import the JAX-RS API, we use provided scope as the API is included

        in JBoss EAP 6 -->

        <dependency>

        <groupId>org.jboss.spec.javax.ws.rs</groupId>

        <artifactId>jboss-jaxrs-api_1.1_spec</artifactId>

        <version>1.0.1.Final</version>

        </dependency>

       

       

        <!-- Import the JPA API, we use provided scope as the API is included in

        JBoss EAP 6 -->

        <dependency>

        <groupId>org.hibernate.javax.persistence</groupId>

        <artifactId>hibernate-jpa-2.0-api</artifactId>

        <version>1.0.1.Final</version>

        <scope>provided</scope>

        </dependency>

        <!-- Import the EJB API, we use provided scope as the API is included in

        JBoss EAP 6 -->

        <dependency>

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

        <artifactId>jboss-ejb-api_3.1_spec</artifactId>

        <version>1.0.1.Final</version>

        <scope>provided</scope>

        </dependency>

        <!-- JSR-303 (Bean Validation) Implementation -->

        <!-- Provides portable constraints such as @Email -->

        <!-- Hibernate Validator is shipped in JBoss EAP 6 -->

        <dependency>

        <groupId>org.hibernate</groupId>

        <artifactId>hibernate-validator</artifactId>

        <version>5.2.2.Final</version>

        <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 EAP 6 -->

        <dependency>

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

        <artifactId>jboss-jsf-api_2.1_spec</artifactId>

        <version>2.1.29.1.Final</version>

        <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>

        <version>5.0.6.Final</version>

        <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>

        <version>5.2.2.Final</version>

        <scope>provided</scope>

        </dependency>

        <!-- Needed for running tests (you may also use TestNG) -->

        <dependency>

        <groupId>junit</groupId>

        <artifactId>junit</artifactId>

        <version>4.12</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>

        <version>1.1.8.Final</version>

        <scope>test</scope>

        </dependency>

       

       

        <dependency>

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

        <artifactId>arquillian-test-spi</artifactId>

        <version>1.1.8.Final</version>

        </dependency>

       

       

        <dependency>

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

        <artifactId>arquillian-protocol-servlet</artifactId>

        <version>1.1.10.Final</version>

        <scope>test</scope>

        </dependency>

        <dependency>

        <groupId>org.jboss.shrinkwrap</groupId>

        <artifactId>shrinkwrap-depchain</artifactId>

        <version>1.2.3</version>

        <type>pom</type>

        </dependency>

        <dependency>

        <groupId>org.picketlink</groupId>

        <artifactId>picketlink-api</artifactId>

        <version>2.7.0.Final</version>

        </dependency>

        <dependency>

        <groupId>org.primefaces</groupId>

        <artifactId>primefaces</artifactId>

        <version>5.2</version>

        </dependency>

        <dependency>

        <groupId>org.picketlink</groupId>

        <artifactId>picketlink-impl</artifactId>

        <version>2.7.0.Final</version>

        </dependency>

        <dependency>

        <groupId>org.hornetq</groupId>

        <artifactId>hornetq-jms-server</artifactId>

        <version>2.4.7.Final</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>2.6</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 EAP container -->

        <!-- To use, run: mvn package jboss-as:deploy -->

        <plugin>

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

        <artifactId>jboss-as-maven-plugin</artifactId>

        <version>7.7.Final</version>

        </plugin>

        </plugins>

        </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 EAP instance -->

        <!-- This profile will start a new JBoss EAP 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>

        <version>7.2.0.Final</version>

        <scope>test</scope>

        </dependency>

        </dependencies>

        </profile>

        <profile>

        <!-- An optional Arquillian testing profile that executes tests in a remote

        JBoss EAP 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.2.0.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>

        </profiles>

      </project>

       

      My test is, as i told you, the tutorial with an assertion which can't be in failure :

       

      package capteur;

       

      import javax.inject.Inject;

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

      import org.jboss.arquillian.junit.Arquillian;

      import org.jboss.arquillian.test.spi.TestResult;

      import org.jboss.shrinkwrap.api.ShrinkWrap;

      import org.jboss.shrinkwrap.api.asset.EmptyAsset;

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

      import org.junit.Test;

      import org.junit.Assert;

      import org.junit.runner.RunWith;

       

       

       

       

      import Test_tests.Greeter;

       

       

      @RunWith(Arquillian.class)

      public class GreeterTest {

       

        @Deployment

        public static JavaArchive createDeployment() {

        return ShrinkWrap.create(JavaArchive.class)

        .addClass(Greeter.class)

        .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");

        }

       

       

       

       

        @Inject

        Greeter greeter;

       

       

        @Test

        public void should_create_greeting(){

        Assert.assertEquals(true,true);

        }

       

       

      }

       

       

      Thanks by advance !!

      Best regards.