Commit 96e95c89aa00f25014affb574323fdfac4bef8a8
1 parent
b5f63dfb
Exists in
master
IN PROGRESS - issue FWK-119: Testes da extensão Servlet
https://demoiselle.atlassian.net/browse/FWK-119
Showing
13 changed files
with
391 additions
and
225 deletions
Show diff stats
impl/extension/servlet/src/test/java/producer/HttpServletRequestProducerTest.java
... | ... | @@ -1,46 +0,0 @@ |
1 | -package producer; | |
2 | - | |
3 | -import static junit.framework.Assert.assertEquals; | |
4 | - | |
5 | -import java.io.IOException; | |
6 | -import java.net.URL; | |
7 | - | |
8 | -import org.apache.http.HttpResponse; | |
9 | -import org.apache.http.HttpStatus; | |
10 | -import org.apache.http.client.ClientProtocolException; | |
11 | -import org.apache.http.client.methods.HttpGet; | |
12 | -import org.apache.http.impl.client.DefaultHttpClient; | |
13 | -import org.jboss.arquillian.container.test.api.Deployment; | |
14 | -import org.jboss.arquillian.junit.Arquillian; | |
15 | -import org.jboss.arquillian.test.api.ArquillianResource; | |
16 | -import org.jboss.shrinkwrap.api.spec.WebArchive; | |
17 | -import org.junit.Test; | |
18 | -import org.junit.runner.RunWith; | |
19 | - | |
20 | -import test.Tests; | |
21 | - | |
22 | -@RunWith(Arquillian.class) | |
23 | -public class HttpServletRequestProducerTest { | |
24 | - | |
25 | - private static final String PATH = "src/test/resources/producer"; | |
26 | - | |
27 | - @ArquillianResource | |
28 | - private URL deploymentUrl; | |
29 | - | |
30 | - @Deployment(testable = false) | |
31 | - public static WebArchive createDeployment() { | |
32 | - return Tests.createDeployment().addClass(RequestServlet.class) | |
33 | - .addAsWebInfResource(Tests.createFileAsset(PATH + "/web.xml"), "web.xml"); | |
34 | - } | |
35 | - | |
36 | - @Test | |
37 | - public void createR() throws ClientProtocolException, IOException { | |
38 | - DefaultHttpClient client = new DefaultHttpClient(); | |
39 | - | |
40 | - HttpGet get = new HttpGet(deploymentUrl + "/requestproducer"); | |
41 | - HttpResponse response = client.execute(get); | |
42 | - | |
43 | - int status = response.getStatusLine().getStatusCode(); | |
44 | - assertEquals(HttpStatus.SC_OK, status); | |
45 | - } | |
46 | -} |
impl/extension/servlet/src/test/java/producer/HttpServletResponseProducerTest.java
... | ... | @@ -1,47 +0,0 @@ |
1 | -package producer; | |
2 | - | |
3 | -import static junit.framework.Assert.assertEquals; | |
4 | - | |
5 | -import java.io.IOException; | |
6 | -import java.net.URL; | |
7 | - | |
8 | -import org.apache.http.HttpResponse; | |
9 | -import org.apache.http.HttpStatus; | |
10 | -import org.apache.http.client.ClientProtocolException; | |
11 | -import org.apache.http.client.methods.HttpGet; | |
12 | -import org.apache.http.impl.client.DefaultHttpClient; | |
13 | -import org.jboss.arquillian.container.test.api.Deployment; | |
14 | -import org.jboss.arquillian.junit.Arquillian; | |
15 | -import org.jboss.arquillian.test.api.ArquillianResource; | |
16 | -import org.jboss.shrinkwrap.api.spec.WebArchive; | |
17 | -import org.junit.Test; | |
18 | -import org.junit.runner.RunWith; | |
19 | - | |
20 | -import test.Tests; | |
21 | - | |
22 | -@RunWith(Arquillian.class) | |
23 | -public class HttpServletResponseProducerTest { | |
24 | - | |
25 | - private static final String PATH = "src/test/resources/producer"; | |
26 | - | |
27 | - @ArquillianResource | |
28 | - private URL deploymentUrl; | |
29 | - | |
30 | - @Deployment(testable = false) | |
31 | - public static WebArchive createDeployment() { | |
32 | - return Tests.createDeployment().addClass(RequestServlet.class) | |
33 | - .addAsWebInfResource(Tests.createFileAsset(PATH + "/web.xml"), "web.xml"); | |
34 | - } | |
35 | - | |
36 | - @Test | |
37 | - public void createResponse() throws ClientProtocolException, IOException { | |
38 | - DefaultHttpClient client = new DefaultHttpClient(); | |
39 | - | |
40 | - HttpGet get = new HttpGet(deploymentUrl + "/responseproducer"); | |
41 | - HttpResponse response = client.execute(get); | |
42 | - | |
43 | - int status = response.getStatusLine().getStatusCode(); | |
44 | - assertEquals(HttpStatus.SC_OK, status); | |
45 | - } | |
46 | - | |
47 | -} |
impl/extension/servlet/src/test/java/producer/RequestServlet.java
... | ... | @@ -1,30 +0,0 @@ |
1 | -package producer; | |
2 | - | |
3 | -import java.io.IOException; | |
4 | - | |
5 | -import javax.servlet.ServletException; | |
6 | -import javax.servlet.http.HttpServlet; | |
7 | -import javax.servlet.http.HttpServletRequest; | |
8 | -import javax.servlet.http.HttpServletResponse; | |
9 | - | |
10 | -import org.apache.http.HttpStatus; | |
11 | - | |
12 | -import br.gov.frameworkdemoiselle.util.Beans; | |
13 | - | |
14 | -public class RequestServlet extends HttpServlet { | |
15 | - | |
16 | - private static final long serialVersionUID = 1L; | |
17 | - | |
18 | - @Override | |
19 | - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | |
20 | - | |
21 | - HttpServletRequest httpRequest = Beans.getReference(HttpServletRequest.class); | |
22 | - | |
23 | - if (httpRequest != null) { | |
24 | - response.setStatus(HttpStatus.SC_OK); | |
25 | - } else { | |
26 | - response.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR); | |
27 | - } | |
28 | - } | |
29 | - | |
30 | -} |
impl/extension/servlet/src/test/java/producer/ResponseServlet.java
... | ... | @@ -1,30 +0,0 @@ |
1 | -package producer; | |
2 | - | |
3 | -import java.io.IOException; | |
4 | - | |
5 | -import javax.servlet.ServletException; | |
6 | -import javax.servlet.http.HttpServlet; | |
7 | -import javax.servlet.http.HttpServletRequest; | |
8 | -import javax.servlet.http.HttpServletResponse; | |
9 | - | |
10 | -import org.apache.http.HttpStatus; | |
11 | - | |
12 | -import br.gov.frameworkdemoiselle.util.Beans; | |
13 | - | |
14 | -public class ResponseServlet extends HttpServlet { | |
15 | - | |
16 | - private static final long serialVersionUID = 1L; | |
17 | - | |
18 | - @Override | |
19 | - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | |
20 | - | |
21 | - HttpServletResponse httpResponse = Beans.getReference(HttpServletResponse.class); | |
22 | - | |
23 | - if (httpResponse != null) { | |
24 | - response.setStatus(HttpStatus.SC_OK); | |
25 | - } else { | |
26 | - response.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR); | |
27 | - } | |
28 | - } | |
29 | - | |
30 | -} |
impl/extension/servlet/src/test/java/producer/request/HttpServletRequestProducerTest.java
0 → 100644
... | ... | @@ -0,0 +1,44 @@ |
1 | +package producer.request; | |
2 | + | |
3 | +import static junit.framework.Assert.assertEquals; | |
4 | + | |
5 | +import java.io.IOException; | |
6 | +import java.net.URL; | |
7 | + | |
8 | +import org.apache.http.HttpResponse; | |
9 | +import org.apache.http.HttpStatus; | |
10 | +import org.apache.http.client.ClientProtocolException; | |
11 | +import org.apache.http.client.methods.HttpGet; | |
12 | +import org.apache.http.impl.client.DefaultHttpClient; | |
13 | +import org.jboss.arquillian.container.test.api.Deployment; | |
14 | +import org.jboss.arquillian.junit.Arquillian; | |
15 | +import org.jboss.arquillian.test.api.ArquillianResource; | |
16 | +import org.jboss.shrinkwrap.api.spec.WebArchive; | |
17 | +import org.junit.Test; | |
18 | +import org.junit.runner.RunWith; | |
19 | + | |
20 | +import test.Tests; | |
21 | + | |
22 | +@RunWith(Arquillian.class) | |
23 | +public class HttpServletRequestProducerTest { | |
24 | + | |
25 | + private static final String PATH = "src/test/resources/producer/request"; | |
26 | + | |
27 | + @ArquillianResource | |
28 | + private URL deploymentUrl; | |
29 | + | |
30 | + @Deployment(testable = false) | |
31 | + public static WebArchive createDeployment() { | |
32 | + return Tests.createDeployment().addClass(RequestServlet.class) | |
33 | + .addAsWebInfResource(Tests.createFileAsset(PATH + "/web.xml"), "web.xml"); | |
34 | + } | |
35 | + | |
36 | + @Test | |
37 | + public void createR() throws ClientProtocolException, IOException { | |
38 | + HttpGet httpGet = new HttpGet(deploymentUrl + "/servlet"); | |
39 | + HttpResponse httpResponse = new DefaultHttpClient().execute(httpGet); | |
40 | + | |
41 | + int status = httpResponse.getStatusLine().getStatusCode(); | |
42 | + assertEquals(HttpStatus.SC_OK, status); | |
43 | + } | |
44 | +} | ... | ... |
impl/extension/servlet/src/test/java/producer/request/RequestServlet.java
0 → 100644
... | ... | @@ -0,0 +1,30 @@ |
1 | +package producer.request; | |
2 | + | |
3 | +import java.io.IOException; | |
4 | + | |
5 | +import javax.servlet.ServletException; | |
6 | +import javax.servlet.http.HttpServlet; | |
7 | +import javax.servlet.http.HttpServletRequest; | |
8 | +import javax.servlet.http.HttpServletResponse; | |
9 | + | |
10 | +import org.apache.http.HttpStatus; | |
11 | + | |
12 | +import br.gov.frameworkdemoiselle.util.Beans; | |
13 | + | |
14 | +public class RequestServlet extends HttpServlet { | |
15 | + | |
16 | + private static final long serialVersionUID = 1L; | |
17 | + | |
18 | + @Override | |
19 | + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | |
20 | + | |
21 | + HttpServletRequest httpRequest = Beans.getReference(HttpServletRequest.class); | |
22 | + | |
23 | + if (httpRequest != null) { | |
24 | + response.setStatus(HttpStatus.SC_OK); | |
25 | + } else { | |
26 | + response.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR); | |
27 | + } | |
28 | + } | |
29 | + | |
30 | +} | ... | ... |
impl/extension/servlet/src/test/java/producer/response/HttpServletResponseProducerTest.java
0 → 100644
... | ... | @@ -0,0 +1,46 @@ |
1 | +package producer.response; | |
2 | + | |
3 | +import static junit.framework.Assert.assertEquals; | |
4 | + | |
5 | +import java.io.IOException; | |
6 | +import java.net.URL; | |
7 | + | |
8 | +import org.apache.http.HttpResponse; | |
9 | +import org.apache.http.HttpStatus; | |
10 | +import org.apache.http.client.ClientProtocolException; | |
11 | +import org.apache.http.client.methods.HttpGet; | |
12 | +import org.apache.http.impl.client.DefaultHttpClient; | |
13 | +import org.jboss.arquillian.container.test.api.Deployment; | |
14 | +import org.jboss.arquillian.junit.Arquillian; | |
15 | +import org.jboss.arquillian.test.api.ArquillianResource; | |
16 | +import org.jboss.shrinkwrap.api.spec.WebArchive; | |
17 | +import org.junit.Test; | |
18 | +import org.junit.runner.RunWith; | |
19 | + | |
20 | +import producer.request.RequestServlet; | |
21 | +import test.Tests; | |
22 | + | |
23 | +@RunWith(Arquillian.class) | |
24 | +public class HttpServletResponseProducerTest { | |
25 | + | |
26 | + private static final String PATH = "src/test/resources/producer/response"; | |
27 | + | |
28 | + @ArquillianResource | |
29 | + private URL deploymentUrl; | |
30 | + | |
31 | + @Deployment(testable = false) | |
32 | + public static WebArchive createDeployment() { | |
33 | + return Tests.createDeployment().addClass(RequestServlet.class) | |
34 | + .addAsWebInfResource(Tests.createFileAsset(PATH + "/web.xml"), "web.xml"); | |
35 | + } | |
36 | + | |
37 | + @Test | |
38 | + public void createResponse() throws ClientProtocolException, IOException { | |
39 | + HttpGet httpGet = new HttpGet(deploymentUrl + "/servlet"); | |
40 | + HttpResponse httpResponse = new DefaultHttpClient().execute(httpGet); | |
41 | + | |
42 | + int status = httpResponse.getStatusLine().getStatusCode(); | |
43 | + assertEquals(HttpStatus.SC_OK, status); | |
44 | + } | |
45 | + | |
46 | +} | ... | ... |
impl/extension/servlet/src/test/java/producer/response/ResponseServlet.java
0 → 100644
... | ... | @@ -0,0 +1,30 @@ |
1 | +package producer.response; | |
2 | + | |
3 | +import java.io.IOException; | |
4 | + | |
5 | +import javax.servlet.ServletException; | |
6 | +import javax.servlet.http.HttpServlet; | |
7 | +import javax.servlet.http.HttpServletRequest; | |
8 | +import javax.servlet.http.HttpServletResponse; | |
9 | + | |
10 | +import org.apache.http.HttpStatus; | |
11 | + | |
12 | +import br.gov.frameworkdemoiselle.util.Beans; | |
13 | + | |
14 | +public class ResponseServlet extends HttpServlet { | |
15 | + | |
16 | + private static final long serialVersionUID = 1L; | |
17 | + | |
18 | + @Override | |
19 | + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | |
20 | + | |
21 | + HttpServletResponse httpResponse = Beans.getReference(HttpServletResponse.class); | |
22 | + | |
23 | + if (httpResponse != null) { | |
24 | + response.setStatus(HttpStatus.SC_OK); | |
25 | + } else { | |
26 | + response.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR); | |
27 | + } | |
28 | + } | |
29 | + | |
30 | +} | ... | ... |
impl/extension/servlet/src/test/java/security/authentication/basic/BasicAuthenticationFilterTest.java
0 → 100644
... | ... | @@ -0,0 +1,35 @@ |
1 | +package security.authentication.basic; | |
2 | + | |
3 | +import java.net.URL; | |
4 | + | |
5 | +import org.jboss.arquillian.container.test.api.Deployment; | |
6 | +import org.jboss.arquillian.junit.Arquillian; | |
7 | +import org.jboss.arquillian.test.api.ArquillianResource; | |
8 | +import org.jboss.shrinkwrap.api.spec.WebArchive; | |
9 | +import org.junit.Test; | |
10 | +import org.junit.runner.RunWith; | |
11 | + | |
12 | +import test.Tests; | |
13 | + | |
14 | +@RunWith(Arquillian.class) | |
15 | +public class BasicAuthenticationFilterTest { | |
16 | + | |
17 | + private static final String PATH = "src/test/resources/security/authentication/basic"; | |
18 | + | |
19 | + @ArquillianResource | |
20 | + private URL deploymentUrl; | |
21 | + | |
22 | + @Deployment(testable = false) | |
23 | + public static WebArchive createDeployment() { | |
24 | + return Tests.createDeployment().addClasses(BasicAuthenticationFilterTest.class) | |
25 | + .addAsWebInfResource(Tests.createFileAsset(PATH + "/web.xml"), "web.xml"); | |
26 | + } | |
27 | + | |
28 | + @Test | |
29 | + public void loginSucessfull() { | |
30 | + } | |
31 | + | |
32 | + @Test | |
33 | + public void loginfailed() { | |
34 | + } | |
35 | +} | ... | ... |
impl/extension/servlet/src/test/resources/producer/request/web.xml
0 → 100644
... | ... | @@ -0,0 +1,62 @@ |
1 | +<!-- | |
2 | + Demoiselle Framework | |
3 | + Copyright (C) 2010 SERPRO | |
4 | + ============================================================================ | |
5 | + This file is part of Demoiselle Framework. | |
6 | + | |
7 | + Demoiselle Framework is free software; you can redistribute it and/or | |
8 | + modify it under the terms of the GNU Lesser General Public License version 3 | |
9 | + as published by the Free Software Foundation. | |
10 | + | |
11 | + This program is distributed in the hope that it will be useful, | |
12 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | + GNU General Public License for more details. | |
15 | + | |
16 | + You should have received a copy of the GNU Lesser General Public License version 3 | |
17 | + along with this program; if not, see <http://www.gnu.org/licenses /> | |
18 | + or write to the Free Software Foundation, Inc., 51 Franklin Street, | |
19 | + Fifth Floor, Boston, MA 02110-1301, USA. | |
20 | + ============================================================================ | |
21 | + Este arquivo é parte do Framework Demoiselle. | |
22 | + | |
23 | + O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou | |
24 | + modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação | |
25 | + do Software Livre (FSF). | |
26 | + | |
27 | + Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA | |
28 | + GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou | |
29 | + APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português | |
30 | + para maiores detalhes. | |
31 | + | |
32 | + Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título | |
33 | + "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses /> | |
34 | + ou escreva para a Fundação do Software Livre (FSF) Inc., | |
35 | + 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. | |
36 | +--> | |
37 | +<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | |
38 | + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> | |
39 | + | |
40 | + <listener> | |
41 | + <listener-class>br.gov.frameworkdemoiselle.util.ServletListener</listener-class> | |
42 | + </listener> | |
43 | + | |
44 | + <filter> | |
45 | + <filter-name>Demoiselle Servlet Filter</filter-name> | |
46 | + <filter-class>br.gov.frameworkdemoiselle.util.ServletFilter</filter-class> | |
47 | + </filter> | |
48 | + <filter-mapping> | |
49 | + <filter-name>Demoiselle Servlet Filter</filter-name> | |
50 | + <url-pattern>/*</url-pattern> | |
51 | + </filter-mapping> | |
52 | + | |
53 | + <servlet> | |
54 | + <servlet-name>Request Class</servlet-name> | |
55 | + <servlet-class>producer.request.RequestServlet</servlet-class> | |
56 | + </servlet> | |
57 | + | |
58 | + <servlet-mapping> | |
59 | + <servlet-name>Request Class</servlet-name> | |
60 | + <url-pattern>/servlet</url-pattern> | |
61 | + </servlet-mapping> | |
62 | +</web-app> | |
0 | 63 | \ No newline at end of file | ... | ... |
impl/extension/servlet/src/test/resources/producer/response/web.xml
0 → 100644
... | ... | @@ -0,0 +1,62 @@ |
1 | +<!-- | |
2 | + Demoiselle Framework | |
3 | + Copyright (C) 2010 SERPRO | |
4 | + ============================================================================ | |
5 | + This file is part of Demoiselle Framework. | |
6 | + | |
7 | + Demoiselle Framework is free software; you can redistribute it and/or | |
8 | + modify it under the terms of the GNU Lesser General Public License version 3 | |
9 | + as published by the Free Software Foundation. | |
10 | + | |
11 | + This program is distributed in the hope that it will be useful, | |
12 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | + GNU General Public License for more details. | |
15 | + | |
16 | + You should have received a copy of the GNU Lesser General Public License version 3 | |
17 | + along with this program; if not, see <http://www.gnu.org/licenses /> | |
18 | + or write to the Free Software Foundation, Inc., 51 Franklin Street, | |
19 | + Fifth Floor, Boston, MA 02110-1301, USA. | |
20 | + ============================================================================ | |
21 | + Este arquivo é parte do Framework Demoiselle. | |
22 | + | |
23 | + O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou | |
24 | + modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação | |
25 | + do Software Livre (FSF). | |
26 | + | |
27 | + Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA | |
28 | + GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou | |
29 | + APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português | |
30 | + para maiores detalhes. | |
31 | + | |
32 | + Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título | |
33 | + "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses /> | |
34 | + ou escreva para a Fundação do Software Livre (FSF) Inc., | |
35 | + 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. | |
36 | +--> | |
37 | +<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | |
38 | + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> | |
39 | + | |
40 | + <listener> | |
41 | + <listener-class>br.gov.frameworkdemoiselle.util.ServletListener</listener-class> | |
42 | + </listener> | |
43 | + | |
44 | + <filter> | |
45 | + <filter-name>Demoiselle Servlet Filter</filter-name> | |
46 | + <filter-class>br.gov.frameworkdemoiselle.util.ServletFilter</filter-class> | |
47 | + </filter> | |
48 | + <filter-mapping> | |
49 | + <filter-name>Demoiselle Servlet Filter</filter-name> | |
50 | + <url-pattern>/*</url-pattern> | |
51 | + </filter-mapping> | |
52 | + | |
53 | + <servlet> | |
54 | + <servlet-name>Response Servlet</servlet-name> | |
55 | + <servlet-class>producer.response.ResponseServlet</servlet-class> | |
56 | + </servlet> | |
57 | + | |
58 | + <servlet-mapping> | |
59 | + <servlet-name>Response Servlet</servlet-name> | |
60 | + <url-pattern>/servlet</url-pattern> | |
61 | + </servlet-mapping> | |
62 | +</web-app> | |
0 | 63 | \ No newline at end of file | ... | ... |
impl/extension/servlet/src/test/resources/producer/web.xml
... | ... | @@ -1,72 +0,0 @@ |
1 | -<!-- | |
2 | - Demoiselle Framework | |
3 | - Copyright (C) 2010 SERPRO | |
4 | - ============================================================================ | |
5 | - This file is part of Demoiselle Framework. | |
6 | - | |
7 | - Demoiselle Framework is free software; you can redistribute it and/or | |
8 | - modify it under the terms of the GNU Lesser General Public License version 3 | |
9 | - as published by the Free Software Foundation. | |
10 | - | |
11 | - This program is distributed in the hope that it will be useful, | |
12 | - but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | - GNU General Public License for more details. | |
15 | - | |
16 | - You should have received a copy of the GNU Lesser General Public License version 3 | |
17 | - along with this program; if not, see <http://www.gnu.org/licenses /> | |
18 | - or write to the Free Software Foundation, Inc., 51 Franklin Street, | |
19 | - Fifth Floor, Boston, MA 02110-1301, USA. | |
20 | - ============================================================================ | |
21 | - Este arquivo é parte do Framework Demoiselle. | |
22 | - | |
23 | - O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou | |
24 | - modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação | |
25 | - do Software Livre (FSF). | |
26 | - | |
27 | - Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA | |
28 | - GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou | |
29 | - APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português | |
30 | - para maiores detalhes. | |
31 | - | |
32 | - Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título | |
33 | - "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses /> | |
34 | - ou escreva para a Fundação do Software Livre (FSF) Inc., | |
35 | - 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. | |
36 | ---> | |
37 | -<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | |
38 | - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> | |
39 | - | |
40 | - <listener> | |
41 | - <listener-class>br.gov.frameworkdemoiselle.util.ServletListener</listener-class> | |
42 | - </listener> | |
43 | - | |
44 | - <filter> | |
45 | - <filter-name>Demoiselle Servlet Filter</filter-name> | |
46 | - <filter-class>br.gov.frameworkdemoiselle.util.ServletFilter</filter-class> | |
47 | - </filter> | |
48 | - <filter-mapping> | |
49 | - <filter-name>Demoiselle Servlet Filter</filter-name> | |
50 | - <url-pattern>/*</url-pattern> | |
51 | - </filter-mapping> | |
52 | - | |
53 | - <servlet> | |
54 | - <servlet-name>Request Class</servlet-name> | |
55 | - <servlet-class>producer.RequestServlet</servlet-class> | |
56 | - </servlet> | |
57 | - | |
58 | - <servlet-mapping> | |
59 | - <servlet-name>Request Class</servlet-name> | |
60 | - <url-pattern>/requestproducer</url-pattern> | |
61 | - </servlet-mapping> | |
62 | - | |
63 | - <servlet> | |
64 | - <servlet-name>Response xClass</servlet-name> | |
65 | - <servlet-class>producer.ResponseServlet</servlet-class> | |
66 | - </servlet> | |
67 | - | |
68 | - <servlet-mapping> | |
69 | - <servlet-name>Response xClass</servlet-name> | |
70 | - <url-pattern>/responseproducer</url-pattern> | |
71 | - </servlet-mapping> | |
72 | -</web-app> | |
73 | 0 | \ No newline at end of file |
impl/extension/servlet/src/test/resources/security/authentication/basic/web.xml
0 → 100644
... | ... | @@ -0,0 +1,82 @@ |
1 | +<!-- | |
2 | + Demoiselle Framework | |
3 | + Copyright (C) 2010 SERPRO | |
4 | + ============================================================================ | |
5 | + This file is part of Demoiselle Framework. | |
6 | + | |
7 | + Demoiselle Framework is free software; you can redistribute it and/or | |
8 | + modify it under the terms of the GNU Lesser General Public License version 3 | |
9 | + as published by the Free Software Foundation. | |
10 | + | |
11 | + This program is distributed in the hope that it will be useful, | |
12 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | + GNU General Public License for more details. | |
15 | + | |
16 | + You should have received a copy of the GNU Lesser General Public License version 3 | |
17 | + along with this program; if not, see <http://www.gnu.org/licenses /> | |
18 | + or write to the Free Software Foundation, Inc., 51 Franklin Street, | |
19 | + Fifth Floor, Boston, MA 02110-1301, USA. | |
20 | + ============================================================================ | |
21 | + Este arquivo é parte do Framework Demoiselle. | |
22 | + | |
23 | + O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou | |
24 | + modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação | |
25 | + do Software Livre (FSF). | |
26 | + | |
27 | + Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA | |
28 | + GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou | |
29 | + APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português | |
30 | + para maiores detalhes. | |
31 | + | |
32 | + Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título | |
33 | + "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses /> | |
34 | + ou escreva para a Fundação do Software Livre (FSF) Inc., | |
35 | + 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. | |
36 | +--> | |
37 | +<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | |
38 | + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> | |
39 | + | |
40 | + <listener> | |
41 | + <listener-class>br.gov.frameworkdemoiselle.util.ServletListener</listener-class> | |
42 | + </listener> | |
43 | + | |
44 | + <filter> | |
45 | + <filter-name>Demoiselle Servlet Filter</filter-name> | |
46 | + <filter-class>br.gov.frameworkdemoiselle.util.ServletFilter</filter-class> | |
47 | + </filter> | |
48 | + <filter-mapping> | |
49 | + <filter-name>Demoiselle Servlet Filter</filter-name> | |
50 | + <url-pattern>/*</url-pattern> | |
51 | + </filter-mapping> | |
52 | + | |
53 | + <servlet> | |
54 | + <servlet-name>Security Class</servlet-name> | |
55 | + <servlet-class>security.SecurityServlet</servlet-class> | |
56 | + </servlet> | |
57 | + <servlet-mapping> | |
58 | + <servlet-name>Security Class</servlet-name> | |
59 | + <url-pattern>/login</url-pattern> | |
60 | + </servlet-mapping> | |
61 | + | |
62 | + <!-- | |
63 | + <security-constraint> | |
64 | + <web-resource-collection> | |
65 | + <web-resource-name>Private URL</web-resource-name> | |
66 | + <url-pattern>/login</url-pattern> | |
67 | + </web-resource-collection> | |
68 | + <auth-constraint> | |
69 | + <role-name>*</role-name> | |
70 | + </auth-constraint> | |
71 | + </security-constraint> | |
72 | + | |
73 | + <login-config> | |
74 | + <auth-method>BASIC</auth-method> | |
75 | + <realm-name>fileRealm</realm-name> | |
76 | + </login-config> | |
77 | + | |
78 | + <security-role> | |
79 | + <role-name>*</role-name> | |
80 | + </security-role> | |
81 | + --> | |
82 | +</web-app> | |
0 | 83 | \ No newline at end of file | ... | ... |