Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

AS7-4208 Inconsistent behaviour when dealing with resteasy scanning c…

…ontext params
  • Loading branch information...
commit b3a1e8b587ec620982d2ff5218708f52587ba917 1 parent 4781044
Stuart Douglas stuartwdouglas authored
12 jaxrs/src/main/java/org/jboss/as/jaxrs/JaxrsMessages.java
@@ -22,14 +22,14 @@
22 22
23 23 package org.jboss.as.jaxrs;
24 24
  25 +import javax.ws.rs.core.Application;
  26 +
25 27 import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
26 28 import org.jboss.logging.Cause;
27 29 import org.jboss.logging.Message;
28 30 import org.jboss.logging.MessageBundle;
29 31 import org.jboss.logging.Messages;
30 32
31   -import javax.ws.rs.core.Application;
32   -
33 33 /**
34 34 * Date: 05.11.2011
35 35 *
@@ -47,7 +47,6 @@
47 47 * Creates an exception indicating the JAX-RS application class could not be loaded.
48 48 *
49 49 * @param cause the cause of the error.
50   - *
51 50 * @return a {@link DeploymentUnitProcessingException} for the error.
52 51 */
53 52 @Message(id = 11230, value = "Could not load JAX-RS Application class")
@@ -58,7 +57,6 @@
58 57 *
59 58 * @param app1 the first application.
60 59 * @param app2 the second application.
61   - *
62 60 * @return a {@link DeploymentUnitProcessingException} for the error.
63 61 */
64 62 @Message(id = 11231, value = "More than one Application class found in deployment %s and %s")
@@ -68,7 +66,6 @@
68 66 * A message indicating only one JAX-RS application class is allowed.
69 67 *
70 68 * @param sb a builder with application classes.
71   - *
72 69 * @return the message.
73 70 */
74 71 @Message(id = 11232, value = "Only one JAX-RS Application Class allowed. %s")
@@ -84,12 +81,15 @@
84 81
85 82 /**
86 83 * JAX-RS resource @Path annotation is on a class or interface that is not a view
87   - * @param type The class with the annotation
  84 + *
  85 + * @param type The class with the annotation
88 86 * @param ejbName The ejb
89 87 * @return
90 88 */
91 89 @Message(id = 11234, value = "JAX-RS resource %s does not correspond to a view on the EJB %s. @Path annotations can only be placed on classes or interfaces that represent a local, remote or no-interface view of an EJB.")
92 90 DeploymentUnitProcessingException typeNameNotAnEjbView(String type, String ejbName);
93 91
  92 + @Message(id = 11235, value = "Invalid value for parameter %s: %s")
  93 + DeploymentUnitProcessingException invalidParamValue(String param, String value);
94 94 }
95 95
11 jaxrs/src/main/java/org/jboss/as/jaxrs/deployment/JaxrsIntegrationProcessor.java
@@ -25,7 +25,6 @@
25 25 import org.jboss.metadata.web.jboss.JBossWebMetaData;
26 26 import org.jboss.metadata.web.spec.FilterMetaData;
27 27 import org.jboss.metadata.web.spec.ServletMappingMetaData;
28   -import org.jboss.modules.Module;
29 28 import org.jboss.modules.ModuleIdentifier;
30 29 import org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher;
31 30 import org.jboss.resteasy.plugins.server.servlet.ResteasyContextParameters;
@@ -47,7 +46,6 @@
47 46 @Override
48 47 public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
49 48 final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
50   - final Module module = deploymentUnit.getAttachment(Attachments.MODULE);
51 49
52 50 if (!JaxrsDeploymentMarker.isJaxrsDeployment(deploymentUnit)) {
53 51 return;
@@ -76,13 +74,10 @@ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitPro
76 74 final ParamValueMetaData param = it.next();
77 75 if (param.getParamName().equals(RESTEASY_SCAN)) {
78 76 it.remove();
79   - JAXRS_LOGGER.resteasyScanWarning(RESTEASY_SCAN);
80 77 } else if (param.getParamName().equals(RESTEASY_SCAN_RESOURCES)) {
81 78 it.remove();
82   - JAXRS_LOGGER.resteasyScanWarning(RESTEASY_SCAN_RESOURCES);
83 79 } else if (param.getParamName().equals(RESTEASY_SCAN_PROVIDERS)) {
84 80 it.remove();
85   - JAXRS_LOGGER.resteasyScanWarning(RESTEASY_SCAN_PROVIDERS);
86 81 }
87 82 }
88 83 }
@@ -155,12 +150,6 @@ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitPro
155 150 if (resteasy.hasBootClasses() || resteasy.isDispatcherCreated())
156 151 return;
157 152
158   - //if there are no JAX-RS classes in the app just return
159   - if (resteasy.getScannedApplicationClass() == null
160   - && resteasy.getScannedJndiComponentResources().isEmpty()
161   - && resteasy.getScannedProviderClasses().isEmpty()
162   - && resteasy.getScannedResourceClasses().isEmpty()) return;
163   -
164 153 boolean useScannedClass = false;
165 154 String servletName;
166 155 if (resteasy.getScannedApplicationClass() == null) {
36 jaxrs/src/main/java/org/jboss/as/jaxrs/deployment/JaxrsScanningProcessor.java
@@ -21,9 +21,6 @@
21 21 */
22 22 package org.jboss.as.jaxrs.deployment;
23 23
24   -import static org.jboss.as.jaxrs.JaxrsLogger.JAXRS_LOGGER;
25   -import static org.jboss.as.jaxrs.JaxrsMessages.MESSAGES;
26   -
27 24 import java.lang.reflect.Modifier;
28 25 import java.util.ArrayList;
29 26 import java.util.Collections;
@@ -36,6 +33,7 @@
36 33 import javax.ws.rs.core.Application;
37 34
38 35 import org.jboss.as.jaxrs.JaxrsAnnotations;
  36 +import org.jboss.as.jaxrs.JaxrsMessages;
39 37 import org.jboss.as.server.Services;
40 38 import org.jboss.as.server.deployment.Attachments;
41 39 import org.jboss.as.server.deployment.DeploymentPhaseContext;
@@ -61,6 +59,12 @@
61 59 import org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrapClasses;
62 60 import org.jboss.resteasy.plugins.server.servlet.ResteasyContextParameters;
63 61
  62 +import static org.jboss.as.jaxrs.JaxrsLogger.JAXRS_LOGGER;
  63 +import static org.jboss.as.jaxrs.JaxrsMessages.MESSAGES;
  64 +import static org.jboss.resteasy.plugins.server.servlet.ResteasyContextParameters.RESTEASY_SCAN;
  65 +import static org.jboss.resteasy.plugins.server.servlet.ResteasyContextParameters.RESTEASY_SCAN_PROVIDERS;
  66 +import static org.jboss.resteasy.plugins.server.servlet.ResteasyContextParameters.RESTEASY_SCAN_RESOURCES;
  67 +
64 68 /**
65 69 * Processor that finds jax-rs classes in the deployment
66 70 *
@@ -80,7 +84,7 @@ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitPro
80 84 }
81 85 final DeploymentUnit parent = deploymentUnit.getParent() == null ? deploymentUnit : deploymentUnit.getParent();
82 86 final Map<ModuleIdentifier, ResteasyDeploymentData> deploymentData;
83   - if(deploymentUnit.getParent() == null) {
  87 + if (deploymentUnit.getParent() == null) {
84 88 deploymentData = Collections.synchronizedMap(new HashMap<ModuleIdentifier, ResteasyDeploymentData>());
85 89 deploymentUnit.putAttachment(JaxrsAttachments.ADDITIONAL_RESTEASY_DEPLOYMENT_DATA, deploymentData);
86 90 } else {
@@ -171,12 +175,12 @@ protected void scanWebDeployment(final DeploymentUnit du, final JBossWebMetaData
171 175
172 176 if (contextParams != null) {
173 177 for (ParamValueMetaData param : contextParams) {
174   - if (param.getParamName().equals(ResteasyContextParameters.RESTEASY_SCAN)) {
175   - resteasyDeploymentData.setScanAll(Boolean.valueOf(param.getParamValue()));
  178 + if (param.getParamName().equals(RESTEASY_SCAN)) {
  179 + resteasyDeploymentData.setScanAll(valueOf(RESTEASY_SCAN, param.getParamValue()));
176 180 } else if (param.getParamName().equals(ResteasyContextParameters.RESTEASY_SCAN_PROVIDERS)) {
177   - resteasyDeploymentData.setScanProviders(Boolean.valueOf(param.getParamValue()));
178   - } else if (param.getParamName().equals(ResteasyContextParameters.RESTEASY_SCAN_RESOURCES)) {
179   - resteasyDeploymentData.setScanResources(Boolean.valueOf(param.getParamValue()));
  181 + resteasyDeploymentData.setScanProviders(valueOf(RESTEASY_SCAN_PROVIDERS, param.getParamValue()));
  182 + } else if (param.getParamName().equals(RESTEASY_SCAN_RESOURCES)) {
  183 + resteasyDeploymentData.setScanResources(valueOf(RESTEASY_SCAN_RESOURCES, param.getParamValue()));
180 184 } else if (param.getParamName().equals(ResteasyContextParameters.RESTEASY_UNWRAPPED_EXCEPTIONS)) {
181 185 resteasyDeploymentData.setUnwrappedExceptionsParameterSet(true);
182 186 }
@@ -308,4 +312,18 @@ protected void scan(final DeploymentUnit du, final ClassLoader classLoader, fina
308 312 return null;
309 313 }
310 314
  315 +
  316 + private boolean valueOf(String paramName, String value) throws DeploymentUnitProcessingException {
  317 + if (value == null) {
  318 + throw JaxrsMessages.MESSAGES.invalidParamValue(paramName, value);
  319 + }
  320 + if (value.toLowerCase().equals("true")) {
  321 + return true;
  322 + } else if (value.toLowerCase().equals("false")) {
  323 + return false;
  324 + } else {
  325 + throw JaxrsMessages.MESSAGES.invalidParamValue(paramName, value);
  326 + }
  327 + }
  328 +
311 329 }
35 testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jaxrs/cfg/HelloWorldResource.java
... ... @@ -0,0 +1,35 @@
  1 +/*
  2 + * JBoss, Home of Professional Open Source
  3 + * Copyright 2010, Red Hat Inc., and individual contributors as indicated
  4 + * by the @authors tag. See the copyright.txt in the distribution for a
  5 + * full listing of individual contributors.
  6 + *
  7 + * This is free software; you can redistribute it and/or modify it
  8 + * under the terms of the GNU Lesser General Public License as
  9 + * published by the Free Software Foundation; either version 2.1 of
  10 + * the License, or (at your option) any later version.
  11 + *
  12 + * This software is distributed in the hope that it will be useful,
  13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15 + * Lesser General Public License for more details.
  16 + *
  17 + * You should have received a copy of the GNU Lesser General Public
  18 + * License along with this software; if not, write to the Free
  19 + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20 + * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  21 + */
  22 +package org.jboss.as.test.integration.jaxrs.cfg;
  23 +
  24 +import javax.ws.rs.GET;
  25 +import javax.ws.rs.Path;
  26 +import javax.ws.rs.Produces;
  27 +
  28 +@Path("helloworld")
  29 +@Produces({"text/plain"})
  30 +public class HelloWorldResource {
  31 + @GET
  32 + public String getMessage() {
  33 + return "Hello World!";
  34 + }
  35 +}
62 testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jaxrs/cfg/ResteasyParamsParent.java
... ... @@ -1,62 +0,0 @@
1   -package org.jboss.as.test.integration.jaxrs.cfg;
2   -
3   -import java.util.concurrent.TimeUnit;
4   -import java.net.URL;
5   -
6   -import org.jboss.as.test.integration.common.HttpRequest;
7   -import org.jboss.as.test.integration.jaxrs.packaging.war.HelloWorldResource;
8   -import org.jboss.as.test.integration.jaxrs.packaging.war.WebXml;
9   -import org.jboss.shrinkwrap.api.Archive;
10   -import org.jboss.shrinkwrap.api.ShrinkWrap;
11   -import org.jboss.shrinkwrap.api.spec.WebArchive;
12   -
13   -public abstract class ResteasyParamsParent {
14   -
15   - private final static String DEP_NAME = "default";
16   -
17   - public static Archive<?> getDeploy(final String depName,
18   - final Class<?> clazz, final String paramName,
19   - final String paramValue) {
20   - return getDeploy(depName, clazz, paramName, paramValue, "", "");
21   - }
22   -
23   - public static Archive<?> getDeploy(final Class<?> clazz,
24   - final String paramName, final String paramValue) {
25   - return getDeploy(DEP_NAME, clazz, paramName, paramValue, "", "");
26   - }
27   -
28   - public static Archive<?> getDeploy(final Class<?> clazz,
29   - final String paramName, final String paramValue, final String webXmlBefore, final String webXmlAfter) {
30   - return getDeploy(DEP_NAME, clazz, paramName, paramValue, webXmlBefore, webXmlAfter);
31   - }
32   -
33   - public static Archive<?> getDeploy(final String depName,
34   - final Class<?> clazz, final String paramName,
35   - final String paramValue, final String webXmlBefore, final String webXmlAfter) {
36   - WebArchive war = ShrinkWrap.create(WebArchive.class, "jaxrsnoap_"
37   - + (depName == null ? DEP_NAME : depName.length() > 0 ? depName
38   - : DEP_NAME) + ".war");
39   - war.addPackage(HttpRequest.class.getPackage());
40   - war.addClasses(clazz, ResteasyParamsParent.class, HelloWorldResource.class);
41   - war.addAsWebInfResource(
42   - WebXml.get(webXmlBefore
43   - + "<servlet-mapping>\n"
44   - + " <servlet-name>javax.ws.rs.core.Application</servlet-name>\n"
45   - + " <url-pattern>/myjaxrs/*</url-pattern>\n"
46   - + "</servlet-mapping>\n"
47   - + "\n"
48   - + "<context-param>\n"
49   - + " <param-name>" + paramName + "</param-name>\n"
50   - + " <param-value>" + paramValue + "</param-value>\n"
51   - + "</context-param>\n"
52   - + webXmlAfter
53   - + "\n"), "web.xml");
54   - return war;
55   - }
56   -
57   - public static String performCall(final String urlPattern, URL url)
58   - throws Exception {
59   - return HttpRequest.get(url + urlPattern, 5, TimeUnit.SECONDS);
60   - }
61   -
62   -}
211 ...tegration/basic/src/test/java/org/jboss/as/test/integration/jaxrs/cfg/ResteasyScanResourcesTestCase.java
@@ -21,24 +21,28 @@
21 21 */
22 22 package org.jboss.as.test.integration.jaxrs.cfg;
23 23
24   -import static org.junit.Assert.assertEquals;
25   -
26 24 import java.net.URL;
  25 +import java.util.concurrent.TimeUnit;
27 26
28 27 import junit.framework.Assert;
29   -
30 28 import org.jboss.arquillian.container.test.api.Deployer;
31 29 import org.jboss.arquillian.container.test.api.Deployment;
32 30 import org.jboss.arquillian.container.test.api.OperateOnDeployment;
33 31 import org.jboss.arquillian.container.test.api.RunAsClient;
34 32 import org.jboss.arquillian.junit.Arquillian;
35   -import org.jboss.arquillian.junit.InSequence;
36 33 import org.jboss.arquillian.test.api.ArquillianResource;
  34 +import org.jboss.as.test.integration.common.HttpRequest;
  35 +import org.jboss.as.test.integration.jaxrs.cfg.applicationclasses.HelloWorldApplication;
  36 +import org.jboss.as.test.integration.jaxrs.packaging.war.WebXml;
37 37 import org.jboss.shrinkwrap.api.Archive;
38   -import org.junit.Ignore;
  38 +import org.jboss.shrinkwrap.api.ShrinkWrap;
  39 +import org.jboss.shrinkwrap.api.asset.StringAsset;
  40 +import org.jboss.shrinkwrap.api.spec.WebArchive;
39 41 import org.junit.Test;
40 42 import org.junit.runner.RunWith;
41 43
  44 +import static org.junit.Assert.assertEquals;
  45 +
42 46 /**
43 47 * Tests for RESTEasy configuration parameter 'resteasy.scan.resources'
44 48 *
@@ -46,115 +50,92 @@
46 50 */
47 51 @RunWith(Arquillian.class)
48 52 @RunAsClient
49   -public class ResteasyScanResourcesTestCase extends ResteasyParamsParent {
50   -
51   - private static final String depNameTrue = "dep_true";
52   - private static final String depNameFalse = "dep_false";
53   - private static final String depNameFalseAS7_3034 = "dep_false_as7_3034";
54   - private static final String depNameInvalid = "dep_invalid";
55   -
56   - @Deployment(name = depNameTrue, managed = false)
57   - public static Archive<?> deploy_true() {
58   - return getDeploy(depNameTrue,
59   - ResteasyScanResourcesTestCase.class,
60   - "resteasy.scan.resources", "true");
61   - }
62   -
63   - @Deployment(name = depNameFalse, managed = false)
64   - public static Archive<?> deploy_false() {
65   - return getDeploy(depNameFalse,
66   - ResteasyScanResourcesTestCase.class,
67   - "resteasy.scan.resources", "false");
68   - }
69   -
70   - @Deployment(name = depNameFalseAS7_3034, managed = false)
71   - public static Archive<?> deploy_false_as7_3034() {
72   - return getDeploy(
73   - depNameFalseAS7_3034,
74   - ResteasyScanResourcesTestCase.class,
75   - "resteasy.scan.resources",
76   - "false",
77   - "<servlet>\n"
78   - + " <servlet-name>javax.ws.rs.core.Application</servlet-name>\n"
79   - + " <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher</servlet-class>\n"
80   - + "</servlet>\n" + "\n", "");
81   - }
82   -
83   - @Deployment(name = depNameInvalid, managed = false)
84   - public static Archive<?> deploy_invalid() {
85   - return getDeploy(depNameInvalid,
86   - ResteasyScanResourcesTestCase.class,
87   - "resteasy.scan.resources", "blah");
88   -
89   - }
90   -
91   - @ArquillianResource
92   - private Deployer deployer;
93   -
94   - @Test
95   - @InSequence(-1)
96   - public void testDeployTrue() throws Exception {
97   - try {
98   - deployer.deploy(depNameTrue);
99   - } catch (Exception e) {
100   - Assert.fail("Unexpected exception occured during deploying - "
101   - + e.toString());
102   - }
103   - }
104   -
105   - @Test
106   - @InSequence(1)
107   - @OperateOnDeployment(depNameTrue)
108   - public void testDeployTrue1(@ArquillianResource URL url) throws Exception {
109   - String result = performCall("myjaxrs/helloworld", url);
110   - assertEquals("Hello World!", result);
111   - }
112   -
113   - @Ignore("AS-3034")
114   - @Test
115   - @InSequence(-1)
116   - public void testDeployFalse() throws Exception {
117   - try {
118   - deployer.deploy(depNameFalse);
119   - } catch (Exception e) {
120   - Assert.fail("Unexpected exception occured during deploying - "
121   - + e.toString());
122   - }
123   - }
124   -
125   - @Ignore("AS-3034")
126   - @Test
127   - @InSequence(1)
128   - @OperateOnDeployment(depNameFalse)
129   - public void testDeployFalse1(@ArquillianResource URL url) throws Exception {
130   - try {
131   - @SuppressWarnings("unused")
132   - String result = performCall("myjaxrs/helloworld", url);
133   - Assert.fail("Scan of Resources is disabled so we should not pass to there - HTTP 404 must occur!");
134   - } catch (Exception e) {
135   - }
136   - }
137   -
138   - @Ignore("AS-3034")
139   - @Test
140   - @InSequence(-1)
141   - public void testDeployFalse_AS7_3043() throws Exception {
142   - try {
143   - deployer.deploy(depNameFalseAS7_3034);
144   - Assert.fail("Test should not go there - invalid deployment (duplicated javax.ws.rs.core.Application)! Possible regression of AS7-3034 found");
145   - } catch (Exception e) {
146   - }
147   - }
148   -
149   - @Ignore("AS-3034")
150   - @Test
151   - @RunAsClient
152   - public void testDeployInvalid() throws Exception {
153   - try {
154   - deployer.deploy(depNameInvalid);
155   - Assert.fail("Test should not go here - invalid deployment (invalid value of resteasy.scan.resources)!");
156   - } catch (Exception e) {
157   - }
158   - }
  53 +public class ResteasyScanResourcesTestCase {
  54 +
  55 + private static final String depNameTrue = "dep_true";
  56 + private static final String depNameFalse = "dep_false";
  57 + private static final String depNameFalseAS7_3034 = "dep_false_as7_3034";
  58 + private static final String depNameInvalid = "dep_invalid";
  59 +
  60 + @Deployment(name = depNameTrue, managed = true)
  61 + public static Archive<?> deploy_true() {
  62 + return ShrinkWrap.create(WebArchive.class, depNameTrue + ".war")
  63 + .addPackage(ResteasyScanResourcesTestCase.class.getPackage())
  64 + .setWebXML(webXml("resteasy.scan.resources", "true"));
  65 + }
  66 +
  67 + @Deployment(name = depNameFalse, managed = true)
  68 + public static Archive<?> deploy_false() {
  69 + return ShrinkWrap.create(WebArchive.class, depNameFalse + ".war")
  70 + .addPackage(ResteasyScanResourcesTestCase.class.getPackage())
  71 + .setWebXML(webXml("resteasy.scan.resources", "false"));
  72 + }
  73 +
  74 + @Deployment(name = depNameFalseAS7_3034, managed = false)
  75 + public static Archive<?> deploy_false_as7_3034() {
  76 + return ShrinkWrap.create(WebArchive.class, depNameFalseAS7_3034 + ".war")
  77 + .addPackage(ResteasyScanResourcesTestCase.class.getPackage())
  78 + .addPackage(HelloWorldApplication.class.getPackage());
  79 + }
  80 +
  81 + @Deployment(name = depNameInvalid, managed = false)
  82 + public static Archive<?> deploy_invalid() {
  83 + return ShrinkWrap.create(WebArchive.class, depNameInvalid + ".war")
  84 + .addPackage(ResteasyScanResourcesTestCase.class.getPackage())
  85 + .setWebXML(webXml("resteasy.scan.resources", "blah"));
  86 +
  87 + }
  88 +
  89 + private static StringAsset webXml(String paramName, String paramValue) {
  90 + return WebXml.get("<servlet-mapping>\n"
  91 + + " <servlet-name>javax.ws.rs.core.Application</servlet-name>\n"
  92 + + " <url-pattern>/myjaxrs/*</url-pattern>\n"
  93 + + "</servlet-mapping>\n"
  94 + + "\n"
  95 + + "<context-param>\n"
  96 + + " <param-name>" + paramName + "</param-name>\n"
  97 + + " <param-value>" + paramValue + "</param-value>\n"
  98 + + "</context-param>\n"
  99 + + "\n");
  100 + }
  101 +
  102 + @ArquillianResource
  103 + private Deployer deployer;
  104 +
  105 + @Test
  106 + @OperateOnDeployment(depNameTrue)
  107 + public void testDeployTrue1(@ArquillianResource URL url) throws Exception {
  108 + String result = HttpRequest.get(url.toExternalForm() + "myjaxrs/helloworld", 10, TimeUnit.SECONDS);
  109 + assertEquals("Hello World!", result);
  110 + }
  111 +
  112 + @Test
  113 + @OperateOnDeployment(depNameFalse)
  114 + public void testDeployFalse1(@ArquillianResource URL url) throws Exception {
  115 + try {
  116 + @SuppressWarnings("unused")
  117 + String result = HttpRequest.get(url.toExternalForm() + "myjaxrs/helloworld", 10, TimeUnit.SECONDS);
  118 + Assert.fail("Scan of Resources is disabled so we should not pass to there - HTTP 404 must occur!");
  119 + } catch (Exception e) {
  120 + }
  121 + }
  122 +
  123 + @Test
  124 + public void testDeployFalse_AS7_3043() throws Exception {
  125 + try {
  126 + deployer.deploy(depNameFalseAS7_3034);
  127 + Assert.fail("Test should not go there - invalid deployment (duplicated javax.ws.rs.core.Application)! Possible regression of AS7-3034 found");
  128 + } catch (Exception e) {
  129 + }
  130 + }
  131 +
  132 + @Test
  133 + public void testDeployInvalid() throws Exception {
  134 + try {
  135 + deployer.deploy(depNameInvalid);
  136 + Assert.fail("Test should not go here - invalid deployment (invalid value of resteasy.scan.resources)!");
  137 + } catch (Exception e) {
  138 + }
  139 + }
159 140
160 141 }
33 ...asic/src/test/java/org/jboss/as/test/integration/jaxrs/cfg/applicationclasses/HelloWorldApplication.java
... ... @@ -0,0 +1,33 @@
  1 +/*
  2 + * JBoss, Home of Professional Open Source
  3 + * Copyright 2010, Red Hat Inc., and individual contributors as indicated
  4 + * by the @authors tag. See the copyright.txt in the distribution for a
  5 + * full listing of individual contributors.
  6 + *
  7 + * This is free software; you can redistribute it and/or modify it
  8 + * under the terms of the GNU Lesser General Public License as
  9 + * published by the Free Software Foundation; either version 2.1 of
  10 + * the License, or (at your option) any later version.
  11 + *
  12 + * This software is distributed in the hope that it will be useful,
  13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15 + * Lesser General Public License for more details.
  16 + *
  17 + * You should have received a copy of the GNU Lesser General Public
  18 + * License along with this software; if not, write to the Free
  19 + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20 + * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  21 + */
  22 +package org.jboss.as.test.integration.jaxrs.cfg.applicationclasses;
  23 +
  24 +import javax.ws.rs.ApplicationPath;
  25 +import javax.ws.rs.core.Application;
  26 +
  27 +/**
  28 + * Application with no path
  29 + *@author Stuart Douglas
  30 + */
  31 +@ApplicationPath("app1")
  32 +public class HelloWorldApplication extends Application {
  33 +}
34 ...sic/src/test/java/org/jboss/as/test/integration/jaxrs/cfg/applicationclasses/HelloWorldApplication2.java
... ... @@ -0,0 +1,34 @@
  1 +/*
  2 + * JBoss, Home of Professional Open Source
  3 + * Copyright 2010, Red Hat Inc., and individual contributors as indicated
  4 + * by the @authors tag. See the copyright.txt in the distribution for a
  5 + * full listing of individual contributors.
  6 + *
  7 + * This is free software; you can redistribute it and/or modify it
  8 + * under the terms of the GNU Lesser General Public License as
  9 + * published by the Free Software Foundation; either version 2.1 of
  10 + * the License, or (at your option) any later version.
  11 + *
  12 + * This software is distributed in the hope that it will be useful,
  13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15 + * Lesser General Public License for more details.
  16 + *
  17 + * You should have received a copy of the GNU Lesser General Public
  18 + * License along with this software; if not, write to the Free
  19 + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20 + * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  21 + */
  22 +package org.jboss.as.test.integration.jaxrs.cfg.applicationclasses;
  23 +
  24 +import javax.ws.rs.ApplicationPath;
  25 +import javax.ws.rs.core.Application;
  26 +
  27 +/**
  28 + * Application with no path
  29 + *
  30 + * @author Stuart Douglas
  31 + */
  32 +@ApplicationPath("app2")
  33 +public class HelloWorldApplication2 extends Application {
  34 +}

0 comments on commit b3a1e8b

Please sign in to comment.
Something went wrong with that request. Please try again.