Commit be55bc1bd91c539ffc028101d84fc894303f7689
1 parent
6c90896b
Exists in
master
Reorganizando as classes de teste
Showing
17 changed files
with
157 additions
and
151 deletions
Show diff stats
impl/core/src/test/java/configuration/AbstractConfigurationTest.java
| @@ -1,56 +0,0 @@ | @@ -1,56 +0,0 @@ | ||
| 1 | -/* | ||
| 2 | - * Demoiselle Framework | ||
| 3 | - * Copyright (C) 2010 SERPRO | ||
| 4 | - * ---------------------------------------------------------------------------- | ||
| 5 | - * This file is part of Demoiselle Framework. | ||
| 6 | - * | ||
| 7 | - * Demoiselle Framework is free software; you can redistribute it and/or | ||
| 8 | - * modify it under the terms of the GNU Lesser General Public License version 3 | ||
| 9 | - * as published by the Free Software Foundation. | ||
| 10 | - * | ||
| 11 | - * This program is distributed in the hope that it will be useful, | ||
| 12 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | - * GNU General Public License for more details. | ||
| 15 | - * | ||
| 16 | - * You should have received a copy of the GNU Lesser General Public License version 3 | ||
| 17 | - * along with this program; if not, see <http://www.gnu.org/licenses/> | ||
| 18 | - * or write to the Free Software Foundation, Inc., 51 Franklin Street, | ||
| 19 | - * Fifth Floor, Boston, MA 02110-1301, USA. | ||
| 20 | - * ---------------------------------------------------------------------------- | ||
| 21 | - * Este arquivo é parte do Framework Demoiselle. | ||
| 22 | - * | ||
| 23 | - * O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou | ||
| 24 | - * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação | ||
| 25 | - * do Software Livre (FSF). | ||
| 26 | - * | ||
| 27 | - * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA | ||
| 28 | - * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou | ||
| 29 | - * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português | ||
| 30 | - * para maiores detalhes. | ||
| 31 | - * | ||
| 32 | - * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título | ||
| 33 | - * "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses/> | ||
| 34 | - * ou escreva para a Fundação do Software Livre (FSF) Inc., | ||
| 35 | - * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. | ||
| 36 | - */ | ||
| 37 | -package configuration; | ||
| 38 | - | ||
| 39 | -import java.io.File; | ||
| 40 | - | ||
| 41 | -import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
| 42 | -import org.jboss.shrinkwrap.api.asset.EmptyAsset; | ||
| 43 | -import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
| 44 | - | ||
| 45 | -public abstract class AbstractConfigurationTest { | ||
| 46 | - | ||
| 47 | - public static JavaArchive createConfigurationDeployment() { | ||
| 48 | - return ShrinkWrap | ||
| 49 | - .create(JavaArchive.class) | ||
| 50 | - .addPackages(true, "br") | ||
| 51 | - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml") | ||
| 52 | - .addAsManifestResource( | ||
| 53 | - new File("src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension"), | ||
| 54 | - "services/javax.enterprise.inject.spi.Extension"); | ||
| 55 | - } | ||
| 56 | -} |
impl/core/src/test/java/configuration/ConfigurationTests.java
0 → 100644
| @@ -0,0 +1,59 @@ | @@ -0,0 +1,59 @@ | ||
| 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; | ||
| 38 | + | ||
| 39 | +import java.io.File; | ||
| 40 | + | ||
| 41 | +import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
| 42 | +import org.jboss.shrinkwrap.api.asset.EmptyAsset; | ||
| 43 | +import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
| 44 | + | ||
| 45 | +public final class ConfigurationTests { | ||
| 46 | + | ||
| 47 | + private ConfigurationTests() { | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + public static JavaArchive createDeployment() { | ||
| 51 | + return ShrinkWrap | ||
| 52 | + .create(JavaArchive.class) | ||
| 53 | + .addPackages(true, "br") | ||
| 54 | + .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml") | ||
| 55 | + .addAsManifestResource( | ||
| 56 | + new File("src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension"), | ||
| 57 | + "services/javax.enterprise.inject.spi.Extension"); | ||
| 58 | + } | ||
| 59 | +} |
impl/core/src/test/java/configuration/defaultvalue/ConfigurationDefaultValueTest.java
| @@ -49,10 +49,10 @@ import org.jboss.shrinkwrap.api.spec.JavaArchive; | @@ -49,10 +49,10 @@ import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
| 49 | import org.junit.Test; | 49 | import org.junit.Test; |
| 50 | import org.junit.runner.RunWith; | 50 | import org.junit.runner.RunWith; |
| 51 | 51 | ||
| 52 | -import configuration.AbstractConfigurationTest; | 52 | +import configuration.ConfigurationTests; |
| 53 | 53 | ||
| 54 | @RunWith(Arquillian.class) | 54 | @RunWith(Arquillian.class) |
| 55 | -public class ConfigurationDefaultValueTest extends AbstractConfigurationTest { | 55 | +public class ConfigurationDefaultValueTest { |
| 56 | 56 | ||
| 57 | @Inject | 57 | @Inject |
| 58 | private FilledDefaultValueConfig filledFieldConfig; | 58 | private FilledDefaultValueConfig filledFieldConfig; |
| @@ -65,7 +65,7 @@ public class ConfigurationDefaultValueTest extends AbstractConfigurationTest { | @@ -65,7 +65,7 @@ public class ConfigurationDefaultValueTest extends AbstractConfigurationTest { | ||
| 65 | 65 | ||
| 66 | @Deployment | 66 | @Deployment |
| 67 | public static JavaArchive createDeployment() { | 67 | public static JavaArchive createDeployment() { |
| 68 | - JavaArchive deployment = createConfigurationDeployment(); | 68 | + JavaArchive deployment = ConfigurationTests.createDeployment(); |
| 69 | 69 | ||
| 70 | deployment.addPackages(true, ConfigurationDefaultValueTest.class.getPackage()); | 70 | deployment.addPackages(true, ConfigurationDefaultValueTest.class.getPackage()); |
| 71 | deployment.addAsResource( | 71 | deployment.addAsResource( |
impl/core/src/test/java/configuration/field/array/ConfigurationArrayFieldTest.java
| @@ -54,10 +54,10 @@ import org.junit.Test; | @@ -54,10 +54,10 @@ import org.junit.Test; | ||
| 54 | import org.junit.runner.RunWith; | 54 | import org.junit.runner.RunWith; |
| 55 | 55 | ||
| 56 | import br.gov.frameworkdemoiselle.configuration.ConfigurationException; | 56 | import br.gov.frameworkdemoiselle.configuration.ConfigurationException; |
| 57 | -import configuration.AbstractConfigurationTest; | 57 | +import configuration.ConfigurationTests; |
| 58 | 58 | ||
| 59 | @RunWith(Arquillian.class) | 59 | @RunWith(Arquillian.class) |
| 60 | -public class ConfigurationArrayFieldTest extends AbstractConfigurationTest { | 60 | +public class ConfigurationArrayFieldTest { |
| 61 | 61 | ||
| 62 | @Inject | 62 | @Inject |
| 63 | private PropertiesArrayFieldConfig propertiesConfig; | 63 | private PropertiesArrayFieldConfig propertiesConfig; |
| @@ -70,7 +70,7 @@ public class ConfigurationArrayFieldTest extends AbstractConfigurationTest { | @@ -70,7 +70,7 @@ public class ConfigurationArrayFieldTest extends AbstractConfigurationTest { | ||
| 70 | 70 | ||
| 71 | @Deployment | 71 | @Deployment |
| 72 | public static JavaArchive createDeployment() { | 72 | public static JavaArchive createDeployment() { |
| 73 | - JavaArchive deployment = createConfigurationDeployment(); | 73 | + JavaArchive deployment = ConfigurationTests.createDeployment(); |
| 74 | 74 | ||
| 75 | deployment.addPackages(true, ConfigurationArrayFieldTest.class.getPackage()); | 75 | deployment.addPackages(true, ConfigurationArrayFieldTest.class.getPackage()); |
| 76 | deployment.addAsResource( | 76 | deployment.addAsResource( |
impl/core/src/test/java/configuration/field/clazz/ConfigurationClassFieldTest.java
| @@ -51,10 +51,10 @@ import org.junit.Test; | @@ -51,10 +51,10 @@ import org.junit.Test; | ||
| 51 | import org.junit.runner.RunWith; | 51 | import org.junit.runner.RunWith; |
| 52 | 52 | ||
| 53 | import br.gov.frameworkdemoiselle.configuration.ConfigurationException; | 53 | import br.gov.frameworkdemoiselle.configuration.ConfigurationException; |
| 54 | -import configuration.AbstractConfigurationTest; | 54 | +import configuration.ConfigurationTests; |
| 55 | 55 | ||
| 56 | @RunWith(Arquillian.class) | 56 | @RunWith(Arquillian.class) |
| 57 | -public class ConfigurationClassFieldTest extends AbstractConfigurationTest { | 57 | +public class ConfigurationClassFieldTest { |
| 58 | 58 | ||
| 59 | @Inject | 59 | @Inject |
| 60 | private PropertiesExistentClassFieldConfig propertiesExistentConfig; | 60 | private PropertiesExistentClassFieldConfig propertiesExistentConfig; |
| @@ -67,7 +67,7 @@ public class ConfigurationClassFieldTest extends AbstractConfigurationTest { | @@ -67,7 +67,7 @@ public class ConfigurationClassFieldTest extends AbstractConfigurationTest { | ||
| 67 | 67 | ||
| 68 | @Deployment | 68 | @Deployment |
| 69 | public static JavaArchive createDeployment() { | 69 | public static JavaArchive createDeployment() { |
| 70 | - JavaArchive deployment = createConfigurationDeployment(); | 70 | + JavaArchive deployment = ConfigurationTests.createDeployment(); |
| 71 | 71 | ||
| 72 | deployment.addPackages(true, ConfigurationClassFieldTest.class.getPackage()); | 72 | deployment.addPackages(true, ConfigurationClassFieldTest.class.getPackage()); |
| 73 | deployment.addAsResource(new FileAsset(new File( | 73 | deployment.addAsResource(new FileAsset(new File( |
impl/core/src/test/java/configuration/field/custom/ConfigurationCustomFieldTest.java
| @@ -52,10 +52,10 @@ import org.junit.Test; | @@ -52,10 +52,10 @@ import org.junit.Test; | ||
| 52 | import org.junit.runner.RunWith; | 52 | import org.junit.runner.RunWith; |
| 53 | 53 | ||
| 54 | import br.gov.frameworkdemoiselle.configuration.ConfigurationException; | 54 | import br.gov.frameworkdemoiselle.configuration.ConfigurationException; |
| 55 | -import configuration.AbstractConfigurationTest; | 55 | +import configuration.ConfigurationTests; |
| 56 | 56 | ||
| 57 | @RunWith(Arquillian.class) | 57 | @RunWith(Arquillian.class) |
| 58 | -public class ConfigurationCustomFieldTest extends AbstractConfigurationTest { | 58 | +public class ConfigurationCustomFieldTest { |
| 59 | 59 | ||
| 60 | @Inject | 60 | @Inject |
| 61 | private CustomMappedFieldConfig mappedField; | 61 | private CustomMappedFieldConfig mappedField; |
| @@ -65,7 +65,7 @@ public class ConfigurationCustomFieldTest extends AbstractConfigurationTest { | @@ -65,7 +65,7 @@ public class ConfigurationCustomFieldTest extends AbstractConfigurationTest { | ||
| 65 | 65 | ||
| 66 | @Deployment | 66 | @Deployment |
| 67 | public static JavaArchive createDeployment() { | 67 | public static JavaArchive createDeployment() { |
| 68 | - JavaArchive deployment = createConfigurationDeployment(); | 68 | + JavaArchive deployment = ConfigurationTests.createDeployment(); |
| 69 | 69 | ||
| 70 | deployment.addPackages(true, ConfigurationCustomFieldTest.class.getPackage()); | 70 | deployment.addPackages(true, ConfigurationCustomFieldTest.class.getPackage()); |
| 71 | deployment.addAsResource(new FileAsset(new File( | 71 | deployment.addAsResource(new FileAsset(new File( |
impl/core/src/test/java/configuration/field/ignored/ConfigurationIgnoredFieldTest.java
| @@ -49,10 +49,10 @@ import org.jboss.shrinkwrap.api.spec.JavaArchive; | @@ -49,10 +49,10 @@ import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
| 49 | import org.junit.Test; | 49 | import org.junit.Test; |
| 50 | import org.junit.runner.RunWith; | 50 | import org.junit.runner.RunWith; |
| 51 | 51 | ||
| 52 | -import configuration.AbstractConfigurationTest; | 52 | +import configuration.ConfigurationTests; |
| 53 | 53 | ||
| 54 | @RunWith(Arquillian.class) | 54 | @RunWith(Arquillian.class) |
| 55 | -public class ConfigurationIgnoredFieldTest extends AbstractConfigurationTest { | 55 | +public class ConfigurationIgnoredFieldTest { |
| 56 | 56 | ||
| 57 | @Inject | 57 | @Inject |
| 58 | private FilledIgnoredFieldConfig filledFieldConfig; | 58 | private FilledIgnoredFieldConfig filledFieldConfig; |
| @@ -65,7 +65,7 @@ public class ConfigurationIgnoredFieldTest extends AbstractConfigurationTest { | @@ -65,7 +65,7 @@ public class ConfigurationIgnoredFieldTest extends AbstractConfigurationTest { | ||
| 65 | 65 | ||
| 66 | @Deployment | 66 | @Deployment |
| 67 | public static JavaArchive createDeployment() { | 67 | public static JavaArchive createDeployment() { |
| 68 | - JavaArchive deployment = createConfigurationDeployment(); | 68 | + JavaArchive deployment = ConfigurationTests.createDeployment(); |
| 69 | 69 | ||
| 70 | deployment.addPackages(true, "br"); | 70 | deployment.addPackages(true, "br"); |
| 71 | deployment.addPackages(true, ConfigurationIgnoredFieldTest.class.getPackage()); | 71 | deployment.addPackages(true, ConfigurationIgnoredFieldTest.class.getPackage()); |
impl/core/src/test/java/configuration/field/map/ConfigurationMapFieldTest.java
| @@ -51,10 +51,10 @@ import org.jboss.shrinkwrap.api.spec.JavaArchive; | @@ -51,10 +51,10 @@ import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
| 51 | import org.junit.Test; | 51 | import org.junit.Test; |
| 52 | import org.junit.runner.RunWith; | 52 | import org.junit.runner.RunWith; |
| 53 | 53 | ||
| 54 | -import configuration.AbstractConfigurationTest; | 54 | +import configuration.ConfigurationTests; |
| 55 | 55 | ||
| 56 | @RunWith(Arquillian.class) | 56 | @RunWith(Arquillian.class) |
| 57 | -public class ConfigurationMapFieldTest extends AbstractConfigurationTest { | 57 | +public class ConfigurationMapFieldTest { |
| 58 | 58 | ||
| 59 | @Inject | 59 | @Inject |
| 60 | private PropertiesMapFieldConfig propertiesConfig; | 60 | private PropertiesMapFieldConfig propertiesConfig; |
| @@ -64,7 +64,7 @@ public class ConfigurationMapFieldTest extends AbstractConfigurationTest { | @@ -64,7 +64,7 @@ public class ConfigurationMapFieldTest extends AbstractConfigurationTest { | ||
| 64 | 64 | ||
| 65 | @Deployment | 65 | @Deployment |
| 66 | public static JavaArchive createDeployment() { | 66 | public static JavaArchive createDeployment() { |
| 67 | - JavaArchive deployment = createConfigurationDeployment(); | 67 | + JavaArchive deployment = ConfigurationTests.createDeployment(); |
| 68 | 68 | ||
| 69 | deployment.addPackages(true, ConfigurationMapFieldTest.class.getPackage()); | 69 | deployment.addPackages(true, ConfigurationMapFieldTest.class.getPackage()); |
| 70 | deployment.addAsResource( | 70 | deployment.addAsResource( |
impl/core/src/test/java/configuration/field/named/ConfigurationNamedFieldTest.java
| @@ -51,10 +51,10 @@ import org.junit.Test; | @@ -51,10 +51,10 @@ import org.junit.Test; | ||
| 51 | import org.junit.runner.RunWith; | 51 | import org.junit.runner.RunWith; |
| 52 | 52 | ||
| 53 | import br.gov.frameworkdemoiselle.configuration.ConfigurationException; | 53 | import br.gov.frameworkdemoiselle.configuration.ConfigurationException; |
| 54 | -import configuration.AbstractConfigurationTest; | 54 | +import configuration.ConfigurationTests; |
| 55 | 55 | ||
| 56 | @RunWith(Arquillian.class) | 56 | @RunWith(Arquillian.class) |
| 57 | -public class ConfigurationNamedFieldTest extends AbstractConfigurationTest { | 57 | +public class ConfigurationNamedFieldTest { |
| 58 | 58 | ||
| 59 | @Inject | 59 | @Inject |
| 60 | private PropertyNamed propertyNamed; | 60 | private PropertyNamed propertyNamed; |
| @@ -70,7 +70,7 @@ public class ConfigurationNamedFieldTest extends AbstractConfigurationTest { | @@ -70,7 +70,7 @@ public class ConfigurationNamedFieldTest extends AbstractConfigurationTest { | ||
| 70 | 70 | ||
| 71 | @Deployment | 71 | @Deployment |
| 72 | public static JavaArchive createDeployment() { | 72 | public static JavaArchive createDeployment() { |
| 73 | - JavaArchive deployment = createConfigurationDeployment(); | 73 | + JavaArchive deployment = ConfigurationTests.createDeployment(); |
| 74 | 74 | ||
| 75 | deployment.addPackages(true, ConfigurationNamedFieldTest.class.getPackage()); | 75 | deployment.addPackages(true, ConfigurationNamedFieldTest.class.getPackage()); |
| 76 | deployment.addAsResource( | 76 | deployment.addAsResource( |
impl/core/src/test/java/configuration/field/notnull/ConfigurationNotNullFieldTest.java
| @@ -53,10 +53,10 @@ import org.junit.Test; | @@ -53,10 +53,10 @@ import org.junit.Test; | ||
| 53 | import org.junit.runner.RunWith; | 53 | import org.junit.runner.RunWith; |
| 54 | 54 | ||
| 55 | import br.gov.frameworkdemoiselle.configuration.ConfigurationException; | 55 | import br.gov.frameworkdemoiselle.configuration.ConfigurationException; |
| 56 | -import configuration.AbstractConfigurationTest; | 56 | +import configuration.ConfigurationTests; |
| 57 | 57 | ||
| 58 | @RunWith(Arquillian.class) | 58 | @RunWith(Arquillian.class) |
| 59 | -public class ConfigurationNotNullFieldTest extends AbstractConfigurationTest { | 59 | +public class ConfigurationNotNullFieldTest { |
| 60 | 60 | ||
| 61 | @Inject | 61 | @Inject |
| 62 | private PropertyWithFilledFieldConfig propertyFilledFieldConfig; | 62 | private PropertyWithFilledFieldConfig propertyFilledFieldConfig; |
| @@ -84,7 +84,7 @@ public class ConfigurationNotNullFieldTest extends AbstractConfigurationTest { | @@ -84,7 +84,7 @@ public class ConfigurationNotNullFieldTest extends AbstractConfigurationTest { | ||
| 84 | 84 | ||
| 85 | @Deployment | 85 | @Deployment |
| 86 | public static JavaArchive createDeployment() { | 86 | public static JavaArchive createDeployment() { |
| 87 | - JavaArchive deployment = createConfigurationDeployment(); | 87 | + JavaArchive deployment = ConfigurationTests.createDeployment(); |
| 88 | 88 | ||
| 89 | deployment.addPackages(true, ConfigurationNotNullFieldTest.class.getPackage()); | 89 | deployment.addPackages(true, ConfigurationNotNullFieldTest.class.getPackage()); |
| 90 | deployment | 90 | deployment |
impl/core/src/test/java/configuration/field/primitiveorwrapper/ConfigurationPrimitiveOrWrapperFieldTest.java
| @@ -53,10 +53,10 @@ import org.junit.Test; | @@ -53,10 +53,10 @@ import org.junit.Test; | ||
| 53 | import org.junit.runner.RunWith; | 53 | import org.junit.runner.RunWith; |
| 54 | 54 | ||
| 55 | import br.gov.frameworkdemoiselle.configuration.ConfigurationException; | 55 | import br.gov.frameworkdemoiselle.configuration.ConfigurationException; |
| 56 | -import configuration.AbstractConfigurationTest; | 56 | +import configuration.ConfigurationTests; |
| 57 | 57 | ||
| 58 | @RunWith(Arquillian.class) | 58 | @RunWith(Arquillian.class) |
| 59 | -public class ConfigurationPrimitiveOrWrapperFieldTest extends AbstractConfigurationTest { | 59 | +public class ConfigurationPrimitiveOrWrapperFieldTest { |
| 60 | 60 | ||
| 61 | @Inject | 61 | @Inject |
| 62 | private PropertiesPrimitiveOrWrapperFieldConfig propertiesConfig; | 62 | private PropertiesPrimitiveOrWrapperFieldConfig propertiesConfig; |
| @@ -78,7 +78,7 @@ public class ConfigurationPrimitiveOrWrapperFieldTest extends AbstractConfigurat | @@ -78,7 +78,7 @@ public class ConfigurationPrimitiveOrWrapperFieldTest extends AbstractConfigurat | ||
| 78 | 78 | ||
| 79 | @Deployment | 79 | @Deployment |
| 80 | public static JavaArchive createDeployment() { | 80 | public static JavaArchive createDeployment() { |
| 81 | - JavaArchive deployment = createConfigurationDeployment(); | 81 | + JavaArchive deployment = ConfigurationTests.createDeployment(); |
| 82 | 82 | ||
| 83 | deployment.addPackages(true, ConfigurationPrimitiveOrWrapperFieldTest.class.getPackage()); | 83 | deployment.addPackages(true, ConfigurationPrimitiveOrWrapperFieldTest.class.getPackage()); |
| 84 | deployment.addAsResource( | 84 | deployment.addAsResource( |
impl/core/src/test/java/configuration/field/string/ConfigurationStringFieldTest.java
| @@ -50,10 +50,10 @@ import org.junit.BeforeClass; | @@ -50,10 +50,10 @@ import org.junit.BeforeClass; | ||
| 50 | import org.junit.Test; | 50 | import org.junit.Test; |
| 51 | import org.junit.runner.RunWith; | 51 | import org.junit.runner.RunWith; |
| 52 | 52 | ||
| 53 | -import configuration.AbstractConfigurationTest; | 53 | +import configuration.ConfigurationTests; |
| 54 | 54 | ||
| 55 | @RunWith(Arquillian.class) | 55 | @RunWith(Arquillian.class) |
| 56 | -public class ConfigurationStringFieldTest extends AbstractConfigurationTest { | 56 | +public class ConfigurationStringFieldTest { |
| 57 | 57 | ||
| 58 | @Inject | 58 | @Inject |
| 59 | private PropertiesStringFieldConfig propertiesConfig; | 59 | private PropertiesStringFieldConfig propertiesConfig; |
| @@ -66,7 +66,7 @@ public class ConfigurationStringFieldTest extends AbstractConfigurationTest { | @@ -66,7 +66,7 @@ public class ConfigurationStringFieldTest extends AbstractConfigurationTest { | ||
| 66 | 66 | ||
| 67 | @Deployment | 67 | @Deployment |
| 68 | public static JavaArchive createDeployment() { | 68 | public static JavaArchive createDeployment() { |
| 69 | - JavaArchive deployment = createConfigurationDeployment(); | 69 | + JavaArchive deployment = ConfigurationTests.createDeployment(); |
| 70 | 70 | ||
| 71 | deployment.addPackages(true, ConfigurationStringFieldTest.class.getPackage()); | 71 | deployment.addPackages(true, ConfigurationStringFieldTest.class.getPackage()); |
| 72 | deployment.addAsResource( | 72 | deployment.addAsResource( |
impl/core/src/test/java/configuration/prefix/ConfigurationPrefixTest.java
| @@ -50,10 +50,10 @@ import org.jboss.shrinkwrap.api.spec.JavaArchive; | @@ -50,10 +50,10 @@ import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
| 50 | import org.junit.Test; | 50 | import org.junit.Test; |
| 51 | import org.junit.runner.RunWith; | 51 | import org.junit.runner.RunWith; |
| 52 | 52 | ||
| 53 | -import configuration.AbstractConfigurationTest; | 53 | +import configuration.ConfigurationTests; |
| 54 | 54 | ||
| 55 | @RunWith(Arquillian.class) | 55 | @RunWith(Arquillian.class) |
| 56 | -public class ConfigurationPrefixTest extends AbstractConfigurationTest { | 56 | +public class ConfigurationPrefixTest { |
| 57 | 57 | ||
| 58 | @Inject | 58 | @Inject |
| 59 | private PropertyPrefixEndingWithoutDot propertyEndingWithoutDotPrefix; | 59 | private PropertyPrefixEndingWithoutDot propertyEndingWithoutDotPrefix; |
| @@ -75,7 +75,7 @@ public class ConfigurationPrefixTest extends AbstractConfigurationTest { | @@ -75,7 +75,7 @@ public class ConfigurationPrefixTest extends AbstractConfigurationTest { | ||
| 75 | 75 | ||
| 76 | @Deployment | 76 | @Deployment |
| 77 | public static JavaArchive createDeployment() { | 77 | public static JavaArchive createDeployment() { |
| 78 | - JavaArchive deployment = createConfigurationDeployment(); | 78 | + JavaArchive deployment = ConfigurationTests.createDeployment(); |
| 79 | 79 | ||
| 80 | deployment.addPackages(true, ConfigurationPrefixTest.class.getPackage()); | 80 | deployment.addPackages(true, ConfigurationPrefixTest.class.getPackage()); |
| 81 | deployment.addAsResource( | 81 | deployment.addAsResource( |
impl/core/src/test/java/configuration/resource/ConfigurationResourceTest.java
| @@ -49,10 +49,10 @@ import org.jboss.shrinkwrap.api.spec.JavaArchive; | @@ -49,10 +49,10 @@ import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
| 49 | import org.junit.Test; | 49 | import org.junit.Test; |
| 50 | import org.junit.runner.RunWith; | 50 | import org.junit.runner.RunWith; |
| 51 | 51 | ||
| 52 | -import configuration.AbstractConfigurationTest; | 52 | +import configuration.ConfigurationTests; |
| 53 | 53 | ||
| 54 | @RunWith(Arquillian.class) | 54 | @RunWith(Arquillian.class) |
| 55 | -public class ConfigurationResourceTest extends AbstractConfigurationTest { | 55 | +public class ConfigurationResourceTest { |
| 56 | 56 | ||
| 57 | @Inject | 57 | @Inject |
| 58 | private PropertiesDefaultFileConfig propDefault; | 58 | private PropertiesDefaultFileConfig propDefault; |
| @@ -80,7 +80,7 @@ public class ConfigurationResourceTest extends AbstractConfigurationTest { | @@ -80,7 +80,7 @@ public class ConfigurationResourceTest extends AbstractConfigurationTest { | ||
| 80 | 80 | ||
| 81 | @Deployment | 81 | @Deployment |
| 82 | public static JavaArchive createDeployment() { | 82 | public static JavaArchive createDeployment() { |
| 83 | - JavaArchive deployment = createConfigurationDeployment(); | 83 | + JavaArchive deployment = ConfigurationTests.createDeployment(); |
| 84 | 84 | ||
| 85 | deployment.addPackages(true, ConfigurationResourceTest.class.getPackage()); | 85 | deployment.addPackages(true, ConfigurationResourceTest.class.getPackage()); |
| 86 | deployment | 86 | deployment |
impl/core/src/test/java/configuration/scope/ConfigurationScopeTest.java
| @@ -46,14 +46,14 @@ import org.junit.Test; | @@ -46,14 +46,14 @@ import org.junit.Test; | ||
| 46 | import org.junit.runner.RunWith; | 46 | import org.junit.runner.RunWith; |
| 47 | 47 | ||
| 48 | import br.gov.frameworkdemoiselle.util.Beans; | 48 | import br.gov.frameworkdemoiselle.util.Beans; |
| 49 | -import configuration.AbstractConfigurationTest; | 49 | +import configuration.ConfigurationTests; |
| 50 | 50 | ||
| 51 | @RunWith(Arquillian.class) | 51 | @RunWith(Arquillian.class) |
| 52 | -public class ConfigurationScopeTest extends AbstractConfigurationTest { | 52 | +public class ConfigurationScopeTest { |
| 53 | 53 | ||
| 54 | @Deployment | 54 | @Deployment |
| 55 | public static JavaArchive createDeployment() { | 55 | public static JavaArchive createDeployment() { |
| 56 | - JavaArchive deployment = createConfigurationDeployment(); | 56 | + JavaArchive deployment = ConfigurationTests.createDeployment(); |
| 57 | deployment.addPackages(true, ConfigurationScopeTest.class.getPackage()); | 57 | deployment.addPackages(true, ConfigurationScopeTest.class.getPackage()); |
| 58 | return deployment; | 58 | return deployment; |
| 59 | } | 59 | } |
impl/core/src/test/java/security/AbstractSecurityTest.java
| @@ -1,56 +0,0 @@ | @@ -1,56 +0,0 @@ | ||
| 1 | -/* | ||
| 2 | - * Demoiselle Framework | ||
| 3 | - * Copyright (C) 2010 SERPRO | ||
| 4 | - * ---------------------------------------------------------------------------- | ||
| 5 | - * This file is part of Demoiselle Framework. | ||
| 6 | - * | ||
| 7 | - * Demoiselle Framework is free software; you can redistribute it and/or | ||
| 8 | - * modify it under the terms of the GNU Lesser General Public License version 3 | ||
| 9 | - * as published by the Free Software Foundation. | ||
| 10 | - * | ||
| 11 | - * This program is distributed in the hope that it will be useful, | ||
| 12 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | - * GNU General Public License for more details. | ||
| 15 | - * | ||
| 16 | - * You should have received a copy of the GNU Lesser General Public License version 3 | ||
| 17 | - * along with this program; if not, see <http://www.gnu.org/licenses/> | ||
| 18 | - * or write to the Free Software Foundation, Inc., 51 Franklin Street, | ||
| 19 | - * Fifth Floor, Boston, MA 02110-1301, USA. | ||
| 20 | - * ---------------------------------------------------------------------------- | ||
| 21 | - * Este arquivo é parte do Framework Demoiselle. | ||
| 22 | - * | ||
| 23 | - * O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou | ||
| 24 | - * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação | ||
| 25 | - * do Software Livre (FSF). | ||
| 26 | - * | ||
| 27 | - * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA | ||
| 28 | - * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou | ||
| 29 | - * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português | ||
| 30 | - * para maiores detalhes. | ||
| 31 | - * | ||
| 32 | - * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título | ||
| 33 | - * "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses/> | ||
| 34 | - * ou escreva para a Fundação do Software Livre (FSF) Inc., | ||
| 35 | - * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. | ||
| 36 | - */ | ||
| 37 | -package security; | ||
| 38 | - | ||
| 39 | -import java.io.File; | ||
| 40 | - | ||
| 41 | -import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
| 42 | -import org.jboss.shrinkwrap.api.asset.EmptyAsset; | ||
| 43 | -import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
| 44 | - | ||
| 45 | -public abstract class AbstractSecurityTest { | ||
| 46 | - | ||
| 47 | - public static JavaArchive createConfigurationDeployment() { | ||
| 48 | - return ShrinkWrap | ||
| 49 | - .create(JavaArchive.class) | ||
| 50 | - .addPackages(true, "br") | ||
| 51 | - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml") | ||
| 52 | - .addAsManifestResource( | ||
| 53 | - new File("src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension"), | ||
| 54 | - "services/javax.enterprise.inject.spi.Extension"); | ||
| 55 | - } | ||
| 56 | -} |
| @@ -0,0 +1,59 @@ | @@ -0,0 +1,59 @@ | ||
| 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 security; | ||
| 38 | + | ||
| 39 | +import java.io.File; | ||
| 40 | + | ||
| 41 | +import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
| 42 | +import org.jboss.shrinkwrap.api.asset.EmptyAsset; | ||
| 43 | +import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
| 44 | + | ||
| 45 | +public final class SecurityTests { | ||
| 46 | + | ||
| 47 | + private SecurityTests() { | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + public static JavaArchive createConfigurationDeployment() { | ||
| 51 | + return ShrinkWrap | ||
| 52 | + .create(JavaArchive.class) | ||
| 53 | + .addPackages(true, "br") | ||
| 54 | + .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml") | ||
| 55 | + .addAsManifestResource( | ||
| 56 | + new File("src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension"), | ||
| 57 | + "services/javax.enterprise.inject.spi.Extension"); | ||
| 58 | + } | ||
| 59 | +} |