Git Product home page Git Product logo

arquillian-extension-rest's People

Contributors

agoncal avatar aslakknutsen avatar bartoszmajsak avatar dependabot-preview[bot] avatar dependabot[bot] avatar felipe-alves-moraes avatar hanneskaeufler avatar jmnarloch avatar johnament avatar rosiecki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arquillian-extension-rest's Issues

Arquillian URL injection

When I config the container section on arquillian.xml specifing a different host:port on the protocol attribute and the host:port is in another machine different from localhost, arquillian rest continues using the rest endpoint as localhost, making the request to have zero response.

@ArquillianResteasyResource Service Self annotated.|

Hi,

I have all my services self annotated ( I don't have an interface ) this is a correct way of define the services, but this error occurs when I try to run a test.

@Test
public void restMethodTest(@ArquillianResteasyResource("rest/car") CarServicesImpl carService) {
java.lang.RuntimeException: You must use at least one, but no more than one http method annotation on: public final void java.lang.Object.wait() throws java.lang.InterruptedException
    at org.jboss.resteasy.client.jaxrs.ProxyBuilder.createClientInvoker(ProxyBuilder.java:76)
    at org.jboss.resteasy.client.jaxrs.ProxyBuilder.proxy(ProxyBuilder.java:52)
    at org.jboss.resteasy.client.jaxrs.ProxyBuilder.build(ProxyBuilder.java:120)

Resteasy version conflict

rest-client module heavily depends on resteasy-client which has significant API changes between 2.3.4 and 3.0.1.
I've seen that warp-impl-resteasy depends on 2.3.4. When I've switched it to 3.0.1 it stopped working.
And it's opposite for rest-client module. It depends on 3.0.1 and it breaks with 2.3.4.

Both rest-client and warp-impl-resteasy are so tightly bound to resteasy versions that even if we decide to use one version of resteasy then our extensions will be useless for users who have differend resteasy version.

How should we proceed in this situation?

Test REST api with Authentication using Arquillian

Is it possible to test rest api with Authentication?

Do you have any docs about this?

Can you look at this stackoverflow post with code
http://stackoverflow.com/questions/40704772/test-rest-api-with-authentication-using-arquillian

Console log is:
21:09:41,378 INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 2) Initializing Mojarra 2.2.13.SP1 20160303-1204 for context '/test' 21:09:41,864 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 2) WFLYUT0021: Registered web context: /test 21:09:41,908 INFO [org.jboss.as.server] (management-handler-thread - 4) WFLYSRV0010: Deployed "test.war" (runtime-name : "test.war") DEBUG [org.xnio.nio] Started channel thread 'Remoting "endpoint" I/O-1', selector sun.nio.ch.KQueueSelectorImpl@140555bf DEBUG [org.jboss.remotingjmx.VersionedConectionFactory] Available version (Versions 0x00 0x01) DEBUG [org.jboss.remotingjmx.VersionedConectionFactory] Calling a stable server DEBUG [org.jboss.remotingjmx.VersionedConectionFactory] Selecting version 0x00 to receive full version list. DEBUG [org.jboss.remotingjmx.VersionedConectionFactory] Available version (Versions 0x01 0x02) DEBUG [org.jboss.remotingjmx.VersionedConectionFactory] Calling a stable server DEBUG [org.jboss.remotingjmx.VersionedConectionFactory] Server version 2.0.1.Final DEBUG [org.jboss.resteasy.resteasy_jaxrs.i18n] RESTEASY002330: Unable to retrieve config: expandEntityReferences defaults to false DEBUG [org.jboss.resteasy.resteasy_jaxrs.i18n] RESTEASY002335: Unable to retrieve config: enableSecureProcessingFeature defaults to true DEBUG [org.jboss.resteasy.resteasy_jaxrs.i18n] RESTEASY002325: Unable to retrieve config: disableDTDs defaults to true DEBUG [org.jboss.resteasy.resteasy_jaxrs.i18n] RESTEASY002330: Unable to retrieve config: expandEntityReferences defaults to false DEBUG [org.jboss.resteasy.resteasy_jaxrs.i18n] RESTEASY002335: Unable to retrieve config: enableSecureProcessingFeature defaults to true DEBUG [org.jboss.resteasy.resteasy_jaxrs.i18n] RESTEASY002325: Unable to retrieve config: disableDTDs defaults to true INFO [com.project.cm.api.configuration.service.TESTServiceImpl] @ArquillianResteasyResource("api/data_conf/getData") DEBUG [org.apache.http.impl.conn.BasicClientConnectionManager] Get connection for route {}->http://127.0.0.1:8080 DEBUG [org.apache.http.impl.conn.DefaultClientConnectionOperator] Connecting to 127.0.0.1:8080 DEBUG [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: default DEBUG [org.apache.http.client.protocol.RequestAuthCache] Auth cache not set in the context DEBUG [org.apache.http.client.protocol.RequestProxyAuthentication] Proxy auth state: UNCHALLENGED DEBUG [org.apache.http.impl.client.DefaultHttpClient] Attempt 1 to execute request DEBUG [org.apache.http.impl.conn.DefaultClientConnection] Sending request: POST /test/data_conf/getData HTTP/1.1 DEBUG [org.apache.http.wire] >> "POST /test/data_conf/getData HTTP/1.1[\r][\n]" DEBUG [org.apache.http.wire] >> "Accept: application/json[\r][\n]" DEBUG [org.apache.http.wire] >> "Accept-Encoding: gzip, deflate[\r][\n]" DEBUG [org.apache.http.wire] >> "Authorization: TOKEN[\r][\n]" DEBUG [org.apache.http.wire] >> "Content-Type: application/json[\r][\n]" DEBUG [org.apache.http.wire] >> "Content-Length: 180[\r][\n]" DEBUG [org.apache.http.wire] >> "Host: 127.0.0.1:8080[\r][\n]" DEBUG [org.apache.http.wire] >> "Connection: Keep-Alive[\r][\n]" DEBUG [org.apache.http.wire] >> "[\r][\n]" DEBUG [org.apache.http.headers] >> POST /test/data_conf/getData HTTP/1.1 DEBUG [org.apache.http.headers] >> Accept: application/json DEBUG [org.apache.http.headers] >> Accept-Encoding: gzip, deflate DEBUG [org.apache.http.headers] >> Authorization: TOKEN DEBUG [org.apache.http.headers] >> Content-Type: application/json DEBUG [org.apache.http.headers] >> Content-Length: 180 DEBUG [org.apache.http.headers] >> Host: 127.0.0.1:8080 DEBUG [org.apache.http.headers] >> Connection: Keep-Alive DEBUG [org.apache.http.wire] >> "{"info":{"os":"Test","osVer":"Test","type":"Test","prot":"Test","appVer":"Test","model":null,"carrier":"Test","lang":"Test","instId":"Test","cnfHash":null,"cnfId":null,"cnf":null}}" DEBUG [org.apache.http.wire] << "HTTP/1.1 405 Method Not Allowed[\r][\n]" DEBUG [org.apache.http.wire] << "Connection: keep-alive[\r][\n]" DEBUG [org.apache.http.wire] << "X-Powered-By: Undertow/1[\r][\n]" DEBUG [org.apache.http.wire] << "Server: WildFly/10[\r][\n]" DEBUG [org.apache.http.wire] << "Content-Type: text/html;charset=UTF-8[\r][\n]" DEBUG [org.apache.http.wire] << "Content-Length: 104[\r][\n]" DEBUG [org.apache.http.wire] << "Date: Sun, 27 Nov 2016 19:09:47 GMT[\r][\n]" DEBUG [org.apache.http.wire] << "[\r][\n]" DEBUG [org.apache.http.impl.conn.DefaultClientConnection] Receiving response: HTTP/1.1 405 Method Not Allowed DEBUG [org.apache.http.headers] << HTTP/1.1 405 Method Not Allowed DEBUG [org.apache.http.headers] << Connection: keep-alive DEBUG [org.apache.http.headers] << X-Powered-By: Undertow/1 DEBUG [org.apache.http.headers] << Server: WildFly/10 DEBUG [org.apache.http.headers] << Content-Type: text/html;charset=UTF-8 DEBUG [org.apache.http.headers] << Content-Length: 104 DEBUG [org.apache.http.headers] << Date: Sun, 27 Nov 2016 19:09:47 GMT DEBUG [org.apache.http.impl.client.DefaultHttpClient] Connection can be kept alive indefinitely INFO [com.project.cm.api.configuration.service.TESTServiceImpl] Response response = webTarget 21:09:47,730 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 2) WFLYUT0022: Unregistered web context: /test 21:09:47,751 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 61) WFLYJPA0011: Stopping Persistence Unit (phase 2 of 2) Service 'test.war#project-arquillian'

Expand README

Current README is rather brief. Adding small code samples would make it more appealing to people who encounter this extension for the first time.

mvn package hangs during tests

I've observed this both on a Mac (JDK 1.8.0_92) and RHEL 6.8 (openjdk 1.8.0_101).
mvn package hangs during the first set of tests run, thus:

$ mvn package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Arquillian REST Extension: Parent
[INFO] Arquillian REST Client Extension: API
[INFO] Arquillian REST Client Extension: Test app
[INFO] Arquillian REST Client Extension: Implementation base
[INFO] Arquillian REST Client Extension: Implementation 2x
[INFO] Arquillian REST Client Extension: Implementation 3x
[INFO] Arquillian REST Client Extension: Implementation JAX-RS 2.0 Client APIs
[INFO] Arquillian REST Client Extension: Implementation Jersey
[INFO] Arquillian REST Client Extension: Impl-2x Functional Tests
[INFO] Arquillian REST Client Extension: Impl-3x Functional Tests
[INFO] Arquillian REST Client Extension: Impl-Jersey Functional Tests
[INFO] Arquillian REST Client Extension: Parent
[INFO] Arquillian Warp REST Extension: Parent
[INFO] Arquillian Warp REST Extension: API
[INFO] Arquillian Warp REST Extension: SPI
[INFO] Arquillian Warp REST Extension: Implementation
[INFO] Arquillian Warp REST Extension: Implementation Base
[INFO] Arquillian Warp REST Extension: Resteasy
[INFO] Arquillian Warp REST Extension: Jersey
[INFO] Arquillian Warp REST Extension: CXF
[INFO] Arquillian Warp REST Extension: JAX-RS 2.0
[INFO] Arquillian Warp REST Extension: BOM
[INFO] Arquillian Warp REST Extension: Functional Tests
[INFO] Arquillian Warp REST Extension: Resteasy Functional Tests
[INFO] Arquillian Warp REST Extension: Jersey Functional Tests
[INFO] Arquillian Warp REST Extension: CXF Functional Tests
[INFO] Arquillian Warp REST Extension: JAX-RS 2.0 Functional Tests
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Arquillian REST Extension: Parent 1.0.0.Final-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]

... lots of build log omitted ...

[INFO] ------------------------------------------------------------------------
[INFO] Building Arquillian REST Client Extension: Implementation 2x 1.0.0.Final-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/org/jboss/arquillian/junit/arquillian-junit-container/1.1.11.Final/arquillian-junit-container-1.1.11.Final.pom

... lots of build log omitted ...

[WARNING] /Users/rwalker/Software/arquillian/arquillian-extension-rest-github/rest-client/impl/impl-2x/src/test/java/org/jboss/arquillian/extension/rest/RestClientTestCase.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-dependency-plugin:2.8:unpack (unpack) @ arquillian-rest-client-impl-2x ---
[INFO] Configured Artifact: org.jboss.as:jboss-as-dist:7.1.1.Final:zip
[INFO] Unpacking /Users/rwalker/.m2/repository/org/jboss/as/jboss-as-dist/7.1.1.Final/jboss-as-dist-7.1.1.Final.zip to /Users/rwalker/Software/arquillian/arquillian-extension-rest-github/rest-client/impl/impl-2x/target with includes "" and excludes ""
[INFO]
[INFO] --- maven-surefire-plugin:2.16:test (default-test) @ arquillian-rest-client-impl-2x ---
[INFO] Surefire report directory: /Users/rwalker/Software/arquillian/arquillian-extension-rest-github/rest-client/impl/impl-2x/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.jboss.arquillian.extension.rest.RestClientTestCase
Sep 19, 2016 10:39:30 AM org.jboss.as.arquillian.container.managed.ManagedDeployableContainer startInternal
INFO: Starting container with: [/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/bin/java, -Xmx512m, -XX:MaxPermSize=128m, -ea, -Djboss.home.dir=target/jboss-as-7.1.1.Final, -Dorg.jboss.boot.log.file=target/jboss-as-7.1.1.Final/standalone/log/boot.log, -Dlogging.configuration=file:target/jboss-as-7.1.1.Final/standalone/configuration/logging.properties, -Djboss.modules.dir=/Users/rwalker/Software/arquillian/arquillian-extension-rest-github/rest-client/impl/impl-2x/target/jboss-as-7.1.1.Final/modules, -Djboss.bundles.dir=/Users/rwalker/Software/arquillian/arquillian-extension-rest-github/rest-client/impl/impl-2x/target/jboss-as-7.1.1.Final/bundles, -jar, /Users/rwalker/Software/arquillian/arquillian-extension-rest-github/rest-client/impl/impl-2x/target/jboss-as-7.1.1.Final/jboss-modules.jar, -mp, target/jboss-as-7.1.1.Final/modules, -jaxpmodule, javax.xml.jaxp-provider, org.jboss.as.standalone, -server-config, standalone.xml]
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
Sep 19, 2016 10:39:30 AM org.xnio.Xnio <clinit>
INFO: XNIO Version 3.0.0.GA
Sep 19, 2016 10:39:30 AM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.0.0.GA
Sep 19, 2016 10:39:30 AM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.3.GA
10:39:31,653 INFO  [org.jboss.modules] JBoss Modules version 1.1.1.GA
10:39:32,189 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA
10:39:32,358 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting

It hung at this point, using CPU (i.e., not idling).

A subsequent run of mvn package got further:

Sep 19, 2016 11:04:47 AM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.3.GA
11:04:47,318 INFO  [org.jboss.modules] JBoss Modules version 1.1.1.GA
11:04:47,912 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA
11:04:47,950 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting
11:04:48,758 INFO  [org.xnio] XNIO Version 3.0.3.GA
11:04:48,758 INFO  [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
11:04:48,769 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
11:04:48,776 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.3.GA
11:04:48,796 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
11:04:48,798 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem
11:04:48,803 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.
11:04:48,821 INFO  [org.jboss.as.connector] (MSC service thread 1-3) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)
11:04:48,851 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
11:04:49,055 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
11:04:49,058 INFO  [org.jboss.as.naming] (MSC service thread 1-7) JBAS011802: Starting Naming Service
11:04:49,060 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-1) JBAS015400: Bound mail session [java:jboss/mail/Default]
11:04:49,064 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem
11:04:49,089 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem
11:04:49,096 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
11:04:49,133 INFO  [org.jboss.as.security] (MSC service thread 1-8) JBAS013100: Current PicketBox version=4.0.7.Final
11:04:49,237 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-6) JBoss Web Services - Stack CXF Server 4.0.2.GA
11:04:49,245 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-4) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080
11:04:49,752 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]

before also hanging, with high CPU usage.

These seem to be the first set of tests run (related to Implementation 2x).

While it is hung:

$ ps ax|grep java
54736 s019  S+     0:11.31 /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/bin/java -classpath /sw/share/maven/boot/plexus-classworlds-2.5.1.jar -Dclassworlds.conf=/sw/etc/maven/m2.conf -Dmaven.home=/sw/share/maven org.codehaus.plexus.classworlds.launcher.Launcher package
54742 s019  S+     0:00.00 /bin/sh -c cd /Users/rwalker/Software/arquillian/arquillian-extension-rest-github/rest-client/impl/impl-2x && /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/bin/java -jar /Users/rwalker/Software/arquillian/arquillian-extension-rest-github/rest-client/impl/impl-2x/target/surefire/surefirebooter228323799662918306.jar /Users/rwalker/Software/arquillian/arquillian-extension-rest-github/rest-client/impl/impl-2x/target/surefire/surefire4350475965289922522tmp /Users/rwalker/Software/arquillian/arquillian-extension-rest-github/rest-client/impl/impl-2x/target/surefire/surefire_05511785757262244086tmp
54743 s019  S+     0:02.84 /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/bin/java -jar /Users/rwalker/Software/arquillian/arquillian-extension-rest-github/rest-client/impl/impl-2x/target/surefire/surefirebooter228323799662918306.jar /Users/rwalker/Software/arquillian/arquillian-extension-rest-github/rest-client/impl/impl-2x/target/surefire/surefire4350475965289922522tmp /Users/rwalker/Software/arquillian/arquillian-extension-rest-github/rest-client/impl/impl-2x/target/surefire/surefire_05511785757262244086tmp
54744 s019  R+    10:04.52 /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/bin/java -Xmx512m -XX:MaxPermSize=128m -ea -Djboss.home.dir=target/jboss-as-7.1.1.Final -Dorg.jboss.boot.log.file=target/jboss-as-7.1.1.Final/standalone/log/boot.log -Dlogging.configuration=file:target/jboss-as-7.1.1.Final/standalone/configuration/logging.properties -Djboss.modules.dir=/Users/rwalker/Software/arquillian/arquillian-extension-rest-github/rest-client/impl/impl-2x/target/jboss-as-7.1.1.Final/modules -Djboss.bundles.dir=/Users/rwalker/Software/arquillian/arquillian-extension-rest-github/rest-client/impl/impl-2x/target/jboss-as-7.1.1.Final/bundles -jar /Users/rwalker/Software/arquillian/arquillian-extension-rest-github/rest-client/impl/impl-2x/target/jboss-as-7.1.1.Final/jboss-modules.jar -mp target/jboss-as-7.1.1.Final/modules -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone -server-config standalone.xml

The above is with a checkout of HEAD. I also downloaded the release file arquillian-extension-rest-1.0.0.Alpha4.tar.gz and tried that; mvn package hangs in the tests run after the build section Building Arquillian REST Client Extension: Implementation 2x 1.0.0.Alpha4.

Write readmes

Now when we have both server and client sides of rest testing covered, it's time to write proper readme for each module. We should probably write detail blog posts about new features.

@ArquillianResteasyResource as class attribute

@ArquillianResteasyResource annotation is used as method parameter, for example:

@Test
 public void getCustomerById(@ArquillianResteasyResource CustomerResource customerResource)

but in some cases (in my case for integration with cukes on space), it will be useful if we could use @ArquillianResteasyResource as attribute of a class like @ArquillianResource does. Something like:

@ArquillianResteasyResource CustomerResource customerResource

@Test
public void getCustomerById() {}

Currently a NullPointerException is thrown.

Split project

Currently the only RESt framework supported by the extension is RestEasy, but if for example you are using Apache TomEE you would like to run your client tests with Apache CXF (so no more dependencies are downloaded). I think that would be amazing to split the project so you can provide your implementation of client to be used. Something like arquillian recorder that you can implement your own screenshot shooter or videorecorder.

Jersey client on glassfish embedded/remote crashes

Issue Overview

According to the readme, I should be able to swap out

		<dependency>
			<groupId>org.jboss.arquillian.extension</groupId>
			<artifactId>arquillian-rest-client-impl-3x</artifactId>
			<version>1.0.0.Alpha4</version>
			<scope>test</scope>
		</dependency>

with

		<dependency>
			<groupId>org.jboss.arquillian.extension</groupId>
			<artifactId>arquillian-rest-client-impl-jersey</artifactId>
			<version>1.0.0.Alpha4</version>
			<scope>test</scope>
		</dependency>

However, this fails. Am I wrong in expecting this to work?

Expected Behaviour

Builds and tests pass

Current Behaviour

Tests fail with

java.lang.NoSuchMethodError: org.glassfish.jersey.model.internal.CommonConfig.configureAutoDiscoverableProviders(Lorg/glassfish/hk2/api/ServiceLocator;)V

For entire stacktrace see https://travis-ci.org/hanneskaeufler/java-ee-rest-api-playground/builds/186091299

Steps To Reproduce
  1. Replace resteasy 3x with jersey implementation
  2. Run tests
Additional Information

I am building this with the following maven details:

For the entire pom see https://github.com/hanneskaeufler/java-ee-rest-api-playground/blob/master/BooksApi-web/pom.xml

<details>
 <summary>$mvn --version</summary>
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: /usr/local/Cellar/maven/3.3.9/libexec
Java version: 1.8.0_112, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.2", arch: "x86_64", family: "mac"
</details>

Dump HTTP

is it possible to dump out the text of the HTTP Request/response? if so could it be documented? if not could that happen, and then be documented? this would be very useful for debugging

Test is skipped if using TestNG

I've written a short test that uses the wildfly-arquillian-container-remote. The test is executed if using JUnit but skipped with TestNG.

The signature of the test is something like this:

@test
public void testMyResource(@ArquillianResteasyResource MyResource myResource)

Current versions of wildfly artifacts are 8.2.0.Final and of arquillian rest extension is 1.0.0.Alpha3.

ClassCastException JerseyWebTarget

Bug report / Enhancement

Please follow template provided below

Issue Overview

ClassCastException appears using Jersey included in Payara embedded and the Arquillian REST Extension. The Fix should be easy. In Line 28 of org.jboss.arquillian.extension.rest.client.RestEnricher

remove the cast and change to (maybe also the variable name)

WebTarget jerseyWebTarget = webTarget;

Expected Behaviour

No ClassCastException

Current Behaviour

ClassCastException

Steps To Reproduce
  1. Create a maven project with

     <dependency>
     	<groupId>fish.payara.extras</groupId>
     	<artifactId>payara-embedded-all</artifactId>
     	<version>5.182</version>
     	<scope>test</scope>
     </dependency>
     <dependency>
     	<groupId>org.jboss.arquillian.container</groupId>
     	<artifactId>arquillian-glassfish-embedded-3.1</artifactId>
     	<version>1.0.2</version>
     	<scope>test</scope> 
     </dependency>
     <dependency>
     	<groupId>org.jboss.arquillian.extension</groupId>
     	<artifactId>arquillian-rest-client-impl-jersey</artifactId>
     	<version>1.0.0.Alpha4</version>
     	<scope>test</scope> 
     </dependency>
    
  2. Create an Arquillian test with @ArquillianResteasyResource

  3. Run Test

Additional Information
java.lang.ClassCastException: fish.payara.requesttracing.jaxrs.client.decorators.JaxrsWebTargetDecorator cannot be cast to org.glassfish.jersey.client.JerseyWebTarget at org.jboss.arquillian.extension.rest.client.RestEnricher.enrichByType(RestEnricher.java:28) at org.jboss.arquillian.extension.rest.client.BaseRestEnricher.resolve(BaseRestEnricher.java:74) at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.enrichArguments(LocalTestExecuter.java:83) at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:58) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86) at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103) at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90) at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133) at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105) at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:62) at org.jboss.arquillian.container.test.impl.execution.ClientTestExecuter.execute(ClientTestExecuter.java:50) ... $mvn --version Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00) Maven home: C:\maven\bin\.. Java version: 1.8.0_161, vendor: Oracle Corporation Java home: C:\Program Files\Java\jdk1.8.0_161\jre Default locale: de_DE, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "dos"
```

ClassCastException is thrown if Jersey is used.

I am using Arquillian-Rest-Extension to test REST services. The server part is implemented using Jersey (not RestEasy). The problem is that when query params are set a classcastexception is thrown.

java.lang.ClassCastException: org.glassfish.jersey.uri.internal.JerseyUriBuilder cannot be cast to org.jboss.resteasy.specimpl.ResteasyUriBuilder
    at org.jboss.resteasy.client.jaxrs.internal.ClientWebTarget.queryParamNoTemplate(ClientWebTarget.java:287)
    at org.jboss.resteasy.client.jaxrs.internal.proxy.processors.webtarget.QueryParamProcessor.apply(QueryParamProcessor.java:23)
    at org.jboss.resteasy.client.jaxrs.internal.proxy.processors.webtarget.QueryParamProcessor.apply(QueryParamProcessor.java:12)

The problem is at line 287 where there are a clone and a cast:

ResteasyUriBuilder copy = (ResteasyUriBuilder)uriBuilder.clone();
for (String obj : stringValues)
{
    copy.clientQueryParam(name, obj);
}

copy should be casted not to the interface UriBuilder but to ResteasyUriBuilder because clientQueryParam is a method from that class. Of course it can be very solutions to that problem:

  • implement an ArquillianJerseyResource annotation
  • ?¿maybe exclude Jersey dependency from test?¿ But then server won't receive it and I need it because it is a Tomcat.
  • maybe calling replaceQueryParam which is a method from UriBuilder interface.

WDYT?

Missing glassfish 3.1 support

Hi,

It is possible to support glassfish 3.1.x? Running tests with rest clients against a glassfish remote instance will throws

Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/jersey/multipart/BodyPart
at org.jboss.arquillian.container.glassfish.remote_3_1.GlassFishRestDeployableContainer.setup(GlassFishRestDeployableContainer.java:55)

Adding dependencies of jersey 1.x will not solve the problem.

Thanks.

Global profiles

Currently each module has duplicate definitions of profiles related to container used by Arquillian.
It would be easier to maintain that if such profiles were defined in parent module.

Travis Build failing because of JDK version

Issue Overview

Travis is failing to build several arquilian projects, checking the log the cause seems to be an outdated jdk version.

Expected Behaviour

Build install jdk correctly.

Current Behaviour
install-jdk.sh 2020-06-02

Expected feature release number in range of 9 to 16, but got: 7

The command "~/bin/install-jdk.sh --target "/home/travis/openjdk7" --workspace "/home/travis/.cache/install-jdk" --feature "7" --license "GPL" --cacerts" failed and exited with 3 during .
Steps To Reproduce
  1. Access the last triggered Travis build: https://travis-ci.org/github/arquillian/arquillian-extension-rest/jobs/727334489
  2. Check the job log.
Additional Information

I created a PR with the fix #76
Not sure if this is the correct behavior, but I couldn't find nothing about Code Of Conduct for contributions in the project website.

Sorry If I disrespected some rule!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.