Commit 23db2c230948289faa1a8f63f9bcf4fff108153f
1 parent
bbdc3141
Exists in
master
Formatação e adição de cabeçalho
Showing
7 changed files
with
280 additions
and
33 deletions
Show diff stats
impl/extension/jta/src/test/java/br/gov/frameworkdemoiselle/transaction/JTATransactionTest.java
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 | + | ||
1 | package br.gov.frameworkdemoiselle.transaction; | 38 | package br.gov.frameworkdemoiselle.transaction; |
2 | 39 | ||
3 | import static org.easymock.EasyMock.createMock; | 40 | import static org.easymock.EasyMock.createMock; |
impl/extension/servlet/src/test/java/br/gov/frameworkdemoiselle/internal/producer/HttpServletRequestProducerTest.java
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 | + */ | ||
1 | package br.gov.frameworkdemoiselle.internal.producer; | 37 | package br.gov.frameworkdemoiselle.internal.producer; |
2 | 38 | ||
3 | import static org.easymock.EasyMock.replay; | 39 | import static org.easymock.EasyMock.replay; |
@@ -5,20 +41,18 @@ import static org.powermock.api.easymock.PowerMock.createMock; | @@ -5,20 +41,18 @@ import static org.powermock.api.easymock.PowerMock.createMock; | ||
5 | import static org.powermock.api.easymock.PowerMock.verifyAll; | 41 | import static org.powermock.api.easymock.PowerMock.verifyAll; |
6 | 42 | ||
7 | import javax.servlet.http.HttpServletRequest; | 43 | import javax.servlet.http.HttpServletRequest; |
8 | -import javax.servlet.http.HttpServletResponse; | ||
9 | 44 | ||
10 | import junit.framework.Assert; | 45 | import junit.framework.Assert; |
11 | 46 | ||
12 | import org.junit.Test; | 47 | import org.junit.Test; |
13 | import org.powermock.reflect.Whitebox; | 48 | import org.powermock.reflect.Whitebox; |
14 | 49 | ||
15 | - | ||
16 | public class HttpServletRequestProducerTest { | 50 | public class HttpServletRequestProducerTest { |
17 | 51 | ||
18 | private HttpServletRequestProducer httpServletRequestProducer; | 52 | private HttpServletRequestProducer httpServletRequestProducer; |
19 | - | 53 | + |
20 | private HttpServletRequest request; | 54 | private HttpServletRequest request; |
21 | - | 55 | + |
22 | @Test | 56 | @Test |
23 | public void testCreate() { | 57 | public void testCreate() { |
24 | request = createMock(HttpServletRequest.class); | 58 | request = createMock(HttpServletRequest.class); |
@@ -28,10 +62,10 @@ public class HttpServletRequestProducerTest { | @@ -28,10 +62,10 @@ public class HttpServletRequestProducerTest { | ||
28 | Whitebox.setInternalState(httpServletRequestProducer, "request", request); | 62 | Whitebox.setInternalState(httpServletRequestProducer, "request", request); |
29 | 63 | ||
30 | Assert.assertEquals(httpServletRequestProducer.create(), request); | 64 | Assert.assertEquals(httpServletRequestProducer.create(), request); |
31 | - | 65 | + |
32 | verifyAll(); | 66 | verifyAll(); |
33 | } | 67 | } |
34 | - | 68 | + |
35 | @Test | 69 | @Test |
36 | public void testSetDelegate() { | 70 | public void testSetDelegate() { |
37 | request = createMock(HttpServletRequest.class); | 71 | request = createMock(HttpServletRequest.class); |
@@ -40,9 +74,9 @@ public class HttpServletRequestProducerTest { | @@ -40,9 +74,9 @@ public class HttpServletRequestProducerTest { | ||
40 | httpServletRequestProducer = new HttpServletRequestProducer(); | 74 | httpServletRequestProducer = new HttpServletRequestProducer(); |
41 | 75 | ||
42 | httpServletRequestProducer.setDelegate(request); | 76 | httpServletRequestProducer.setDelegate(request); |
43 | - Assert.assertEquals(Whitebox.getInternalState(httpServletRequestProducer, "request"),request); | ||
44 | - | 77 | + Assert.assertEquals(Whitebox.getInternalState(httpServletRequestProducer, "request"), request); |
78 | + | ||
45 | verifyAll(); | 79 | verifyAll(); |
46 | - } | ||
47 | - | 80 | + } |
81 | + | ||
48 | } | 82 | } |
impl/extension/servlet/src/test/java/br/gov/frameworkdemoiselle/internal/producer/HttpServletResponseProducerTest.java
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 | + */ | ||
1 | package br.gov.frameworkdemoiselle.internal.producer; | 37 | package br.gov.frameworkdemoiselle.internal.producer; |
2 | 38 | ||
3 | import static org.easymock.EasyMock.replay; | 39 | import static org.easymock.EasyMock.replay; |
4 | import static org.powermock.api.easymock.PowerMock.createMock; | 40 | import static org.powermock.api.easymock.PowerMock.createMock; |
5 | import static org.powermock.api.easymock.PowerMock.verifyAll; | 41 | import static org.powermock.api.easymock.PowerMock.verifyAll; |
6 | 42 | ||
7 | -import javax.servlet.http.HttpServletRequest; | ||
8 | import javax.servlet.http.HttpServletResponse; | 43 | import javax.servlet.http.HttpServletResponse; |
9 | 44 | ||
10 | import junit.framework.Assert; | 45 | import junit.framework.Assert; |
@@ -12,13 +47,12 @@ import junit.framework.Assert; | @@ -12,13 +47,12 @@ import junit.framework.Assert; | ||
12 | import org.junit.Test; | 47 | import org.junit.Test; |
13 | import org.powermock.reflect.Whitebox; | 48 | import org.powermock.reflect.Whitebox; |
14 | 49 | ||
15 | - | ||
16 | public class HttpServletResponseProducerTest { | 50 | public class HttpServletResponseProducerTest { |
17 | 51 | ||
18 | private HttpServletResponseProducer httpServletResponseProducer; | 52 | private HttpServletResponseProducer httpServletResponseProducer; |
19 | - | 53 | + |
20 | private HttpServletResponse response; | 54 | private HttpServletResponse response; |
21 | - | 55 | + |
22 | @Test | 56 | @Test |
23 | public void testCreate() { | 57 | public void testCreate() { |
24 | response = createMock(HttpServletResponse.class); | 58 | response = createMock(HttpServletResponse.class); |
@@ -28,10 +62,10 @@ public class HttpServletResponseProducerTest { | @@ -28,10 +62,10 @@ public class HttpServletResponseProducerTest { | ||
28 | Whitebox.setInternalState(httpServletResponseProducer, "response", response); | 62 | Whitebox.setInternalState(httpServletResponseProducer, "response", response); |
29 | 63 | ||
30 | Assert.assertEquals(httpServletResponseProducer.create(), response); | 64 | Assert.assertEquals(httpServletResponseProducer.create(), response); |
31 | - | 65 | + |
32 | verifyAll(); | 66 | verifyAll(); |
33 | } | 67 | } |
34 | - | 68 | + |
35 | @Test | 69 | @Test |
36 | public void testSetDelegate() { | 70 | public void testSetDelegate() { |
37 | response = createMock(HttpServletResponse.class); | 71 | response = createMock(HttpServletResponse.class); |
@@ -41,8 +75,8 @@ public class HttpServletResponseProducerTest { | @@ -41,8 +75,8 @@ public class HttpServletResponseProducerTest { | ||
41 | 75 | ||
42 | httpServletResponseProducer.setDelegate(response); | 76 | httpServletResponseProducer.setDelegate(response); |
43 | Assert.assertEquals(Whitebox.getInternalState(httpServletResponseProducer, "response"), response); | 77 | Assert.assertEquals(Whitebox.getInternalState(httpServletResponseProducer, "response"), response); |
44 | - | 78 | + |
45 | verifyAll(); | 79 | verifyAll(); |
46 | - } | ||
47 | - | 80 | + } |
81 | + | ||
48 | } | 82 | } |
impl/extension/servlet/src/test/java/br/gov/frameworkdemoiselle/internal/producer/HttpSessionProducerTest.java
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 | + */ | ||
1 | package br.gov.frameworkdemoiselle.internal.producer; | 37 | package br.gov.frameworkdemoiselle.internal.producer; |
2 | 38 | ||
3 | import static org.easymock.EasyMock.createMock; | 39 | import static org.easymock.EasyMock.createMock; |
impl/extension/servlet/src/test/java/br/gov/frameworkdemoiselle/internal/producer/ServletLocaleProducerTest.java
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 | + */ | ||
1 | package br.gov.frameworkdemoiselle.internal.producer; | 37 | package br.gov.frameworkdemoiselle.internal.producer; |
2 | 38 | ||
3 | import static org.easymock.EasyMock.createMock; | 39 | import static org.easymock.EasyMock.createMock; |
@@ -36,7 +72,7 @@ public class ServletLocaleProducerTest { | @@ -36,7 +72,7 @@ public class ServletLocaleProducerTest { | ||
36 | 72 | ||
37 | verifyAll(); | 73 | verifyAll(); |
38 | } | 74 | } |
39 | - | 75 | + |
40 | @Test | 76 | @Test |
41 | public void testCreate2() { | 77 | public void testCreate2() { |
42 | servletLocaleProducer = new ServletLocaleProducer(); | 78 | servletLocaleProducer = new ServletLocaleProducer(); |
impl/extension/servlet/src/test/java/br/gov/frameworkdemoiselle/internal/proxy/HttpServletRequestProxyTest.java
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 | + */ | ||
1 | package br.gov.frameworkdemoiselle.internal.proxy; | 37 | package br.gov.frameworkdemoiselle.internal.proxy; |
2 | 38 | ||
3 | import org.junit.runner.RunWith; | 39 | import org.junit.runner.RunWith; |
@@ -6,6 +42,4 @@ import org.powermock.modules.junit4.PowerMockRunner; | @@ -6,6 +42,4 @@ import org.powermock.modules.junit4.PowerMockRunner; | ||
6 | @RunWith(PowerMockRunner.class) | 42 | @RunWith(PowerMockRunner.class) |
7 | public class HttpServletRequestProxyTest { | 43 | public class HttpServletRequestProxyTest { |
8 | 44 | ||
9 | - | ||
10 | - | ||
11 | } | 45 | } |
impl/extension/servlet/src/test/java/br/gov/frameworkdemoiselle/util/ServletListenerTest.java
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 | + */ | ||
1 | package br.gov.frameworkdemoiselle.util; | 37 | package br.gov.frameworkdemoiselle.util; |
2 | 38 | ||
3 | import static org.easymock.EasyMock.createMock; | 39 | import static org.easymock.EasyMock.createMock; |
@@ -24,41 +60,41 @@ import br.gov.frameworkdemoiselle.lifecycle.AfterStartupProccess; | @@ -24,41 +60,41 @@ import br.gov.frameworkdemoiselle.lifecycle.AfterStartupProccess; | ||
24 | public class ServletListenerTest { | 60 | public class ServletListenerTest { |
25 | 61 | ||
26 | private ServletListener listener; | 62 | private ServletListener listener; |
27 | - | 63 | + |
28 | @Test | 64 | @Test |
29 | public void testContextInitialized() { | 65 | public void testContextInitialized() { |
30 | ServletContextEvent event = createMock(ServletContextEvent.class); | 66 | ServletContextEvent event = createMock(ServletContextEvent.class); |
31 | BeanManager beanManager = PowerMock.createMock(BeanManager.class); | 67 | BeanManager beanManager = PowerMock.createMock(BeanManager.class); |
32 | - | 68 | + |
33 | mockStatic(Beans.class); | 69 | mockStatic(Beans.class); |
34 | expect(Beans.getBeanManager()).andReturn(beanManager); | 70 | expect(Beans.getBeanManager()).andReturn(beanManager); |
35 | beanManager.fireEvent(EasyMock.anyObject(AfterStartupProccess.class)); | 71 | beanManager.fireEvent(EasyMock.anyObject(AfterStartupProccess.class)); |
36 | PowerMock.expectLastCall().times(1); | 72 | PowerMock.expectLastCall().times(1); |
37 | - | 73 | + |
38 | replayAll(); | 74 | replayAll(); |
39 | - | 75 | + |
40 | listener = new ServletListener(); | 76 | listener = new ServletListener(); |
41 | listener.contextInitialized(event); | 77 | listener.contextInitialized(event); |
42 | - | 78 | + |
43 | verifyAll(); | 79 | verifyAll(); |
44 | } | 80 | } |
45 | - | 81 | + |
46 | @Test | 82 | @Test |
47 | public void testContextDestroyed() { | 83 | public void testContextDestroyed() { |
48 | ServletContextEvent event = createMock(ServletContextEvent.class); | 84 | ServletContextEvent event = createMock(ServletContextEvent.class); |
49 | BeanManager beanManager = PowerMock.createMock(BeanManager.class); | 85 | BeanManager beanManager = PowerMock.createMock(BeanManager.class); |
50 | - | 86 | + |
51 | mockStatic(Beans.class); | 87 | mockStatic(Beans.class); |
52 | expect(Beans.getBeanManager()).andReturn(beanManager); | 88 | expect(Beans.getBeanManager()).andReturn(beanManager); |
53 | beanManager.fireEvent(EasyMock.anyObject(ShutdownBootstrap.class)); | 89 | beanManager.fireEvent(EasyMock.anyObject(ShutdownBootstrap.class)); |
54 | PowerMock.expectLastCall().times(1); | 90 | PowerMock.expectLastCall().times(1); |
55 | - | 91 | + |
56 | replayAll(); | 92 | replayAll(); |
57 | - | 93 | + |
58 | listener = new ServletListener(); | 94 | listener = new ServletListener(); |
59 | listener.contextDestroyed(event); | 95 | listener.contextDestroyed(event); |
60 | - | 96 | + |
61 | verifyAll(); | 97 | verifyAll(); |
62 | } | 98 | } |
63 | - | 99 | + |
64 | } | 100 | } |