You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Alex Soto <as...@gmail.com> on 2015/03/25 10:43:49 UTC
Arquillian Warp and TomEE
i currently I am developing a test and I want to use Arquillian Warp.
Currently I am using Arquillian 1.1.7, latest Warp and Managed Apache TomEE
1.7.1. The test is as simple as:
@RunWith(Arquillian.class)@WarpTestpublic class RestUploadTest {
@Deployment
public static final WebArchive deployment() {
return ShrinkWrap
.create(WebArchive.class)
.addClasses(BoundedInputStream.class, IOUtil.class,
P12Resource.class, TemporaryFolder.class)
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
.addAsLibraries(
Maven.resolver().loadPomFromFile("pom.xml")
.resolve("org.glassfish:javax.json")
.withTransitivity().as(JavaArchive.class));
}
@ArquillianResource
URL baseUrl;
@Test
@RunAsClient
public void shouldUploadContent() {
Warp.initiate(() -> {
URI endpoint = UriBuilder.fromPath(baseUrl.toExternalForm())
.path(P12Resource.class).path("chunkedUpload").build();
given().request().body("This is a test file.".getBytes())
.post(endpoint).then().assertThat()
.body("uploadId", notNullValue()).and()
.body("offset", notNullValue());
}).inspect(new Inspection() {
private static final long serialVersionUID = 1L;
@Inject
TemporaryFolder temporaryFolder;
@AfterServlet
public void assertCreatedFile() {
System.out.println(temporaryFolder.getRoot());
}
});
}
}
The problem is that temporaryFolder is not injected and its value is null.
Note that TemporaryFolder is a class that I have developed and injected
correctly on my business class (EJB).
Talking with Aslak noticed me that it can be something related with how
TomEE enrichment API but of course he is not 100% sure (
http://discuss.arquillian.org/t/arquillian-warp-and-cdi-in-inspection/170)
Also I can share code without any problem.
Thank you so much.
Alex.
Re: Arquillian Warp and TomEE
Posted by Romain Manni-Bucau <rm...@gmail.com>.
it is green here
did you rebuild from sources?
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-03-25 14:16 GMT+01:00 Alex Soto <as...@gmail.com>:
> With 1.7.2 another exception is thrown
>
> http://discuss.arquillian.org/t/arquillian-warp-and-cdi-in-inspection/170/4?u=lordofthejars
> But in theory the code is correct so not sure where it can be the problem.
>
> El dc., 25 març, 2015 a les 11:58, Alex Soto (<as...@gmail.com>) va
> escriure:
>
> > hehehee then I need TomEE 1.7.2 right now :D. I am going to test it with
> > SNAPSHOT version.
> >
> > El dc., 25 març, 2015 a les 11:36, Romain Manni-Bucau (<
> > rmannibucau@gmail.com>) va escriure:
> >
> > Ok, thought we already fixed it:
> >> https://issues.apache.org/jira/browse/TOMEE-1530
> >>
> >>
> >> Romain Manni-Bucau
> >> @rmannibucau <https://twitter.com/rmannibucau> | Blog
> >> <http://rmannibucau.wordpress.com> | Github <https://github.com/
> >> rmannibucau> |
> >> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> >> <http://www.tomitribe.com>
> >>
> >> 2015-03-25 11:05 GMT+01:00 Alex Soto <as...@gmail.com>:
> >>
> >> > Yes you can download from
> >> > https://github.com/Scytl/restguide/tree/master/sources/rest-chunk and
> >> > using
> >> > mvn clean test you will get the error.
> >> >
> >> > Alex.
> >> >
> >> > El dc., 25 març, 2015 a les 10:47, Romain Manni-Bucau (<
> >> > rmannibucau@gmail.com>) va escriure:
> >> >
> >> > > we have our own enricher but it is still arquillian SPI.
> >> > >
> >> > > If you can share something running on maven and without all jboss
> >> > > dependencies (all jboss EE stack ;)) I can have a look in the day
> >> > >
> >> > >
> >> > > Romain Manni-Bucau
> >> > > @rmannibucau <https://twitter.com/rmannibucau> | Blog
> >> > > <http://rmannibucau.wordpress.com> | Github <https://github.com/
> >> > > rmannibucau> |
> >> > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> >> > > <http://www.tomitribe.com>
> >> > >
> >> > > 2015-03-25 10:43 GMT+01:00 Alex Soto <as...@gmail.com>:
> >> > >
> >> > > > i currently I am developing a test and I want to use Arquillian
> >> Warp.
> >> > > > Currently I am using Arquillian 1.1.7, latest Warp and Managed
> >> Apache
> >> > > TomEE
> >> > > > 1.7.1. The test is as simple as:
> >> > > >
> >> > > > @RunWith(Arquillian.class)@WarpTestpublic class RestUploadTest {
> >> > > >
> >> > > > @Deployment
> >> > > > public static final WebArchive deployment() {
> >> > > > return ShrinkWrap
> >> > > > .create(WebArchive.class)
> >> > > > .addClasses(BoundedInputStream.class,
> IOUtil.class,
> >> > > > P12Resource.class, TemporaryFolder.class)
> >> > > > .addAsWebInfResource(EmptyAsset.INSTANCE,
> >> "beans.xml")
> >> > > > .addAsLibraries(
> >> > > > Maven.resolver().loadPomFromFile("pom.xml")
> >> > > > .resolve("org.glassfish:javax.json")
> >> > > >
> .withTransitivity().as(JavaArchive.class));
> >> > > > }
> >> > > >
> >> > > > @ArquillianResource
> >> > > > URL baseUrl;
> >> > > >
> >> > > > @Test
> >> > > > @RunAsClient
> >> > > > public void shouldUploadContent() {
> >> > > > Warp.initiate(() -> {
> >> > > >
> >> > > > URI endpoint =
> >> > UriBuilder.fromPath(baseUrl.toExternalForm())
> >> > > > .path(P12Resource.class).path(
> >> "chunkedUpload").build();
> >> > > > given().request().body("This is a test
> >> file.".getBytes())
> >> > > > .post(endpoint).then().assertThat()
> >> > > > .body("uploadId", notNullValue()).and()
> >> > > > .body("offset", notNullValue());
> >> > > >
> >> > > > }).inspect(new Inspection() {
> >> > > > private static final long serialVersionUID = 1L;
> >> > > >
> >> > > > @Inject
> >> > > > TemporaryFolder temporaryFolder;
> >> > > >
> >> > > > @AfterServlet
> >> > > > public void assertCreatedFile() {
> >> > > > System.out.println(temporaryFolder.getRoot());
> >> > > > }
> >> > > >
> >> > > > });
> >> > > >
> >> > > > }
> >> > > >
> >> > > > }
> >> > > >
> >> > > > The problem is that temporaryFolder is not injected and its value
> is
> >> > > null.
> >> > > > Note that TemporaryFolder is a class that I have developed and
> >> injected
> >> > > > correctly on my business class (EJB).
> >> > > >
> >> > > > Talking with Aslak noticed me that it can be something related
> with
> >> how
> >> > > > TomEE enrichment API but of course he is not 100% sure (
> >> > > > http://discuss.arquillian.org/t/arquillian-warp-and-cdi-in-
> >> > > inspection/170)
> >> > > >
> >> > > > Also I can share code without any problem.
> >> > > >
> >> > > > Thank you so much.
> >> > > >
> >> > > > Alex.
> >> > > >
> >> > >
> >> >
> >>
> >
>
Re: Arquillian Warp and TomEE
Posted by Alex Soto <as...@gmail.com>.
With 1.7.2 another exception is thrown
http://discuss.arquillian.org/t/arquillian-warp-and-cdi-in-inspection/170/4?u=lordofthejars
But in theory the code is correct so not sure where it can be the problem.
El dc., 25 març, 2015 a les 11:58, Alex Soto (<as...@gmail.com>) va
escriure:
> hehehee then I need TomEE 1.7.2 right now :D. I am going to test it with
> SNAPSHOT version.
>
> El dc., 25 març, 2015 a les 11:36, Romain Manni-Bucau (<
> rmannibucau@gmail.com>) va escriure:
>
> Ok, thought we already fixed it:
>> https://issues.apache.org/jira/browse/TOMEE-1530
>>
>>
>> Romain Manni-Bucau
>> @rmannibucau <https://twitter.com/rmannibucau> | Blog
>> <http://rmannibucau.wordpress.com> | Github <https://github.com/
>> rmannibucau> |
>> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
>> <http://www.tomitribe.com>
>>
>> 2015-03-25 11:05 GMT+01:00 Alex Soto <as...@gmail.com>:
>>
>> > Yes you can download from
>> > https://github.com/Scytl/restguide/tree/master/sources/rest-chunk and
>> > using
>> > mvn clean test you will get the error.
>> >
>> > Alex.
>> >
>> > El dc., 25 març, 2015 a les 10:47, Romain Manni-Bucau (<
>> > rmannibucau@gmail.com>) va escriure:
>> >
>> > > we have our own enricher but it is still arquillian SPI.
>> > >
>> > > If you can share something running on maven and without all jboss
>> > > dependencies (all jboss EE stack ;)) I can have a look in the day
>> > >
>> > >
>> > > Romain Manni-Bucau
>> > > @rmannibucau <https://twitter.com/rmannibucau> | Blog
>> > > <http://rmannibucau.wordpress.com> | Github <https://github.com/
>> > > rmannibucau> |
>> > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
>> > > <http://www.tomitribe.com>
>> > >
>> > > 2015-03-25 10:43 GMT+01:00 Alex Soto <as...@gmail.com>:
>> > >
>> > > > i currently I am developing a test and I want to use Arquillian
>> Warp.
>> > > > Currently I am using Arquillian 1.1.7, latest Warp and Managed
>> Apache
>> > > TomEE
>> > > > 1.7.1. The test is as simple as:
>> > > >
>> > > > @RunWith(Arquillian.class)@WarpTestpublic class RestUploadTest {
>> > > >
>> > > > @Deployment
>> > > > public static final WebArchive deployment() {
>> > > > return ShrinkWrap
>> > > > .create(WebArchive.class)
>> > > > .addClasses(BoundedInputStream.class, IOUtil.class,
>> > > > P12Resource.class, TemporaryFolder.class)
>> > > > .addAsWebInfResource(EmptyAsset.INSTANCE,
>> "beans.xml")
>> > > > .addAsLibraries(
>> > > > Maven.resolver().loadPomFromFile("pom.xml")
>> > > > .resolve("org.glassfish:javax.json")
>> > > > .withTransitivity().as(JavaArchive.class));
>> > > > }
>> > > >
>> > > > @ArquillianResource
>> > > > URL baseUrl;
>> > > >
>> > > > @Test
>> > > > @RunAsClient
>> > > > public void shouldUploadContent() {
>> > > > Warp.initiate(() -> {
>> > > >
>> > > > URI endpoint =
>> > UriBuilder.fromPath(baseUrl.toExternalForm())
>> > > > .path(P12Resource.class).path(
>> "chunkedUpload").build();
>> > > > given().request().body("This is a test
>> file.".getBytes())
>> > > > .post(endpoint).then().assertThat()
>> > > > .body("uploadId", notNullValue()).and()
>> > > > .body("offset", notNullValue());
>> > > >
>> > > > }).inspect(new Inspection() {
>> > > > private static final long serialVersionUID = 1L;
>> > > >
>> > > > @Inject
>> > > > TemporaryFolder temporaryFolder;
>> > > >
>> > > > @AfterServlet
>> > > > public void assertCreatedFile() {
>> > > > System.out.println(temporaryFolder.getRoot());
>> > > > }
>> > > >
>> > > > });
>> > > >
>> > > > }
>> > > >
>> > > > }
>> > > >
>> > > > The problem is that temporaryFolder is not injected and its value is
>> > > null.
>> > > > Note that TemporaryFolder is a class that I have developed and
>> injected
>> > > > correctly on my business class (EJB).
>> > > >
>> > > > Talking with Aslak noticed me that it can be something related with
>> how
>> > > > TomEE enrichment API but of course he is not 100% sure (
>> > > > http://discuss.arquillian.org/t/arquillian-warp-and-cdi-in-
>> > > inspection/170)
>> > > >
>> > > > Also I can share code without any problem.
>> > > >
>> > > > Thank you so much.
>> > > >
>> > > > Alex.
>> > > >
>> > >
>> >
>>
>
Re: Arquillian Warp and TomEE
Posted by Alex Soto <as...@gmail.com>.
hehehee then I need TomEE 1.7.2 right now :D. I am going to test it with
SNAPSHOT version.
El dc., 25 març, 2015 a les 11:36, Romain Manni-Bucau (<
rmannibucau@gmail.com>) va escriure:
> Ok, thought we already fixed it:
> https://issues.apache.org/jira/browse/TOMEE-1530
>
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> | Blog
> <http://rmannibucau.wordpress.com> | Github <https://github.com/
> rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> <http://www.tomitribe.com>
>
> 2015-03-25 11:05 GMT+01:00 Alex Soto <as...@gmail.com>:
>
> > Yes you can download from
> > https://github.com/Scytl/restguide/tree/master/sources/rest-chunk and
> > using
> > mvn clean test you will get the error.
> >
> > Alex.
> >
> > El dc., 25 març, 2015 a les 10:47, Romain Manni-Bucau (<
> > rmannibucau@gmail.com>) va escriure:
> >
> > > we have our own enricher but it is still arquillian SPI.
> > >
> > > If you can share something running on maven and without all jboss
> > > dependencies (all jboss EE stack ;)) I can have a look in the day
> > >
> > >
> > > Romain Manni-Bucau
> > > @rmannibucau <https://twitter.com/rmannibucau> | Blog
> > > <http://rmannibucau.wordpress.com> | Github <https://github.com/
> > > rmannibucau> |
> > > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> > > <http://www.tomitribe.com>
> > >
> > > 2015-03-25 10:43 GMT+01:00 Alex Soto <as...@gmail.com>:
> > >
> > > > i currently I am developing a test and I want to use Arquillian Warp.
> > > > Currently I am using Arquillian 1.1.7, latest Warp and Managed Apache
> > > TomEE
> > > > 1.7.1. The test is as simple as:
> > > >
> > > > @RunWith(Arquillian.class)@WarpTestpublic class RestUploadTest {
> > > >
> > > > @Deployment
> > > > public static final WebArchive deployment() {
> > > > return ShrinkWrap
> > > > .create(WebArchive.class)
> > > > .addClasses(BoundedInputStream.class, IOUtil.class,
> > > > P12Resource.class, TemporaryFolder.class)
> > > > .addAsWebInfResource(EmptyAsset.INSTANCE,
> "beans.xml")
> > > > .addAsLibraries(
> > > > Maven.resolver().loadPomFromFile("pom.xml")
> > > > .resolve("org.glassfish:javax.json")
> > > > .withTransitivity().as(JavaArchive.class));
> > > > }
> > > >
> > > > @ArquillianResource
> > > > URL baseUrl;
> > > >
> > > > @Test
> > > > @RunAsClient
> > > > public void shouldUploadContent() {
> > > > Warp.initiate(() -> {
> > > >
> > > > URI endpoint =
> > UriBuilder.fromPath(baseUrl.toExternalForm())
> > > > .path(P12Resource.class).path(
> "chunkedUpload").build();
> > > > given().request().body("This is a test file.".getBytes())
> > > > .post(endpoint).then().assertThat()
> > > > .body("uploadId", notNullValue()).and()
> > > > .body("offset", notNullValue());
> > > >
> > > > }).inspect(new Inspection() {
> > > > private static final long serialVersionUID = 1L;
> > > >
> > > > @Inject
> > > > TemporaryFolder temporaryFolder;
> > > >
> > > > @AfterServlet
> > > > public void assertCreatedFile() {
> > > > System.out.println(temporaryFolder.getRoot());
> > > > }
> > > >
> > > > });
> > > >
> > > > }
> > > >
> > > > }
> > > >
> > > > The problem is that temporaryFolder is not injected and its value is
> > > null.
> > > > Note that TemporaryFolder is a class that I have developed and
> injected
> > > > correctly on my business class (EJB).
> > > >
> > > > Talking with Aslak noticed me that it can be something related with
> how
> > > > TomEE enrichment API but of course he is not 100% sure (
> > > > http://discuss.arquillian.org/t/arquillian-warp-and-cdi-in-
> > > inspection/170)
> > > >
> > > > Also I can share code without any problem.
> > > >
> > > > Thank you so much.
> > > >
> > > > Alex.
> > > >
> > >
> >
>
Re: Arquillian Warp and TomEE
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Ok, thought we already fixed it:
https://issues.apache.org/jira/browse/TOMEE-1530
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-03-25 11:05 GMT+01:00 Alex Soto <as...@gmail.com>:
> Yes you can download from
> https://github.com/Scytl/restguide/tree/master/sources/rest-chunk and
> using
> mvn clean test you will get the error.
>
> Alex.
>
> El dc., 25 març, 2015 a les 10:47, Romain Manni-Bucau (<
> rmannibucau@gmail.com>) va escriure:
>
> > we have our own enricher but it is still arquillian SPI.
> >
> > If you can share something running on maven and without all jboss
> > dependencies (all jboss EE stack ;)) I can have a look in the day
> >
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> | Blog
> > <http://rmannibucau.wordpress.com> | Github <https://github.com/
> > rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> > <http://www.tomitribe.com>
> >
> > 2015-03-25 10:43 GMT+01:00 Alex Soto <as...@gmail.com>:
> >
> > > i currently I am developing a test and I want to use Arquillian Warp.
> > > Currently I am using Arquillian 1.1.7, latest Warp and Managed Apache
> > TomEE
> > > 1.7.1. The test is as simple as:
> > >
> > > @RunWith(Arquillian.class)@WarpTestpublic class RestUploadTest {
> > >
> > > @Deployment
> > > public static final WebArchive deployment() {
> > > return ShrinkWrap
> > > .create(WebArchive.class)
> > > .addClasses(BoundedInputStream.class, IOUtil.class,
> > > P12Resource.class, TemporaryFolder.class)
> > > .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
> > > .addAsLibraries(
> > > Maven.resolver().loadPomFromFile("pom.xml")
> > > .resolve("org.glassfish:javax.json")
> > > .withTransitivity().as(JavaArchive.class));
> > > }
> > >
> > > @ArquillianResource
> > > URL baseUrl;
> > >
> > > @Test
> > > @RunAsClient
> > > public void shouldUploadContent() {
> > > Warp.initiate(() -> {
> > >
> > > URI endpoint =
> UriBuilder.fromPath(baseUrl.toExternalForm())
> > > .path(P12Resource.class).path("chunkedUpload").build();
> > > given().request().body("This is a test file.".getBytes())
> > > .post(endpoint).then().assertThat()
> > > .body("uploadId", notNullValue()).and()
> > > .body("offset", notNullValue());
> > >
> > > }).inspect(new Inspection() {
> > > private static final long serialVersionUID = 1L;
> > >
> > > @Inject
> > > TemporaryFolder temporaryFolder;
> > >
> > > @AfterServlet
> > > public void assertCreatedFile() {
> > > System.out.println(temporaryFolder.getRoot());
> > > }
> > >
> > > });
> > >
> > > }
> > >
> > > }
> > >
> > > The problem is that temporaryFolder is not injected and its value is
> > null.
> > > Note that TemporaryFolder is a class that I have developed and injected
> > > correctly on my business class (EJB).
> > >
> > > Talking with Aslak noticed me that it can be something related with how
> > > TomEE enrichment API but of course he is not 100% sure (
> > > http://discuss.arquillian.org/t/arquillian-warp-and-cdi-in-
> > inspection/170)
> > >
> > > Also I can share code without any problem.
> > >
> > > Thank you so much.
> > >
> > > Alex.
> > >
> >
>
Re: Arquillian Warp and TomEE
Posted by Alex Soto <as...@gmail.com>.
Yes you can download from
https://github.com/Scytl/restguide/tree/master/sources/rest-chunk and using
mvn clean test you will get the error.
Alex.
El dc., 25 març, 2015 a les 10:47, Romain Manni-Bucau (<
rmannibucau@gmail.com>) va escriure:
> we have our own enricher but it is still arquillian SPI.
>
> If you can share something running on maven and without all jboss
> dependencies (all jboss EE stack ;)) I can have a look in the day
>
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> | Blog
> <http://rmannibucau.wordpress.com> | Github <https://github.com/
> rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> <http://www.tomitribe.com>
>
> 2015-03-25 10:43 GMT+01:00 Alex Soto <as...@gmail.com>:
>
> > i currently I am developing a test and I want to use Arquillian Warp.
> > Currently I am using Arquillian 1.1.7, latest Warp and Managed Apache
> TomEE
> > 1.7.1. The test is as simple as:
> >
> > @RunWith(Arquillian.class)@WarpTestpublic class RestUploadTest {
> >
> > @Deployment
> > public static final WebArchive deployment() {
> > return ShrinkWrap
> > .create(WebArchive.class)
> > .addClasses(BoundedInputStream.class, IOUtil.class,
> > P12Resource.class, TemporaryFolder.class)
> > .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
> > .addAsLibraries(
> > Maven.resolver().loadPomFromFile("pom.xml")
> > .resolve("org.glassfish:javax.json")
> > .withTransitivity().as(JavaArchive.class));
> > }
> >
> > @ArquillianResource
> > URL baseUrl;
> >
> > @Test
> > @RunAsClient
> > public void shouldUploadContent() {
> > Warp.initiate(() -> {
> >
> > URI endpoint = UriBuilder.fromPath(baseUrl.toExternalForm())
> > .path(P12Resource.class).path("chunkedUpload").build();
> > given().request().body("This is a test file.".getBytes())
> > .post(endpoint).then().assertThat()
> > .body("uploadId", notNullValue()).and()
> > .body("offset", notNullValue());
> >
> > }).inspect(new Inspection() {
> > private static final long serialVersionUID = 1L;
> >
> > @Inject
> > TemporaryFolder temporaryFolder;
> >
> > @AfterServlet
> > public void assertCreatedFile() {
> > System.out.println(temporaryFolder.getRoot());
> > }
> >
> > });
> >
> > }
> >
> > }
> >
> > The problem is that temporaryFolder is not injected and its value is
> null.
> > Note that TemporaryFolder is a class that I have developed and injected
> > correctly on my business class (EJB).
> >
> > Talking with Aslak noticed me that it can be something related with how
> > TomEE enrichment API but of course he is not 100% sure (
> > http://discuss.arquillian.org/t/arquillian-warp-and-cdi-in-
> inspection/170)
> >
> > Also I can share code without any problem.
> >
> > Thank you so much.
> >
> > Alex.
> >
>
Re: Arquillian Warp and TomEE
Posted by Romain Manni-Bucau <rm...@gmail.com>.
we have our own enricher but it is still arquillian SPI.
If you can share something running on maven and without all jboss
dependencies (all jboss EE stack ;)) I can have a look in the day
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-03-25 10:43 GMT+01:00 Alex Soto <as...@gmail.com>:
> i currently I am developing a test and I want to use Arquillian Warp.
> Currently I am using Arquillian 1.1.7, latest Warp and Managed Apache TomEE
> 1.7.1. The test is as simple as:
>
> @RunWith(Arquillian.class)@WarpTestpublic class RestUploadTest {
>
> @Deployment
> public static final WebArchive deployment() {
> return ShrinkWrap
> .create(WebArchive.class)
> .addClasses(BoundedInputStream.class, IOUtil.class,
> P12Resource.class, TemporaryFolder.class)
> .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
> .addAsLibraries(
> Maven.resolver().loadPomFromFile("pom.xml")
> .resolve("org.glassfish:javax.json")
> .withTransitivity().as(JavaArchive.class));
> }
>
> @ArquillianResource
> URL baseUrl;
>
> @Test
> @RunAsClient
> public void shouldUploadContent() {
> Warp.initiate(() -> {
>
> URI endpoint = UriBuilder.fromPath(baseUrl.toExternalForm())
> .path(P12Resource.class).path("chunkedUpload").build();
> given().request().body("This is a test file.".getBytes())
> .post(endpoint).then().assertThat()
> .body("uploadId", notNullValue()).and()
> .body("offset", notNullValue());
>
> }).inspect(new Inspection() {
> private static final long serialVersionUID = 1L;
>
> @Inject
> TemporaryFolder temporaryFolder;
>
> @AfterServlet
> public void assertCreatedFile() {
> System.out.println(temporaryFolder.getRoot());
> }
>
> });
>
> }
>
> }
>
> The problem is that temporaryFolder is not injected and its value is null.
> Note that TemporaryFolder is a class that I have developed and injected
> correctly on my business class (EJB).
>
> Talking with Aslak noticed me that it can be something related with how
> TomEE enrichment API but of course he is not 100% sure (
> http://discuss.arquillian.org/t/arquillian-warp-and-cdi-in-inspection/170)
>
> Also I can share code without any problem.
>
> Thank you so much.
>
> Alex.
>