Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RESTEASY-1975] test rewritten with contents of original RESTEASY-108…
…2.war
- Loading branch information
Showing
7 changed files
with
175 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...ts/src/test/java/org/jboss/resteasy/test/cdi/basic/resource/resteasy1082/FooResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package org.jboss.resteasy.test.cdi.basic.resource.resteasy1082; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.UUID; | ||
import javax.enterprise.context.RequestScoped; | ||
import javax.validation.constraints.Min; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
|
||
@RequestScoped | ||
@Path("/foo") | ||
public class FooResource { | ||
@Min(3L) | ||
private int k = 0; | ||
|
||
public FooResource() { | ||
} | ||
|
||
@GET | ||
@Produces({"application/json"}) | ||
public List<String> getAll() { | ||
List<String> data = new ArrayList(); | ||
|
||
for(int i = 0; i < 10; ++i) { | ||
data.add(UUID.randomUUID().toString()); | ||
} | ||
|
||
return data; | ||
} | ||
} | ||
|
19 changes: 19 additions & 0 deletions
19
...rc/test/java/org/jboss/resteasy/test/cdi/basic/resource/resteasy1082/TestApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.jboss.resteasy.test.cdi.basic.resource.resteasy1082; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
import javax.ws.rs.core.Application; | ||
import javax.ws.rs.ext.Provider; | ||
|
||
@Provider | ||
public class TestApplication extends Application { | ||
public TestApplication() { | ||
} | ||
|
||
public Set<Class<?>> getClasses() { | ||
HashSet<Class<?>> classes = new HashSet(); | ||
classes.add(FooResource.class); | ||
return classes; | ||
} | ||
} | ||
|
24 changes: 24 additions & 0 deletions
24
...ts/src/test/java/org/jboss/resteasy/test/cdi/basic/resource/resteasy1082/TestServlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.jboss.resteasy.test.cdi.basic.resource.resteasy1082; | ||
|
||
import java.io.IOException; | ||
import javax.inject.Inject; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.annotation.WebServlet; | ||
import javax.servlet.http.HttpServlet; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
|
||
@WebServlet({"/"}) | ||
public class TestServlet extends HttpServlet { | ||
@Inject | ||
FooResource foo; | ||
|
||
public TestServlet() { | ||
} | ||
|
||
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { | ||
resp.setContentType("text/plain"); | ||
resp.getWriter().write(this.foo.getAll().toString()); | ||
} | ||
} | ||
|
Binary file removed
BIN
-2.92 MB
.../integration-tests/src/test/resources/org/jboss/resteasy/test/cdi/basic/RESTEASY-1082.war
Binary file not shown.
47 changes: 47 additions & 0 deletions
47
...tegration-tests/src/test/resources/org/jboss/resteasy/test/cdi/basic/web-resteasy1082.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> | ||
|
||
<servlet> | ||
<servlet-name>Resteasy</servlet-name> | ||
|
||
<servlet-class> | ||
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher | ||
</servlet-class> | ||
<init-param> | ||
<param-name>javax.ws.rs.Application</param-name> | ||
<param-value>org.jboss.resteasy.test.cdi.basic.resource.resteasy1082.TestApplication</param-value> | ||
</init-param> | ||
</servlet> | ||
|
||
<servlet> | ||
<servlet-name>Faces Servlet</servlet-name> | ||
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class> | ||
<load-on-startup>1</load-on-startup> | ||
</servlet> | ||
|
||
<servlet> | ||
<servlet-name>Test Servlet</servlet-name> | ||
<servlet-class>org.jboss.resteasy.test.cdi.basic.resource.resteasy1082.TestServlet</servlet-class> | ||
<load-on-startup>1</load-on-startup> | ||
</servlet> | ||
|
||
|
||
<servlet-mapping> | ||
<servlet-name>Resteasy</servlet-name> | ||
<url-pattern>/*</url-pattern> | ||
</servlet-mapping> | ||
|
||
<servlet-mapping> | ||
<servlet-name>Test Servlet</servlet-name> | ||
<url-pattern>/test/*</url-pattern> | ||
</servlet-mapping> | ||
|
||
|
||
|
||
<session-config> | ||
<session-timeout>10</session-timeout> | ||
</session-config> | ||
|
||
</web-app> |