Commit 3218478d7b16b88dd7e1eff139075b3940f3bf27
Exists in
master
Merge branch '2.4.0' of git@github.com:demoiselle/framework.git into 2.4.0
Showing
13 changed files
with
519 additions
and
12 deletions
Show diff stats
documentation/reference/pt-BR/security.xml
| ... | ... | @@ -20,8 +20,7 @@ |
| 20 | 20 | <title>Configurando</title> |
| 21 | 21 | |
| 22 | 22 | <para> |
| 23 | - Para um correto funcionamento da segurança no Framework Demoiselle é necessário inserir os interceptadores de segurança no arquivo <filename>beans.xml</filename>, localizado | |
| 24 | - na pasta WEB-INF em projetos WEB ou na pasta META-INF em projetos SE ou EJB. | |
| 23 | + Para um correto funcionamento do Demoiselle é necessário inserir os interceptadores de segurança no arquivo <filename>src/main/webapp/WEB-INF/beans.xml</filename>. | |
| 25 | 24 | </para> |
| 26 | 25 | |
| 27 | 26 | <programlisting role="XML"><![CDATA[<beans xmlns="http://java.sun.com/xml/ns/javaee" |
| ... | ... | @@ -239,7 +238,6 @@ class GerenciadorBookmark { |
| 239 | 238 | } |
| 240 | 239 | |
| 241 | 240 | }]]></programlisting> |
| 242 | - | |
| 243 | 241 | <tip> |
| 244 | 242 | É possível informar mais de um papel para a anotação <code>@RequiredRole</code>, neste caso basta que o usuário |
| 245 | 243 | autenticado possua um dos papéis listados para ter acesso ao recurso. |
| ... | ... | @@ -535,8 +533,8 @@ class GerenciadorBookmark { |
| 535 | 533 | } |
| 536 | 534 | |
| 537 | 535 | @Override |
| 538 | - public boolean hasPermission(Object resource, String operation) { | |
| 539 | - // Verifique se o usuario autenticado tem a permissao adequada, retorne true em caso positivo | |
| 536 | + public boolean hasPermission(String resource, String operation) { | |
| 537 | + // Escreva aqui seu codigo de verificação de permissao | |
| 540 | 538 | return false; |
| 541 | 539 | } |
| 542 | 540 | }]]></programlisting> |
| ... | ... | @@ -612,5 +610,4 @@ class GerenciadorBookmark { |
| 612 | 610 | </tgroup> |
| 613 | 611 | </informaltable> |
| 614 | 612 | </section> |
| 615 | - | |
| 616 | -</chapter> | |
| 617 | 613 | \ No newline at end of file |
| 614 | +</chapter> | ... | ... |
impl/core/src/test/java/util/ResourceBundleTest.java
| ... | ... | @@ -37,14 +37,10 @@ |
| 37 | 37 | package util; |
| 38 | 38 | |
| 39 | 39 | import static org.junit.Assert.assertEquals; |
| 40 | -import static org.junit.Assert.assertFalse; | |
| 41 | -import static org.junit.Assert.assertTrue; | |
| 42 | 40 | |
| 43 | -import java.util.Enumeration; | |
| 44 | 41 | import java.util.Locale; |
| 45 | 42 | |
| 46 | 43 | import org.junit.Before; |
| 47 | -import org.junit.Ignore; | |
| 48 | 44 | import org.junit.Test; |
| 49 | 45 | |
| 50 | 46 | import br.gov.frameworkdemoiselle.util.ResourceBundle; | ... | ... |
| ... | ... | @@ -0,0 +1,112 @@ |
| 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 | +package util.beans; | |
| 38 | + | |
| 39 | +import static org.junit.Assert.assertEquals; | |
| 40 | +import static org.junit.Assert.fail; | |
| 41 | + | |
| 42 | +import java.util.NoSuchElementException; | |
| 43 | + | |
| 44 | +import org.jboss.arquillian.container.test.api.Deployment; | |
| 45 | +import org.jboss.arquillian.junit.Arquillian; | |
| 46 | +import org.jboss.shrinkwrap.api.spec.JavaArchive; | |
| 47 | +import org.junit.Test; | |
| 48 | +import org.junit.runner.RunWith; | |
| 49 | + | |
| 50 | +import test.Tests; | |
| 51 | + | |
| 52 | +import br.gov.frameworkdemoiselle.DemoiselleException; | |
| 53 | +import br.gov.frameworkdemoiselle.util.Beans; | |
| 54 | + | |
| 55 | +@RunWith(Arquillian.class) | |
| 56 | +public class BeansTest { | |
| 57 | + | |
| 58 | + @Deployment | |
| 59 | + public static JavaArchive createDeployment() { | |
| 60 | + JavaArchive deployment = Tests.createDeployment(BeansTest.class); | |
| 61 | + return deployment; | |
| 62 | + } | |
| 63 | + | |
| 64 | + @Test | |
| 65 | + public void beanClassAndQualifierTest() { | |
| 66 | + assertEquals(DummyQualifierOne.class, | |
| 67 | + (Beans.getReference(DummyQualifier.class, DummyQualifierOne.class.getAnnotations())).getClass()); | |
| 68 | + assertEquals(DummyQualifierTwo.class, | |
| 69 | + (Beans.getReference(DummyQualifier.class, DummyQualifierTwo.class.getAnnotations())).getClass()); | |
| 70 | + } | |
| 71 | + | |
| 72 | + @Test | |
| 73 | + public void beanClassAndQualifierExceptionTest() { | |
| 74 | + try { | |
| 75 | + Beans.getReference(DummyQualifier.class, DummyQualifierOne.class.getAnnotations()[0], | |
| 76 | + DummyQualifierTwo.class.getAnnotations()[0]); | |
| 77 | + fail(); | |
| 78 | + } catch (DemoiselleException cause) { | |
| 79 | + assertEquals(NoSuchElementException.class, cause.getCause().getClass()); | |
| 80 | + } | |
| 81 | + } | |
| 82 | + | |
| 83 | + @Test | |
| 84 | + public void beanClassTest() { | |
| 85 | + assertEquals(DummyImplementation.class, Beans.getReference(Dummy.class).getClass()); | |
| 86 | + } | |
| 87 | + | |
| 88 | + @Test | |
| 89 | + public void beanClassExceptionTest() { | |
| 90 | + try { | |
| 91 | + Beans.getReference(InexistentImplementationInterface.class); | |
| 92 | + fail(); | |
| 93 | + } catch (DemoiselleException cause) { | |
| 94 | + assertEquals(NoSuchElementException.class, cause.getCause().getClass()); | |
| 95 | + } | |
| 96 | + } | |
| 97 | + | |
| 98 | + @Test | |
| 99 | + public void beanNameTest() { | |
| 100 | + assertEquals(DummyEL.class, Beans.getReference("DummyClass").getClass()); | |
| 101 | + } | |
| 102 | + | |
| 103 | + @Test | |
| 104 | + public void beanNameExceptionTest() { | |
| 105 | + try { | |
| 106 | + Beans.getReference("DummyEL"); | |
| 107 | + fail(); | |
| 108 | + } catch (DemoiselleException cause) { | |
| 109 | + assertEquals(NoSuchElementException.class, cause.getCause().getClass()); | |
| 110 | + } | |
| 111 | + } | |
| 112 | +} | ... | ... |
| ... | ... | @@ -0,0 +1,42 @@ |
| 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 | +package util.beans; | |
| 38 | + | |
| 39 | +public interface Dummy { | |
| 40 | + | |
| 41 | + public void dummyMethod(); | |
| 42 | +} | ... | ... |
| ... | ... | @@ -0,0 +1,43 @@ |
| 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 | +package util.beans; | |
| 38 | + | |
| 39 | +import javax.inject.Named; | |
| 40 | + | |
| 41 | +@Named("DummyClass") | |
| 42 | +public class DummyEL { | |
| 43 | +} | ... | ... |
impl/core/src/test/java/util/beans/DummyImplementation.java
0 → 100644
| ... | ... | @@ -0,0 +1,47 @@ |
| 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 | +package util.beans; | |
| 38 | + | |
| 39 | +import br.gov.frameworkdemoiselle.annotation.Priority; | |
| 40 | + | |
| 41 | +@Priority(value = 1) | |
| 42 | +public class DummyImplementation implements Dummy { | |
| 43 | + | |
| 44 | + @Override | |
| 45 | + public void dummyMethod() { | |
| 46 | + } | |
| 47 | +} | ... | ... |
| ... | ... | @@ -0,0 +1,40 @@ |
| 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 | +package util.beans; | |
| 38 | + | |
| 39 | +public interface DummyQualifier { | |
| 40 | +} | ... | ... |
impl/core/src/test/java/util/beans/DummyQualifierOne.java
0 → 100644
| ... | ... | @@ -0,0 +1,41 @@ |
| 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 | +package util.beans; | |
| 38 | + | |
| 39 | +@QualifierOne | |
| 40 | +public class DummyQualifierOne implements DummyQualifier { | |
| 41 | +} | ... | ... |
impl/core/src/test/java/util/beans/DummyQualifierTwo.java
0 → 100644
| ... | ... | @@ -0,0 +1,41 @@ |
| 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 | +package util.beans; | |
| 38 | + | |
| 39 | +@QualifierTwo | |
| 40 | +public class DummyQualifierTwo implements DummyQualifier{ | |
| 41 | +} | ... | ... |
impl/core/src/test/java/util/beans/InexistentImplementationInterface.java
0 → 100644
| ... | ... | @@ -0,0 +1,40 @@ |
| 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 | +package util.beans; | |
| 38 | + | |
| 39 | +public interface InexistentImplementationInterface { | |
| 40 | +} | ... | ... |
| ... | ... | @@ -0,0 +1,54 @@ |
| 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 | +package util.beans; | |
| 38 | + | |
| 39 | +import static java.lang.annotation.ElementType.FIELD; | |
| 40 | +import static java.lang.annotation.ElementType.METHOD; | |
| 41 | +import static java.lang.annotation.ElementType.TYPE; | |
| 42 | +import static java.lang.annotation.ElementType.PARAMETER; | |
| 43 | +import static java.lang.annotation.RetentionPolicy.RUNTIME; | |
| 44 | + | |
| 45 | +import java.lang.annotation.Retention; | |
| 46 | +import java.lang.annotation.Target; | |
| 47 | + | |
| 48 | +import javax.inject.Qualifier; | |
| 49 | + | |
| 50 | +@Qualifier | |
| 51 | +@Target({TYPE, METHOD, PARAMETER, FIELD}) | |
| 52 | +@Retention(RUNTIME) | |
| 53 | +public @interface QualifierOne { | |
| 54 | +} | ... | ... |
| ... | ... | @@ -0,0 +1,54 @@ |
| 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 | +package util.beans; | |
| 38 | + | |
| 39 | +import static java.lang.annotation.ElementType.FIELD; | |
| 40 | +import static java.lang.annotation.ElementType.METHOD; | |
| 41 | +import static java.lang.annotation.ElementType.TYPE; | |
| 42 | +import static java.lang.annotation.ElementType.PARAMETER; | |
| 43 | +import static java.lang.annotation.RetentionPolicy.RUNTIME; | |
| 44 | + | |
| 45 | +import java.lang.annotation.Retention; | |
| 46 | +import java.lang.annotation.Target; | |
| 47 | + | |
| 48 | +import javax.inject.Qualifier; | |
| 49 | + | |
| 50 | +@Qualifier | |
| 51 | +@Target({TYPE, METHOD, PARAMETER, FIELD}) | |
| 52 | +@Retention(RUNTIME) | |
| 53 | +public @interface QualifierTwo { | |
| 54 | +} | |
| 0 | 55 | \ No newline at end of file | ... | ... |
impl/extension/jsf/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/ParameterImpl.java
| ... | ... | @@ -82,7 +82,7 @@ public class ParameterImpl<T extends Serializable> implements Parameter<T>, Seri |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | private HttpServletRequest getRequest() { |
| 85 | - return Beans.getReference(HttpServletRequest.class); | |
| 85 | + return (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest(); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | @Inject | ... | ... |