From a4f9a12f824dbb19fe9e29a9fc6cf080336990b4 Mon Sep 17 00:00:00 2001 From: Emerson Oliveira Date: Wed, 17 Apr 2013 10:42:12 -0300 Subject: [PATCH] Adição de testes para a utilização do Bean Validation. --- impl/core/src/test/java/configuration/field/beanvalidation/BeanValidationWithEmptyNotNullFieldConfig.java | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ impl/core/src/test/java/configuration/field/beanvalidation/BeanValidationWithFilledNotNullFieldConfig.java | 20 ++++++++++++++++++++ impl/core/src/test/java/configuration/field/beanvalidation/ConfigurationBeanValidationFieldTest.java | 147 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ impl/core/src/test/java/configuration/field/beanvalidation/PropertyBeanValidationWithEmptyNotNullFieldConfig.java | 44 ++++++++++++++++++++++++++++++++++++++++++++ impl/core/src/test/java/configuration/field/beanvalidation/PropertyBeanValidationWithFIlledNotNullFieldConfig.java | 44 ++++++++++++++++++++++++++++++++++++++++++++ impl/core/src/test/java/configuration/field/beanvalidation/PropertyWithTwoConstrainViolations.java | 20 ++++++++++++++++++++ impl/core/src/test/java/configuration/field/beanvalidation/XMLBeanValidationWithEmptyNotNullFieldConfig.java | 44 ++++++++++++++++++++++++++++++++++++++++++++ impl/core/src/test/java/configuration/field/beanvalidation/XMLBeanValidationWithFilledNotNullFieldConfig.java | 44 ++++++++++++++++++++++++++++++++++++++++++++ impl/core/src/test/resources/configuration/field/beanvalidation/demoiselle.properties | 38 ++++++++++++++++++++++++++++++++++++++ impl/core/src/test/resources/configuration/field/beanvalidation/demoiselle.xml | 42 ++++++++++++++++++++++++++++++++++++++++++ impl/core/src/test/resources/configuration/field/beanvalidation/two-constrain-validation.properties | 36 ++++++++++++++++++++++++++++++++++++ 11 files changed, 535 insertions(+), 0 deletions(-) create mode 100644 impl/core/src/test/java/configuration/field/beanvalidation/BeanValidationWithEmptyNotNullFieldConfig.java create mode 100644 impl/core/src/test/java/configuration/field/beanvalidation/BeanValidationWithFilledNotNullFieldConfig.java create mode 100644 impl/core/src/test/java/configuration/field/beanvalidation/ConfigurationBeanValidationFieldTest.java create mode 100644 impl/core/src/test/java/configuration/field/beanvalidation/PropertyBeanValidationWithEmptyNotNullFieldConfig.java create mode 100644 impl/core/src/test/java/configuration/field/beanvalidation/PropertyBeanValidationWithFIlledNotNullFieldConfig.java create mode 100644 impl/core/src/test/java/configuration/field/beanvalidation/PropertyWithTwoConstrainViolations.java create mode 100644 impl/core/src/test/java/configuration/field/beanvalidation/XMLBeanValidationWithEmptyNotNullFieldConfig.java create mode 100644 impl/core/src/test/java/configuration/field/beanvalidation/XMLBeanValidationWithFilledNotNullFieldConfig.java create mode 100644 impl/core/src/test/resources/configuration/field/beanvalidation/demoiselle.properties create mode 100644 impl/core/src/test/resources/configuration/field/beanvalidation/demoiselle.xml create mode 100644 impl/core/src/test/resources/configuration/field/beanvalidation/two-constrain-validation.properties diff --git a/impl/core/src/test/java/configuration/field/beanvalidation/BeanValidationWithEmptyNotNullFieldConfig.java b/impl/core/src/test/java/configuration/field/beanvalidation/BeanValidationWithEmptyNotNullFieldConfig.java new file mode 100644 index 0000000..8d66090 --- /dev/null +++ b/impl/core/src/test/java/configuration/field/beanvalidation/BeanValidationWithEmptyNotNullFieldConfig.java @@ -0,0 +1,56 @@ +/* + * Demoiselle Framework + * Copyright (C) 2010 SERPRO + * ---------------------------------------------------------------------------- + * This file is part of Demoiselle Framework. + * + * Demoiselle Framework is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License version 3 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License version 3 + * along with this program; if not, see + * or write to the Free Software Foundation, Inc., 51 Franklin Street, + * Fifth Floor, Boston, MA 02110-1301, USA. + * ---------------------------------------------------------------------------- + * Este arquivo é parte do Framework Demoiselle. + * + * O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou + * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação + * do Software Livre (FSF). + * + * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA + * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou + * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português + * para maiores detalhes. + * + * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título + * "LICENCA.txt", junto com esse programa. Se não, acesse + * ou escreva para a Fundação do Software Livre (FSF) Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. + */ +package configuration.field.beanvalidation; + +import javax.validation.constraints.NotNull; + +public abstract class BeanValidationWithEmptyNotNullFieldConfig { + + @NotNull + private Integer intAttributeNull; + + @NotNull + private String stringAttributeNull; + + public Integer getIntAttributeNull() { + return intAttributeNull; + } + + public String getStringAttributeNull() { + return stringAttributeNull; + } +} diff --git a/impl/core/src/test/java/configuration/field/beanvalidation/BeanValidationWithFilledNotNullFieldConfig.java b/impl/core/src/test/java/configuration/field/beanvalidation/BeanValidationWithFilledNotNullFieldConfig.java new file mode 100644 index 0000000..05188b0 --- /dev/null +++ b/impl/core/src/test/java/configuration/field/beanvalidation/BeanValidationWithFilledNotNullFieldConfig.java @@ -0,0 +1,20 @@ +package configuration.field.beanvalidation; + +import javax.validation.constraints.NotNull; + +public class BeanValidationWithFilledNotNullFieldConfig { + + @NotNull + private String stringAttributeNotNull; + + @NotNull + private Integer intAttibuteNotNull; + + public String getStringAttributeNotNull() { + return stringAttributeNotNull; + } + + public Integer getIntAttibuteNotNull() { + return intAttibuteNotNull; + } +} diff --git a/impl/core/src/test/java/configuration/field/beanvalidation/ConfigurationBeanValidationFieldTest.java b/impl/core/src/test/java/configuration/field/beanvalidation/ConfigurationBeanValidationFieldTest.java new file mode 100644 index 0000000..4bc2826 --- /dev/null +++ b/impl/core/src/test/java/configuration/field/beanvalidation/ConfigurationBeanValidationFieldTest.java @@ -0,0 +1,147 @@ +/* + * Demoiselle Framework + * Copyright (C) 2010 SERPRO + * ---------------------------------------------------------------------------- + * This file is part of Demoiselle Framework. + * + * Demoiselle Framework is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License version 3 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License version 3 + * along with this program; if not, see + * or write to the Free Software Foundation, Inc., 51 Franklin Street, + * Fifth Floor, Boston, MA 02110-1301, USA. + * ---------------------------------------------------------------------------- + * Este arquivo é parte do Framework Demoiselle. + * + * O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou + * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação + * do Software Livre (FSF). + * + * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA + * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou + * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português + * para maiores detalhes. + * + * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título + * "LICENCA.txt", junto com esse programa. Se não, acesse + * ou escreva para a Fundação do Software Livre (FSF) Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. + */ +package configuration.field.beanvalidation; + +import static junit.framework.Assert.assertEquals; +import static junit.framework.Assert.fail; + +import javax.inject.Inject; +import javax.validation.ConstraintViolationException; + +import junit.framework.Assert; + +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.Test; +import org.junit.runner.RunWith; + +import test.Tests; + +import br.gov.frameworkdemoiselle.configuration.ConfigurationException; + +@RunWith(Arquillian.class) +public class ConfigurationBeanValidationFieldTest { + + private static final String PATH = "src/test/resources/configuration/field/beanvalidation"; + + @Inject + private PropertyBeanValidationWithFIlledNotNullFieldConfig propertyBeanValidationWithFIlledNotNullFieldConfig; + + @Inject + private XMLBeanValidationWithFilledNotNullFieldConfig xmlBeanValidationWithFilledNotNullFieldConfig; + + @Inject + private PropertyBeanValidationWithEmptyNotNullFieldConfig propertyBeanValidationWithEmptyNotNullFieldConfig; + + @Inject + private XMLBeanValidationWithEmptyNotNullFieldConfig xmlBeanValidationWithEmptyNotNullFieldConfig; + + @Inject + private PropertyWithTwoConstrainViolations propertyWithTwoConstrainViolations; + + @Deployment + public static JavaArchive createDeployment() { + + JavaArchive deployment = Tests.createDeployment(ConfigurationBeanValidationFieldTest.class); + deployment.addAsResource(Tests.createFileAsset(PATH + "/demoiselle.properties"), "demoiselle.properties"); + deployment.addAsResource(Tests.createFileAsset(PATH + "/demoiselle.xml"), "demoiselle.xml"); + deployment.addAsResource(Tests.createFileAsset(PATH + "/two-constrain-validation.properties"), "two-constrain-validation.properties"); + + return deployment; + } + + @Test + public void loadIntegerNotNullFieldFromFilledFile() { + Integer expectedInt = 1; + + assertEquals(expectedInt, propertyBeanValidationWithFIlledNotNullFieldConfig.getIntAttibuteNotNull()); + assertEquals(expectedInt, xmlBeanValidationWithFilledNotNullFieldConfig.getIntAttibuteNotNull()); + } + + @Test + public void loadStringNotNullFieldFromFilledFile() { + String expectedString = "Not null!"; + + assertEquals(expectedString, propertyBeanValidationWithFIlledNotNullFieldConfig.getStringAttributeNotNull()); + assertEquals(expectedString, xmlBeanValidationWithFilledNotNullFieldConfig.getStringAttributeNotNull()); + } + + @Test + public void loadIntNotNullFieldFromNotFilledFile() { + try { + propertyBeanValidationWithEmptyNotNullFieldConfig.getIntAttributeNull(); + fail(); + } catch (ConfigurationException cause) { + Assert.assertEquals(ConstraintViolationException.class, cause.getCause().getClass()); + } + + try { + xmlBeanValidationWithEmptyNotNullFieldConfig.getIntAttributeNull(); + fail(); + } catch (ConfigurationException cause) { + Assert.assertEquals(ConstraintViolationException.class, cause.getCause().getClass()); + } + } + + @Test + public void loadStringNotNullFieldFromNotFilledFile() { + try { + propertyBeanValidationWithEmptyNotNullFieldConfig.getStringAttributeNull(); + fail(); + } catch (ConfigurationException cause) { + Assert.assertEquals(ConstraintViolationException.class, cause.getCause().getClass()); + } + + try { + xmlBeanValidationWithEmptyNotNullFieldConfig.getStringAttributeNull(); + fail(); + } catch (ConfigurationException cause) { + Assert.assertEquals(ConstraintViolationException.class, cause.getCause().getClass()); + } + } + + @Test + public void loadPropertiesWithTwoConstraintViolations(){ + try { + propertyWithTwoConstrainViolations.getAttributeWithTwoConstrainValidations(); + fail(); + } catch (ConfigurationException cause) { + Assert.assertEquals(ConstraintViolationException.class, cause.getCause().getClass()); + } + } +} diff --git a/impl/core/src/test/java/configuration/field/beanvalidation/PropertyBeanValidationWithEmptyNotNullFieldConfig.java b/impl/core/src/test/java/configuration/field/beanvalidation/PropertyBeanValidationWithEmptyNotNullFieldConfig.java new file mode 100644 index 0000000..5df760b --- /dev/null +++ b/impl/core/src/test/java/configuration/field/beanvalidation/PropertyBeanValidationWithEmptyNotNullFieldConfig.java @@ -0,0 +1,44 @@ +/* + * Demoiselle Framework + * Copyright (C) 2010 SERPRO + * ---------------------------------------------------------------------------- + * This file is part of Demoiselle Framework. + * + * Demoiselle Framework is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License version 3 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License version 3 + * along with this program; if not, see + * or write to the Free Software Foundation, Inc., 51 Franklin Street, + * Fifth Floor, Boston, MA 02110-1301, USA. + * ---------------------------------------------------------------------------- + * Este arquivo é parte do Framework Demoiselle. + * + * O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou + * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação + * do Software Livre (FSF). + * + * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA + * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou + * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português + * para maiores detalhes. + * + * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título + * "LICENCA.txt", junto com esse programa. Se não, acesse + * ou escreva para a Fundação do Software Livre (FSF) Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. + */ +package configuration.field.beanvalidation; + +import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES; +import br.gov.frameworkdemoiselle.configuration.Configuration; + +@Configuration(resource = "demoiselle", type = PROPERTIES) +public class PropertyBeanValidationWithEmptyNotNullFieldConfig extends BeanValidationWithEmptyNotNullFieldConfig { +} diff --git a/impl/core/src/test/java/configuration/field/beanvalidation/PropertyBeanValidationWithFIlledNotNullFieldConfig.java b/impl/core/src/test/java/configuration/field/beanvalidation/PropertyBeanValidationWithFIlledNotNullFieldConfig.java new file mode 100644 index 0000000..4e90980 --- /dev/null +++ b/impl/core/src/test/java/configuration/field/beanvalidation/PropertyBeanValidationWithFIlledNotNullFieldConfig.java @@ -0,0 +1,44 @@ +/* + * Demoiselle Framework + * Copyright (C) 2010 SERPRO + * ---------------------------------------------------------------------------- + * This file is part of Demoiselle Framework. + * + * Demoiselle Framework is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License version 3 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License version 3 + * along with this program; if not, see + * or write to the Free Software Foundation, Inc., 51 Franklin Street, + * Fifth Floor, Boston, MA 02110-1301, USA. + * ---------------------------------------------------------------------------- + * Este arquivo é parte do Framework Demoiselle. + * + * O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou + * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação + * do Software Livre (FSF). + * + * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA + * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou + * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português + * para maiores detalhes. + * + * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título + * "LICENCA.txt", junto com esse programa. Se não, acesse + * ou escreva para a Fundação do Software Livre (FSF) Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. + */ +package configuration.field.beanvalidation; + +import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES; +import br.gov.frameworkdemoiselle.configuration.Configuration; + +@Configuration(resource = "demoiselle", type = PROPERTIES) +public class PropertyBeanValidationWithFIlledNotNullFieldConfig extends BeanValidationWithFilledNotNullFieldConfig { +} diff --git a/impl/core/src/test/java/configuration/field/beanvalidation/PropertyWithTwoConstrainViolations.java b/impl/core/src/test/java/configuration/field/beanvalidation/PropertyWithTwoConstrainViolations.java new file mode 100644 index 0000000..7b72c81 --- /dev/null +++ b/impl/core/src/test/java/configuration/field/beanvalidation/PropertyWithTwoConstrainViolations.java @@ -0,0 +1,20 @@ +package configuration.field.beanvalidation; + +import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES; + +import javax.validation.constraints.Max; +import javax.validation.constraints.Min; + +import br.gov.frameworkdemoiselle.configuration.Configuration; + +@Configuration(resource = "two-constrain-validation", type = PROPERTIES) +public class PropertyWithTwoConstrainViolations { + + @Max(10) + @Min(50) + private int attributeViolateTwoConstraints; + + public int getAttributeWithTwoConstrainValidations() { + return attributeViolateTwoConstraints; + } +} diff --git a/impl/core/src/test/java/configuration/field/beanvalidation/XMLBeanValidationWithEmptyNotNullFieldConfig.java b/impl/core/src/test/java/configuration/field/beanvalidation/XMLBeanValidationWithEmptyNotNullFieldConfig.java new file mode 100644 index 0000000..71736d6 --- /dev/null +++ b/impl/core/src/test/java/configuration/field/beanvalidation/XMLBeanValidationWithEmptyNotNullFieldConfig.java @@ -0,0 +1,44 @@ +/* + * Demoiselle Framework + * Copyright (C) 2010 SERPRO + * ---------------------------------------------------------------------------- + * This file is part of Demoiselle Framework. + * + * Demoiselle Framework is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License version 3 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License version 3 + * along with this program; if not, see + * or write to the Free Software Foundation, Inc., 51 Franklin Street, + * Fifth Floor, Boston, MA 02110-1301, USA. + * ---------------------------------------------------------------------------- + * Este arquivo é parte do Framework Demoiselle. + * + * O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou + * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação + * do Software Livre (FSF). + * + * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA + * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou + * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português + * para maiores detalhes. + * + * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título + * "LICENCA.txt", junto com esse programa. Se não, acesse + * ou escreva para a Fundação do Software Livre (FSF) Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. + */ +package configuration.field.beanvalidation; + +import static br.gov.frameworkdemoiselle.configuration.ConfigType.XML; +import br.gov.frameworkdemoiselle.configuration.Configuration; + +@Configuration(resource = "demoiselle", type = XML) +public class XMLBeanValidationWithEmptyNotNullFieldConfig extends BeanValidationWithEmptyNotNullFieldConfig { +} diff --git a/impl/core/src/test/java/configuration/field/beanvalidation/XMLBeanValidationWithFilledNotNullFieldConfig.java b/impl/core/src/test/java/configuration/field/beanvalidation/XMLBeanValidationWithFilledNotNullFieldConfig.java new file mode 100644 index 0000000..a2c68c5 --- /dev/null +++ b/impl/core/src/test/java/configuration/field/beanvalidation/XMLBeanValidationWithFilledNotNullFieldConfig.java @@ -0,0 +1,44 @@ +/* + * Demoiselle Framework + * Copyright (C) 2010 SERPRO + * ---------------------------------------------------------------------------- + * This file is part of Demoiselle Framework. + * + * Demoiselle Framework is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License version 3 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License version 3 + * along with this program; if not, see + * or write to the Free Software Foundation, Inc., 51 Franklin Street, + * Fifth Floor, Boston, MA 02110-1301, USA. + * ---------------------------------------------------------------------------- + * Este arquivo é parte do Framework Demoiselle. + * + * O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou + * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação + * do Software Livre (FSF). + * + * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA + * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou + * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português + * para maiores detalhes. + * + * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título + * "LICENCA.txt", junto com esse programa. Se não, acesse + * ou escreva para a Fundação do Software Livre (FSF) Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. + */ +package configuration.field.beanvalidation; + +import static br.gov.frameworkdemoiselle.configuration.ConfigType.XML; +import br.gov.frameworkdemoiselle.configuration.Configuration; + +@Configuration(resource = "demoiselle", type = XML) +public class XMLBeanValidationWithFilledNotNullFieldConfig extends BeanValidationWithFilledNotNullFieldConfig { +} diff --git a/impl/core/src/test/resources/configuration/field/beanvalidation/demoiselle.properties b/impl/core/src/test/resources/configuration/field/beanvalidation/demoiselle.properties new file mode 100644 index 0000000..7127f46 --- /dev/null +++ b/impl/core/src/test/resources/configuration/field/beanvalidation/demoiselle.properties @@ -0,0 +1,38 @@ +# Demoiselle Framework +# Copyright (C) 2010 SERPRO +# ---------------------------------------------------------------------------- +# This file is part of Demoiselle Framework. +# +# Demoiselle Framework is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public License version 3 +# as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License version 3 +# along with this program; if not, see +# or write to the Free Software Foundation, Inc., 51 Franklin Street, +# Fifth Floor, Boston, MA 02110-1301, USA. +# ---------------------------------------------------------------------------- +# Este arquivo é parte do Framework Demoiselle. +# +# O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou +# modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação +# do Software Livre (FSF). +# +# Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA +# GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou +# APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português +# para maiores detalhes. +# +# Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título +# "LICENCA.txt", junto com esse programa. Se não, acesse +# ou escreva para a Fundação do Software Livre (FSF) Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. + +intAttibuteNotNull=1 +stringAttributeNotNull=Not null! +attributeViolateTwoConstraints=30 diff --git a/impl/core/src/test/resources/configuration/field/beanvalidation/demoiselle.xml b/impl/core/src/test/resources/configuration/field/beanvalidation/demoiselle.xml new file mode 100644 index 0000000..a12f736 --- /dev/null +++ b/impl/core/src/test/resources/configuration/field/beanvalidation/demoiselle.xml @@ -0,0 +1,42 @@ + + + + 1 + Not null! + 30 + diff --git a/impl/core/src/test/resources/configuration/field/beanvalidation/two-constrain-validation.properties b/impl/core/src/test/resources/configuration/field/beanvalidation/two-constrain-validation.properties new file mode 100644 index 0000000..1b00ded --- /dev/null +++ b/impl/core/src/test/resources/configuration/field/beanvalidation/two-constrain-validation.properties @@ -0,0 +1,36 @@ +# Demoiselle Framework +# Copyright (C) 2010 SERPRO +# ---------------------------------------------------------------------------- +# This file is part of Demoiselle Framework. +# +# Demoiselle Framework is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public License version 3 +# as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License version 3 +# along with this program; if not, see +# or write to the Free Software Foundation, Inc., 51 Franklin Street, +# Fifth Floor, Boston, MA 02110-1301, USA. +# ---------------------------------------------------------------------------- +# Este arquivo é parte do Framework Demoiselle. +# +# O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou +# modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação +# do Software Livre (FSF). +# +# Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA +# GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou +# APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português +# para maiores detalhes. +# +# Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título +# "LICENCA.txt", junto com esse programa. Se não, acesse +# ou escreva para a Fundação do Software Livre (FSF) Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. + +attributeViolateTwoConstraints=30 -- libgit2 0.21.2