Commit a4f9a12f824dbb19fe9e29a9fc6cf080336990b4
1 parent
54310c9c
Exists in
master
Adição de testes para a utilização do Bean Validation.
Showing
11 changed files
with
535 additions
and
0 deletions
Show diff stats
impl/core/src/test/java/configuration/field/beanvalidation/BeanValidationWithEmptyNotNullFieldConfig.java
0 → 100644
| @@ -0,0 +1,56 @@ | @@ -0,0 +1,56 @@ | ||
| 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 configuration.field.beanvalidation; | ||
| 38 | + | ||
| 39 | +import javax.validation.constraints.NotNull; | ||
| 40 | + | ||
| 41 | +public abstract class BeanValidationWithEmptyNotNullFieldConfig { | ||
| 42 | + | ||
| 43 | + @NotNull | ||
| 44 | + private Integer intAttributeNull; | ||
| 45 | + | ||
| 46 | + @NotNull | ||
| 47 | + private String stringAttributeNull; | ||
| 48 | + | ||
| 49 | + public Integer getIntAttributeNull() { | ||
| 50 | + return intAttributeNull; | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + public String getStringAttributeNull() { | ||
| 54 | + return stringAttributeNull; | ||
| 55 | + } | ||
| 56 | +} |
impl/core/src/test/java/configuration/field/beanvalidation/BeanValidationWithFilledNotNullFieldConfig.java
0 → 100644
| @@ -0,0 +1,20 @@ | @@ -0,0 +1,20 @@ | ||
| 1 | +package configuration.field.beanvalidation; | ||
| 2 | + | ||
| 3 | +import javax.validation.constraints.NotNull; | ||
| 4 | + | ||
| 5 | +public class BeanValidationWithFilledNotNullFieldConfig { | ||
| 6 | + | ||
| 7 | + @NotNull | ||
| 8 | + private String stringAttributeNotNull; | ||
| 9 | + | ||
| 10 | + @NotNull | ||
| 11 | + private Integer intAttibuteNotNull; | ||
| 12 | + | ||
| 13 | + public String getStringAttributeNotNull() { | ||
| 14 | + return stringAttributeNotNull; | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + public Integer getIntAttibuteNotNull() { | ||
| 18 | + return intAttibuteNotNull; | ||
| 19 | + } | ||
| 20 | +} |
impl/core/src/test/java/configuration/field/beanvalidation/ConfigurationBeanValidationFieldTest.java
0 → 100644
| @@ -0,0 +1,147 @@ | @@ -0,0 +1,147 @@ | ||
| 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 configuration.field.beanvalidation; | ||
| 38 | + | ||
| 39 | +import static junit.framework.Assert.assertEquals; | ||
| 40 | +import static junit.framework.Assert.fail; | ||
| 41 | + | ||
| 42 | +import javax.inject.Inject; | ||
| 43 | +import javax.validation.ConstraintViolationException; | ||
| 44 | + | ||
| 45 | +import junit.framework.Assert; | ||
| 46 | + | ||
| 47 | +import org.jboss.arquillian.container.test.api.Deployment; | ||
| 48 | +import org.jboss.arquillian.junit.Arquillian; | ||
| 49 | +import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
| 50 | +import org.junit.Test; | ||
| 51 | +import org.junit.runner.RunWith; | ||
| 52 | + | ||
| 53 | +import test.Tests; | ||
| 54 | + | ||
| 55 | +import br.gov.frameworkdemoiselle.configuration.ConfigurationException; | ||
| 56 | + | ||
| 57 | +@RunWith(Arquillian.class) | ||
| 58 | +public class ConfigurationBeanValidationFieldTest { | ||
| 59 | + | ||
| 60 | + private static final String PATH = "src/test/resources/configuration/field/beanvalidation"; | ||
| 61 | + | ||
| 62 | + @Inject | ||
| 63 | + private PropertyBeanValidationWithFIlledNotNullFieldConfig propertyBeanValidationWithFIlledNotNullFieldConfig; | ||
| 64 | + | ||
| 65 | + @Inject | ||
| 66 | + private XMLBeanValidationWithFilledNotNullFieldConfig xmlBeanValidationWithFilledNotNullFieldConfig; | ||
| 67 | + | ||
| 68 | + @Inject | ||
| 69 | + private PropertyBeanValidationWithEmptyNotNullFieldConfig propertyBeanValidationWithEmptyNotNullFieldConfig; | ||
| 70 | + | ||
| 71 | + @Inject | ||
| 72 | + private XMLBeanValidationWithEmptyNotNullFieldConfig xmlBeanValidationWithEmptyNotNullFieldConfig; | ||
| 73 | + | ||
| 74 | + @Inject | ||
| 75 | + private PropertyWithTwoConstrainViolations propertyWithTwoConstrainViolations; | ||
| 76 | + | ||
| 77 | + @Deployment | ||
| 78 | + public static JavaArchive createDeployment() { | ||
| 79 | + | ||
| 80 | + JavaArchive deployment = Tests.createDeployment(ConfigurationBeanValidationFieldTest.class); | ||
| 81 | + deployment.addAsResource(Tests.createFileAsset(PATH + "/demoiselle.properties"), "demoiselle.properties"); | ||
| 82 | + deployment.addAsResource(Tests.createFileAsset(PATH + "/demoiselle.xml"), "demoiselle.xml"); | ||
| 83 | + deployment.addAsResource(Tests.createFileAsset(PATH + "/two-constrain-validation.properties"), "two-constrain-validation.properties"); | ||
| 84 | + | ||
| 85 | + return deployment; | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + @Test | ||
| 89 | + public void loadIntegerNotNullFieldFromFilledFile() { | ||
| 90 | + Integer expectedInt = 1; | ||
| 91 | + | ||
| 92 | + assertEquals(expectedInt, propertyBeanValidationWithFIlledNotNullFieldConfig.getIntAttibuteNotNull()); | ||
| 93 | + assertEquals(expectedInt, xmlBeanValidationWithFilledNotNullFieldConfig.getIntAttibuteNotNull()); | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + @Test | ||
| 97 | + public void loadStringNotNullFieldFromFilledFile() { | ||
| 98 | + String expectedString = "Not null!"; | ||
| 99 | + | ||
| 100 | + assertEquals(expectedString, propertyBeanValidationWithFIlledNotNullFieldConfig.getStringAttributeNotNull()); | ||
| 101 | + assertEquals(expectedString, xmlBeanValidationWithFilledNotNullFieldConfig.getStringAttributeNotNull()); | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + @Test | ||
| 105 | + public void loadIntNotNullFieldFromNotFilledFile() { | ||
| 106 | + try { | ||
| 107 | + propertyBeanValidationWithEmptyNotNullFieldConfig.getIntAttributeNull(); | ||
| 108 | + fail(); | ||
| 109 | + } catch (ConfigurationException cause) { | ||
| 110 | + Assert.assertEquals(ConstraintViolationException.class, cause.getCause().getClass()); | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + try { | ||
| 114 | + xmlBeanValidationWithEmptyNotNullFieldConfig.getIntAttributeNull(); | ||
| 115 | + fail(); | ||
| 116 | + } catch (ConfigurationException cause) { | ||
| 117 | + Assert.assertEquals(ConstraintViolationException.class, cause.getCause().getClass()); | ||
| 118 | + } | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | + @Test | ||
| 122 | + public void loadStringNotNullFieldFromNotFilledFile() { | ||
| 123 | + try { | ||
| 124 | + propertyBeanValidationWithEmptyNotNullFieldConfig.getStringAttributeNull(); | ||
| 125 | + fail(); | ||
| 126 | + } catch (ConfigurationException cause) { | ||
| 127 | + Assert.assertEquals(ConstraintViolationException.class, cause.getCause().getClass()); | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + try { | ||
| 131 | + xmlBeanValidationWithEmptyNotNullFieldConfig.getStringAttributeNull(); | ||
| 132 | + fail(); | ||
| 133 | + } catch (ConfigurationException cause) { | ||
| 134 | + Assert.assertEquals(ConstraintViolationException.class, cause.getCause().getClass()); | ||
| 135 | + } | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + @Test | ||
| 139 | + public void loadPropertiesWithTwoConstraintViolations(){ | ||
| 140 | + try { | ||
| 141 | + propertyWithTwoConstrainViolations.getAttributeWithTwoConstrainValidations(); | ||
| 142 | + fail(); | ||
| 143 | + } catch (ConfigurationException cause) { | ||
| 144 | + Assert.assertEquals(ConstraintViolationException.class, cause.getCause().getClass()); | ||
| 145 | + } | ||
| 146 | + } | ||
| 147 | +} |
impl/core/src/test/java/configuration/field/beanvalidation/PropertyBeanValidationWithEmptyNotNullFieldConfig.java
0 → 100644
| @@ -0,0 +1,44 @@ | @@ -0,0 +1,44 @@ | ||
| 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 configuration.field.beanvalidation; | ||
| 38 | + | ||
| 39 | +import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES; | ||
| 40 | +import br.gov.frameworkdemoiselle.configuration.Configuration; | ||
| 41 | + | ||
| 42 | +@Configuration(resource = "demoiselle", type = PROPERTIES) | ||
| 43 | +public class PropertyBeanValidationWithEmptyNotNullFieldConfig extends BeanValidationWithEmptyNotNullFieldConfig { | ||
| 44 | +} |
impl/core/src/test/java/configuration/field/beanvalidation/PropertyBeanValidationWithFIlledNotNullFieldConfig.java
0 → 100644
| @@ -0,0 +1,44 @@ | @@ -0,0 +1,44 @@ | ||
| 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 configuration.field.beanvalidation; | ||
| 38 | + | ||
| 39 | +import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES; | ||
| 40 | +import br.gov.frameworkdemoiselle.configuration.Configuration; | ||
| 41 | + | ||
| 42 | +@Configuration(resource = "demoiselle", type = PROPERTIES) | ||
| 43 | +public class PropertyBeanValidationWithFIlledNotNullFieldConfig extends BeanValidationWithFilledNotNullFieldConfig { | ||
| 44 | +} |
impl/core/src/test/java/configuration/field/beanvalidation/PropertyWithTwoConstrainViolations.java
0 → 100644
| @@ -0,0 +1,20 @@ | @@ -0,0 +1,20 @@ | ||
| 1 | +package configuration.field.beanvalidation; | ||
| 2 | + | ||
| 3 | +import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES; | ||
| 4 | + | ||
| 5 | +import javax.validation.constraints.Max; | ||
| 6 | +import javax.validation.constraints.Min; | ||
| 7 | + | ||
| 8 | +import br.gov.frameworkdemoiselle.configuration.Configuration; | ||
| 9 | + | ||
| 10 | +@Configuration(resource = "two-constrain-validation", type = PROPERTIES) | ||
| 11 | +public class PropertyWithTwoConstrainViolations { | ||
| 12 | + | ||
| 13 | + @Max(10) | ||
| 14 | + @Min(50) | ||
| 15 | + private int attributeViolateTwoConstraints; | ||
| 16 | + | ||
| 17 | + public int getAttributeWithTwoConstrainValidations() { | ||
| 18 | + return attributeViolateTwoConstraints; | ||
| 19 | + } | ||
| 20 | +} |
impl/core/src/test/java/configuration/field/beanvalidation/XMLBeanValidationWithEmptyNotNullFieldConfig.java
0 → 100644
| @@ -0,0 +1,44 @@ | @@ -0,0 +1,44 @@ | ||
| 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 configuration.field.beanvalidation; | ||
| 38 | + | ||
| 39 | +import static br.gov.frameworkdemoiselle.configuration.ConfigType.XML; | ||
| 40 | +import br.gov.frameworkdemoiselle.configuration.Configuration; | ||
| 41 | + | ||
| 42 | +@Configuration(resource = "demoiselle", type = XML) | ||
| 43 | +public class XMLBeanValidationWithEmptyNotNullFieldConfig extends BeanValidationWithEmptyNotNullFieldConfig { | ||
| 44 | +} |
impl/core/src/test/java/configuration/field/beanvalidation/XMLBeanValidationWithFilledNotNullFieldConfig.java
0 → 100644
| @@ -0,0 +1,44 @@ | @@ -0,0 +1,44 @@ | ||
| 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 configuration.field.beanvalidation; | ||
| 38 | + | ||
| 39 | +import static br.gov.frameworkdemoiselle.configuration.ConfigType.XML; | ||
| 40 | +import br.gov.frameworkdemoiselle.configuration.Configuration; | ||
| 41 | + | ||
| 42 | +@Configuration(resource = "demoiselle", type = XML) | ||
| 43 | +public class XMLBeanValidationWithFilledNotNullFieldConfig extends BeanValidationWithFilledNotNullFieldConfig { | ||
| 44 | +} |
impl/core/src/test/resources/configuration/field/beanvalidation/demoiselle.properties
0 → 100644
| @@ -0,0 +1,38 @@ | @@ -0,0 +1,38 @@ | ||
| 1 | +# Demoiselle Framework | ||
| 2 | +# Copyright (C) 2010 SERPRO | ||
| 3 | +# ---------------------------------------------------------------------------- | ||
| 4 | +# This file is part of Demoiselle Framework. | ||
| 5 | +# | ||
| 6 | +# Demoiselle Framework is free software; you can redistribute it and/or | ||
| 7 | +# modify it under the terms of the GNU Lesser General Public License version 3 | ||
| 8 | +# as published by the Free Software Foundation. | ||
| 9 | +# | ||
| 10 | +# This program is distributed in the hope that it will be useful, | ||
| 11 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | +# GNU General Public License for more details. | ||
| 14 | +# | ||
| 15 | +# You should have received a copy of the GNU Lesser General Public License version 3 | ||
| 16 | +# along with this program; if not, see <http://www.gnu.org/licenses/> | ||
| 17 | +# or write to the Free Software Foundation, Inc., 51 Franklin Street, | ||
| 18 | +# Fifth Floor, Boston, MA 02110-1301, USA. | ||
| 19 | +# ---------------------------------------------------------------------------- | ||
| 20 | +# Este arquivo é parte do Framework Demoiselle. | ||
| 21 | +# | ||
| 22 | +# O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou | ||
| 23 | +# modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação | ||
| 24 | +# do Software Livre (FSF). | ||
| 25 | +# | ||
| 26 | +# Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA | ||
| 27 | +# GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou | ||
| 28 | +# APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português | ||
| 29 | +# para maiores detalhes. | ||
| 30 | +# | ||
| 31 | +# Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título | ||
| 32 | +# "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses/> | ||
| 33 | +# ou escreva para a Fundação do Software Livre (FSF) Inc., | ||
| 34 | +# 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. | ||
| 35 | + | ||
| 36 | +intAttibuteNotNull=1 | ||
| 37 | +stringAttributeNotNull=Not null! | ||
| 38 | +attributeViolateTwoConstraints=30 |
impl/core/src/test/resources/configuration/field/beanvalidation/demoiselle.xml
0 → 100644
| @@ -0,0 +1,42 @@ | @@ -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 | + | ||
| 38 | +<configurations> | ||
| 39 | + <intAttibuteNotNull>1</intAttibuteNotNull> | ||
| 40 | + <stringAttributeNotNull>Not null!</stringAttributeNotNull> | ||
| 41 | + <attributeViolateTwoConstraints>30</attributeViolateTwoConstraints> | ||
| 42 | +</configurations> |
impl/core/src/test/resources/configuration/field/beanvalidation/two-constrain-validation.properties
0 → 100644
| @@ -0,0 +1,36 @@ | @@ -0,0 +1,36 @@ | ||
| 1 | +# Demoiselle Framework | ||
| 2 | +# Copyright (C) 2010 SERPRO | ||
| 3 | +# ---------------------------------------------------------------------------- | ||
| 4 | +# This file is part of Demoiselle Framework. | ||
| 5 | +# | ||
| 6 | +# Demoiselle Framework is free software; you can redistribute it and/or | ||
| 7 | +# modify it under the terms of the GNU Lesser General Public License version 3 | ||
| 8 | +# as published by the Free Software Foundation. | ||
| 9 | +# | ||
| 10 | +# This program is distributed in the hope that it will be useful, | ||
| 11 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | +# GNU General Public License for more details. | ||
| 14 | +# | ||
| 15 | +# You should have received a copy of the GNU Lesser General Public License version 3 | ||
| 16 | +# along with this program; if not, see <http://www.gnu.org/licenses/> | ||
| 17 | +# or write to the Free Software Foundation, Inc., 51 Franklin Street, | ||
| 18 | +# Fifth Floor, Boston, MA 02110-1301, USA. | ||
| 19 | +# ---------------------------------------------------------------------------- | ||
| 20 | +# Este arquivo é parte do Framework Demoiselle. | ||
| 21 | +# | ||
| 22 | +# O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou | ||
| 23 | +# modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação | ||
| 24 | +# do Software Livre (FSF). | ||
| 25 | +# | ||
| 26 | +# Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA | ||
| 27 | +# GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou | ||
| 28 | +# APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português | ||
| 29 | +# para maiores detalhes. | ||
| 30 | +# | ||
| 31 | +# Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título | ||
| 32 | +# "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses/> | ||
| 33 | +# ou escreva para a Fundação do Software Livre (FSF) Inc., | ||
| 34 | +# 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. | ||
| 35 | + | ||
| 36 | +attributeViolateTwoConstraints=30 |