Commit 63481c19b1f3f8cfeb18559ffe3a63361cd3a3b8

Authored by Cleverson Sacramento
1 parent 054ab370
Exists in master

Movendo as classes de teste

Showing 188 changed files with 5181 additions and 5145 deletions   Show diff stats

Too many changes.

To preserve performance only 100 of 188 files displayed.

impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/AbstractConfigurationTest.java
... ... @@ -1,96 +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 br.gov.frameworkdemoiselle.configuration;
38   -
39   -import java.io.File;
40   -import java.util.ArrayList;
41   -import java.util.List;
42   -
43   -import org.jboss.shrinkwrap.api.ShrinkWrap;
44   -import org.jboss.shrinkwrap.api.asset.EmptyAsset;
45   -import org.jboss.shrinkwrap.api.spec.JavaArchive;
46   -
47   -import br.gov.frameworkdemoiselle.annotation.Ignore;
48   -import br.gov.frameworkdemoiselle.annotation.Name;
49   -import br.gov.frameworkdemoiselle.internal.bootstrap.ConfigurationBootstrap;
50   -import br.gov.frameworkdemoiselle.internal.bootstrap.CoreBootstrap;
51   -import br.gov.frameworkdemoiselle.internal.implementation.ConfigurationArrayValueExtractor;
52   -import br.gov.frameworkdemoiselle.internal.implementation.ConfigurationClassValueExtractor;
53   -import br.gov.frameworkdemoiselle.internal.implementation.ConfigurationLoader;
54   -import br.gov.frameworkdemoiselle.internal.implementation.ConfigurationMapValueExtractor;
55   -import br.gov.frameworkdemoiselle.internal.implementation.ConfigurationPrimitiveOrWrapperValueExtractor;
56   -import br.gov.frameworkdemoiselle.internal.implementation.ConfigurationStringValueExtractor;
57   -import br.gov.frameworkdemoiselle.internal.producer.LocaleProducer;
58   -import br.gov.frameworkdemoiselle.internal.producer.LoggerProducer;
59   -import br.gov.frameworkdemoiselle.internal.producer.ResourceBundleProducer;
60   -import br.gov.frameworkdemoiselle.util.Beans;
61   -
62   -public abstract class AbstractConfigurationTest {
63   -
64   - protected static Class<?>[] getConfigurationClasses() {
65   - List<Class<?>> result = new ArrayList<Class<?>>();
66   -
67   - result.add(Ignore.class);
68   - result.add(Name.class);
69   - result.add(Configuration.class);
70   - result.add(CoreBootstrap.class);
71   - result.add(ConfigurationBootstrap.class);
72   - result.add(ConfigurationLoader.class);
73   - result.add(ConfigurationValueExtractor.class);
74   - result.add(ConfigurationArrayValueExtractor.class);
75   - result.add(ConfigurationMapValueExtractor.class);
76   - result.add(ConfigurationClassValueExtractor.class);
77   - result.add(ConfigurationStringValueExtractor.class);
78   - result.add(ConfigurationPrimitiveOrWrapperValueExtractor.class);
79   - result.add(Beans.class);
80   - result.add(ResourceBundleProducer.class);
81   - result.add(LoggerProducer.class);
82   - result.add(LocaleProducer.class);
83   -
84   - return result.toArray(new Class<?>[0]);
85   - }
86   -
87   - public static JavaArchive createConfigurationDeployment() {
88   - return ShrinkWrap
89   - .create(JavaArchive.class)
90   - .addClasses(getConfigurationClasses())
91   - .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
92   - .addAsManifestResource(
93   - new File("src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension"),
94   - "services/javax.enterprise.inject.spi.Extension");
95   - }
96   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/defaultvalue/AbstractDefaultValueConfig.java
... ... @@ -1,60 +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 br.gov.frameworkdemoiselle.configuration.defaultvalue;
38   -
39   -public abstract class AbstractDefaultValueConfig {
40   -
41   - private String stringDefaultWithoutKey = "Initialized value and without key in the property file";
42   -
43   - private String stringDefaultWithKey = "Initialized value and key in the property file";
44   -
45   - public String getStringDefaultWithoutKey() {
46   - return stringDefaultWithoutKey;
47   - }
48   -
49   - public String getStringDefaultWithKey() {
50   - return stringDefaultWithKey;
51   - }
52   -
53   - public void setStringDefaultWithoutKey(String stringDefaultWithoutKey) {
54   - this.stringDefaultWithoutKey = stringDefaultWithoutKey;
55   - }
56   -
57   - public void setStringDefaultWithKey(String stringDefaultWithKey) {
58   - this.stringDefaultWithKey = stringDefaultWithKey;
59   - }
60   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/defaultvalue/ConfigurationDefaultValueTest.java
... ... @@ -1,95 +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 br.gov.frameworkdemoiselle.configuration.defaultvalue;
38   -
39   -import static junit.framework.Assert.assertEquals;
40   -
41   -import java.io.File;
42   -
43   -import javax.inject.Inject;
44   -
45   -import org.jboss.arquillian.container.test.api.Deployment;
46   -import org.jboss.arquillian.junit.Arquillian;
47   -import org.jboss.shrinkwrap.api.asset.FileAsset;
48   -import org.jboss.shrinkwrap.api.spec.JavaArchive;
49   -import org.junit.Test;
50   -import org.junit.runner.RunWith;
51   -
52   -import br.gov.frameworkdemoiselle.configuration.AbstractConfigurationTest;
53   -
54   -@RunWith(Arquillian.class)
55   -public class ConfigurationDefaultValueTest extends AbstractConfigurationTest {
56   -
57   - @Inject
58   - private FilledDefaultValueConfig filledFieldConfig;
59   -
60   - @Inject
61   - private EmptyDefaultValueConfig emptyFieldsConfig;
62   -
63   - @Inject
64   - private PropertyWithInexistenceFileConfig noFileConfig;
65   -
66   - @Deployment
67   - public static JavaArchive createDeployment() {
68   - JavaArchive deployment = createConfigurationDeployment();
69   -
70   - deployment.addPackages(true, ConfigurationDefaultValueTest.class.getPackage());
71   - deployment.addAsResource(
72   - new FileAsset(new File("src/test/resources/configuration/field/default/demoiselle.properties")),
73   - "demoiselle.properties").addAsResource(
74   - new FileAsset(new File("src/test/resources/configuration/field/default/demoiselle.xml")),
75   - "demoiselle.xml");
76   -
77   - return deployment;
78   - }
79   -
80   - @Test
81   - public void loadDefaultValueWithoutKey() {
82   - String expected = "Initialized value and without key in the property file";
83   -
84   - assertEquals(expected, filledFieldConfig.getStringDefaultWithoutKey());
85   - assertEquals(expected, emptyFieldsConfig.getStringDefaultWithoutKey());
86   - assertEquals(expected, noFileConfig.getStringDefaultWithoutKey());
87   - }
88   -
89   - @Test
90   - public void loadDefaultValueWithKey() {
91   - assertEquals("Initialized value of the property file", filledFieldConfig.getStringDefaultWithKey());
92   - assertEquals("Initialized value and key in the property file", noFileConfig.getStringDefaultWithKey());
93   - assertEquals("", emptyFieldsConfig.getStringDefaultWithKey());
94   - }
95   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/defaultvalue/EmptyDefaultValueConfig.java
... ... @@ -1,44 +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 br.gov.frameworkdemoiselle.configuration.defaultvalue;
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 EmptyDefaultValueConfig extends AbstractDefaultValueConfig {
44   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/defaultvalue/FilledDefaultValueConfig.java
... ... @@ -1,44 +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 br.gov.frameworkdemoiselle.configuration.defaultvalue;
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 FilledDefaultValueConfig extends AbstractDefaultValueConfig {
44   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/defaultvalue/PropertyWithInexistenceFileConfig.java
... ... @@ -1,43 +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 br.gov.frameworkdemoiselle.configuration.defaultvalue;
38   -
39   -import br.gov.frameworkdemoiselle.configuration.Configuration;
40   -
41   -@Configuration(resource = "nofile")
42   -public class PropertyWithInexistenceFileConfig extends AbstractDefaultValueConfig {
43   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/array/AbstractArrayEmptyFieldConfig.java
... ... @@ -1,58 +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 br.gov.frameworkdemoiselle.configuration.field.array;
38   -
39   -public abstract class AbstractArrayEmptyFieldConfig {
40   -
41   - private int[] emptyPrimitiveIntegers;
42   -
43   - private Integer[] emptyWrapperIntegers;
44   -
45   - private Integer[] errorTypeWrapperIntegers;
46   -
47   - public Integer[] getEmptyWrapperIntegers() {
48   - return emptyWrapperIntegers;
49   - }
50   -
51   - public int[] getEmptyPrimitiveIntegers() {
52   - return emptyPrimitiveIntegers;
53   - }
54   -
55   - public Integer[] getErrorTypeWrapperIntegers() {
56   - return errorTypeWrapperIntegers;
57   - }
58   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/array/AbstractArrayFieldConfig.java
... ... @@ -1,76 +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 br.gov.frameworkdemoiselle.configuration.field.array;
38   -
39   -public abstract class AbstractArrayFieldConfig {
40   -
41   - private int[] primitiveIntegers;
42   -
43   - private Integer[] wrappedIntegers;
44   -
45   - private String[] strings;
46   -
47   - private double[] primitiveDoubles;
48   -
49   - private Double[] wrappedDoubles;
50   -
51   - private String[] emptyStrings;
52   -
53   - public int[] getPrimitiveIntegers() {
54   - return primitiveIntegers;
55   - }
56   -
57   - public Integer[] getWrappedIntegers() {
58   - return wrappedIntegers;
59   - }
60   -
61   - public String[] getStrings() {
62   - return strings;
63   - }
64   -
65   - public double[] getPrimitiveDoubles() {
66   - return primitiveDoubles;
67   - }
68   -
69   - public Double[] getWrappedDoubles() {
70   - return wrappedDoubles;
71   - }
72   -
73   - public String[] getEmptyStrings() {
74   - return emptyStrings;
75   - }
76   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/array/ConfigurationArrayFieldTest.java
... ... @@ -1,160 +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 br.gov.frameworkdemoiselle.configuration.field.array;
38   -
39   -import static junit.framework.Assert.assertEquals;
40   -import static org.junit.Assert.assertArrayEquals;
41   -
42   -import java.io.File;
43   -
44   -import javax.inject.Inject;
45   -
46   -import junit.framework.Assert;
47   -
48   -import org.apache.commons.configuration.ConversionException;
49   -import org.jboss.arquillian.container.test.api.Deployment;
50   -import org.jboss.arquillian.junit.Arquillian;
51   -import org.jboss.shrinkwrap.api.asset.FileAsset;
52   -import org.jboss.shrinkwrap.api.spec.JavaArchive;
53   -import org.junit.Test;
54   -import org.junit.runner.RunWith;
55   -
56   -import br.gov.frameworkdemoiselle.configuration.AbstractConfigurationTest;
57   -import br.gov.frameworkdemoiselle.configuration.ConfigurationException;
58   -
59   -@RunWith(Arquillian.class)
60   -public class ConfigurationArrayFieldTest extends AbstractConfigurationTest {
61   -
62   - @Inject
63   - private PropertiesArrayFieldConfig propertiesConfig;
64   -
65   - @Inject
66   - private PropertiesArrayEmptyFieldConfig propertiesNullConfig;
67   -
68   - @Inject
69   - private XMLArrayFieldConfig xmlConfig;
70   -
71   - @Deployment
72   - public static JavaArchive createDeployment() {
73   - JavaArchive deployment = createConfigurationDeployment();
74   -
75   - deployment.addPackages(true, ConfigurationArrayFieldTest.class.getPackage());
76   - deployment.addAsResource(
77   - new FileAsset(new File("src/test/resources/configuration/field/array/demoiselle.properties")),
78   - "demoiselle.properties").addAsResource(
79   - new FileAsset(new File("src/test/resources/configuration/field/array/demoiselle.xml")),
80   - "demoiselle.xml");
81   -
82   - return deployment;
83   - }
84   -
85   - @Test
86   - public void loadPrimitiveInteger() {
87   - int[] expected = { 1, 20, 0 };
88   -
89   - assertArrayEquals(expected, propertiesConfig.getPrimitiveIntegers());
90   - assertArrayEquals(expected, xmlConfig.getPrimitiveIntegers());
91   - }
92   -
93   - @Test
94   - public void loadWrappedIntegers() {
95   - Integer[] expected = { -99, 0, 1 };
96   -
97   - assertArrayEquals(expected, propertiesConfig.getWrappedIntegers());
98   - assertArrayEquals(expected, xmlConfig.getWrappedIntegers());
99   - }
100   -
101   - @Test
102   - public void loadString() {
103   - String[] expected = { "demoisele", "demoiselle framework", "demoiselle,framework", "demoiselle, framework" };
104   -
105   - assertArrayEquals(expected, propertiesConfig.getStrings());
106   - assertArrayEquals(expected, xmlConfig.getStrings());
107   - }
108   -
109   - @Test
110   - public void loadPrimitiveDoubles() {
111   - double[] expected = { -10, 200000.99999, 0 };
112   -
113   - assertArrayEquals(expected, propertiesConfig.getPrimitiveDoubles(), 0);
114   - assertArrayEquals(expected, xmlConfig.getPrimitiveDoubles(), 0);
115   - }
116   -
117   - @Test
118   - public void loadWrappedDoubles() {
119   - Double[] expected = { -456.123456789, 0.0, 52.2 };
120   -
121   - assertArrayEquals(expected, propertiesConfig.getWrappedDoubles());
122   - assertArrayEquals(expected, xmlConfig.getWrappedDoubles());
123   - }
124   -
125   - @Test
126   - public void loadEmptyString() {
127   - String[] expected = { "demoisele", "" };
128   - assertArrayEquals(expected, propertiesConfig.getEmptyStrings());
129   - }
130   -
131   - @Test
132   - public void loadEmptyPrimitive() {
133   - try {
134   - propertiesNullConfig.getEmptyPrimitiveIntegers();
135   - Assert.fail();
136   - } catch (ConfigurationException cause) {
137   - assertEquals(ConversionException.class, cause.getCause().getClass());
138   - }
139   - }
140   -
141   - @Test
142   - public void loadEmptyWrapper() {
143   - try {
144   - propertiesNullConfig.getEmptyWrapperIntegers();
145   - Assert.fail();
146   - } catch (ConfigurationException cause) {
147   - assertEquals(ConversionException.class, cause.getCause().getClass());
148   - }
149   - }
150   -
151   - @Test
152   - public void loadErrorTypeWrapper() {
153   - try {
154   - propertiesNullConfig.getErrorTypeWrapperIntegers();
155   - Assert.fail();
156   - } catch (ConfigurationException cause) {
157   - assertEquals(ConversionException.class, cause.getCause().getClass());
158   - }
159   - }
160   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/array/PropertiesArrayEmptyFieldConfig.java
... ... @@ -1,44 +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 br.gov.frameworkdemoiselle.configuration.field.array;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(type = PROPERTIES)
43   -public class PropertiesArrayEmptyFieldConfig extends AbstractArrayEmptyFieldConfig {
44   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/array/PropertiesArrayFieldConfig.java
... ... @@ -1,44 +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 br.gov.frameworkdemoiselle.configuration.field.array;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(type = PROPERTIES)
43   -public class PropertiesArrayFieldConfig extends AbstractArrayFieldConfig {
44   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/array/XMLArrayFieldConfig.java
... ... @@ -1,44 +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 br.gov.frameworkdemoiselle.configuration.field.array;
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 XMLArrayFieldConfig extends AbstractArrayFieldConfig {
44   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/clazz/AbstractClassNotFoundFieldConfig.java
... ... @@ -1,52 +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 br.gov.frameworkdemoiselle.configuration.field.clazz;
38   -
39   -public abstract class AbstractClassNotFoundFieldConfig {
40   -
41   - private Class<MyClass> nonExistentTypedClass;
42   -
43   - private Class<?> nonExistentUntypedClass;
44   -
45   - public Class<MyClass> getNonExistentTypedClass() {
46   - return nonExistentTypedClass;
47   - }
48   -
49   - public Class<?> getNonExistentUntypedClass() {
50   - return nonExistentUntypedClass;
51   - }
52   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/clazz/AbstractExistentClassFieldConfig.java
... ... @@ -1,52 +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 br.gov.frameworkdemoiselle.configuration.field.clazz;
38   -
39   -public abstract class AbstractExistentClassFieldConfig {
40   -
41   - private Class<MyClass> existentTypedClass;
42   -
43   - private Class<?> existentUntypedClass;
44   -
45   - public Class<MyClass> getExistentTypedClass() {
46   - return existentTypedClass;
47   - }
48   -
49   - public Class<?> getExistentUntypedClass() {
50   - return existentUntypedClass;
51   - }
52   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/clazz/AbstractNullClassFieldConfig.java
... ... @@ -1,52 +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 br.gov.frameworkdemoiselle.configuration.field.clazz;
38   -
39   -public abstract class AbstractNullClassFieldConfig {
40   -
41   - private Class<MyClass> nullTypedClass;
42   -
43   - private Class<?> nullUntypedClass;
44   -
45   - public Class<MyClass> getNullTypedClass() {
46   - return nullTypedClass;
47   - }
48   -
49   - public Class<?> getNullUntypedClass() {
50   - return nullUntypedClass;
51   - }
52   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/clazz/ConfigurationClassFieldTest.java
... ... @@ -1,131 +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 br.gov.frameworkdemoiselle.configuration.field.clazz;
38   -
39   -import static junit.framework.Assert.assertEquals;
40   -import static junit.framework.Assert.fail;
41   -
42   -import java.io.File;
43   -
44   -import javax.inject.Inject;
45   -
46   -import org.jboss.arquillian.container.test.api.Deployment;
47   -import org.jboss.arquillian.junit.Arquillian;
48   -import org.jboss.shrinkwrap.api.asset.FileAsset;
49   -import org.jboss.shrinkwrap.api.spec.JavaArchive;
50   -import org.junit.Test;
51   -import org.junit.runner.RunWith;
52   -
53   -import br.gov.frameworkdemoiselle.configuration.AbstractConfigurationTest;
54   -import br.gov.frameworkdemoiselle.configuration.ConfigurationException;
55   -
56   -@RunWith(Arquillian.class)
57   -public class ConfigurationClassFieldTest extends AbstractConfigurationTest {
58   -
59   - @Inject
60   - private PropertiesExistentClassFieldConfig propertiesExistentConfig;
61   -
62   - @Inject
63   - private PropertiesClassNotFoundFieldConfig propertiesNotFoundConfig;
64   -
65   - @Inject
66   - private PropertiesNullClassFieldConfig propertiesNullFieldConfig;
67   -
68   - @Deployment
69   - public static JavaArchive createDeployment() {
70   - JavaArchive deployment = createConfigurationDeployment();
71   -
72   - deployment.addPackages(true, ConfigurationClassFieldTest.class.getPackage());
73   - deployment.addAsResource(new FileAsset(new File(
74   - "src/test/resources/configuration/field/class/demoiselle.properties")), "demoiselle.properties");
75   -
76   - return deployment;
77   - }
78   -
79   - @Test
80   - public void loadExistentTypedClass() {
81   - assertEquals(MyClass.class, propertiesExistentConfig.getExistentTypedClass());
82   - }
83   -
84   - @Test
85   - public void loadExistentUntypedClass() {
86   - assertEquals(MyClass.class, propertiesExistentConfig.getExistentUntypedClass());
87   - }
88   -
89   - @Test
90   - public void loadNonExistentTypedClass() {
91   - try {
92   - propertiesNotFoundConfig.getNonExistentTypedClass();
93   - fail();
94   - } catch (ConfigurationException cause) {
95   - cause.printStackTrace();
96   - assertEquals(ClassNotFoundException.class, cause.getCause().getClass());
97   - }
98   - }
99   -
100   - @Test
101   - public void loadNonExistentUntypedClass() {
102   - try {
103   - propertiesNotFoundConfig.getNonExistentUntypedClass();
104   - fail();
105   - } catch (ConfigurationException cause) {
106   - assertEquals(ClassNotFoundException.class, cause.getCause().getClass());
107   - }
108   - }
109   -
110   - @Test
111   - public void loadNullTypedClass() {
112   - try {
113   - propertiesNullFieldConfig.getNullTypedClass();
114   - fail();
115   - } catch (ConfigurationException cause) {
116   - cause.printStackTrace();
117   - assertEquals(ClassNotFoundException.class, cause.getCause().getClass());
118   - }
119   - }
120   -
121   - @Test
122   - public void loadNullUntypedClass() {
123   - try {
124   - propertiesNullFieldConfig.getNullUntypedClass();
125   - fail();
126   - } catch (ConfigurationException cause) {
127   - assertEquals(ClassNotFoundException.class, cause.getCause().getClass());
128   - }
129   - }
130   -
131   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/clazz/MyClass.java
... ... @@ -1,5 +0,0 @@
1   -package br.gov.frameworkdemoiselle.configuration.field.clazz;
2   -
3   -public class MyClass {
4   -
5   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/clazz/PropertiesClassNotFoundFieldConfig.java
... ... @@ -1,45 +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 br.gov.frameworkdemoiselle.configuration.field.clazz;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(type = PROPERTIES)
43   -public class PropertiesClassNotFoundFieldConfig extends AbstractClassNotFoundFieldConfig {
44   -
45   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/clazz/PropertiesExistentClassFieldConfig.java
... ... @@ -1,45 +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 br.gov.frameworkdemoiselle.configuration.field.clazz;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(type = PROPERTIES)
43   -public class PropertiesExistentClassFieldConfig extends AbstractExistentClassFieldConfig {
44   -
45   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/clazz/PropertiesNullClassFieldConfig.java
... ... @@ -1,45 +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 br.gov.frameworkdemoiselle.configuration.field.clazz;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(type = PROPERTIES)
43   -public class PropertiesNullClassFieldConfig extends AbstractNullClassFieldConfig {
44   -
45   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/custom/ConfigurationCustomFieldTest.java
... ... @@ -1,91 +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 br.gov.frameworkdemoiselle.configuration.field.custom;
38   -
39   -import static junit.framework.Assert.assertEquals;
40   -import static junit.framework.Assert.assertNotNull;
41   -import static junit.framework.Assert.fail;
42   -
43   -import java.io.File;
44   -
45   -import javax.inject.Inject;
46   -
47   -import org.jboss.arquillian.container.test.api.Deployment;
48   -import org.jboss.arquillian.junit.Arquillian;
49   -import org.jboss.shrinkwrap.api.asset.FileAsset;
50   -import org.jboss.shrinkwrap.api.spec.JavaArchive;
51   -import org.junit.Test;
52   -import org.junit.runner.RunWith;
53   -
54   -import br.gov.frameworkdemoiselle.configuration.AbstractConfigurationTest;
55   -import br.gov.frameworkdemoiselle.configuration.ConfigurationException;
56   -
57   -@RunWith(Arquillian.class)
58   -public class ConfigurationCustomFieldTest extends AbstractConfigurationTest {
59   -
60   - @Inject
61   - private CustomMappedFieldConfig mappedField;
62   -
63   - @Inject
64   - private CustomUnmappedFieldConfig unmappedField;
65   -
66   - @Deployment
67   - public static JavaArchive createDeployment() {
68   - JavaArchive deployment = createConfigurationDeployment();
69   -
70   - deployment.addPackages(true, ConfigurationCustomFieldTest.class.getPackage());
71   - deployment.addAsResource(new FileAsset(new File(
72   - "src/test/resources/configuration/field/custom/demoiselle.properties")), "demoiselle.properties");
73   -
74   - return deployment;
75   - }
76   -
77   - @Test
78   - public void loadMappedClass() {
79   - assertNotNull(mappedField.getMappedClass());
80   - }
81   -
82   - @Test
83   - public void loadUnmappedClass() {
84   - try {
85   - unmappedField.getUnmappedClass();
86   - fail();
87   - } catch (ConfigurationException cause) {
88   - assertEquals(ClassNotFoundException.class, cause.getCause().getClass());
89   - }
90   - }
91   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/custom/CustomMappedFieldConfig.java
... ... @@ -1,49 +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 br.gov.frameworkdemoiselle.configuration.field.custom;
38   -
39   -import br.gov.frameworkdemoiselle.configuration.Configuration;
40   -
41   -@Configuration
42   -public class CustomMappedFieldConfig {
43   -
44   - private MappedClass mappedClass;
45   -
46   - public MappedClass getMappedClass() {
47   - return mappedClass;
48   - }
49   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/custom/CustomUnmappedFieldConfig.java
... ... @@ -1,49 +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 br.gov.frameworkdemoiselle.configuration.field.custom;
38   -
39   -import br.gov.frameworkdemoiselle.configuration.Configuration;
40   -
41   -@Configuration
42   -public class CustomUnmappedFieldConfig {
43   -
44   - private UnmappedClass unmappedClass;
45   -
46   - public UnmappedClass getUnmappedClass() {
47   - return unmappedClass;
48   - }
49   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/custom/MappedClass.java
... ... @@ -1,41 +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 br.gov.frameworkdemoiselle.configuration.field.custom;
38   -
39   -public class MappedClass {
40   -
41   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/custom/MyValueExtractor.java
... ... @@ -1,20 +0,0 @@
1   -package br.gov.frameworkdemoiselle.configuration.field.custom;
2   -
3   -import java.lang.reflect.Field;
4   -
5   -import org.apache.commons.configuration.Configuration;
6   -
7   -import br.gov.frameworkdemoiselle.configuration.ConfigurationValueExtractor;
8   -
9   -public class MyValueExtractor implements ConfigurationValueExtractor {
10   -
11   - @Override
12   - public Object getValue(String prefix, String key, Field field, Configuration configuration) throws Exception {
13   - return new MappedClass();
14   - }
15   -
16   - @Override
17   - public boolean isSupported(Field field) {
18   - return field.getType() == MappedClass.class;
19   - }
20   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/custom/UnmappedClass.java
... ... @@ -1,41 +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 br.gov.frameworkdemoiselle.configuration.field.custom;
38   -
39   -public class UnmappedClass {
40   -
41   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/ignored/AbstractIgnoredFieldConfig.java
... ... @@ -1,49 +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 br.gov.frameworkdemoiselle.configuration.field.ignored;
38   -
39   -import br.gov.frameworkdemoiselle.annotation.Ignore;
40   -
41   -public abstract class AbstractIgnoredFieldConfig {
42   -
43   - @Ignore
44   - private int ignoredAttribute;
45   -
46   - public int getIgnoredAttribute() {
47   - return ignoredAttribute;
48   - }
49   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/ignored/ConfigurationIgnoredFieldTest.java
... ... @@ -1,88 +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 br.gov.frameworkdemoiselle.configuration.field.ignored;
38   -
39   -import static junit.framework.Assert.assertEquals;
40   -
41   -import java.io.File;
42   -
43   -import javax.inject.Inject;
44   -
45   -import org.jboss.arquillian.container.test.api.Deployment;
46   -import org.jboss.arquillian.junit.Arquillian;
47   -import org.jboss.shrinkwrap.api.asset.FileAsset;
48   -import org.jboss.shrinkwrap.api.spec.JavaArchive;
49   -import org.junit.Test;
50   -import org.junit.runner.RunWith;
51   -
52   -import br.gov.frameworkdemoiselle.configuration.AbstractConfigurationTest;
53   -
54   -@RunWith(Arquillian.class)
55   -public class ConfigurationIgnoredFieldTest extends AbstractConfigurationTest {
56   -
57   - @Inject
58   - private FilledIgnoredFieldConfig filledFieldConfig;
59   -
60   - @Inject
61   - private EmptyIgnoredFieldConfig emptyFieldsConfig;
62   -
63   - @Inject
64   - private PropertyWithoutFileConfig noFileConfig;
65   -
66   - @Deployment
67   - public static JavaArchive createDeployment() {
68   - JavaArchive deployment = createConfigurationDeployment();
69   -
70   - deployment.addPackages(true, ConfigurationIgnoredFieldTest.class.getPackage());
71   - deployment.addAsResource(
72   - new FileAsset(new File("src/test/resources/configuration/field/ignored/demoiselle.properties")),
73   - "demoiselle.properties").addAsResource(
74   - new FileAsset(new File("src/test/resources/configuration/field/ignored/demoiselle.xml")),
75   - "demoiselle.xml");
76   -
77   - return deployment;
78   - }
79   -
80   - @Test
81   - public void loadIgnoredAttribute() {
82   - int expected = 0;
83   -
84   - assertEquals(expected, filledFieldConfig.getIgnoredAttribute());
85   - assertEquals(expected, noFileConfig.getIgnoredAttribute());
86   - assertEquals(expected, emptyFieldsConfig.getIgnoredAttribute());
87   - }
88   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/ignored/EmptyIgnoredFieldConfig.java
... ... @@ -1,44 +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 br.gov.frameworkdemoiselle.configuration.field.ignored;
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 EmptyIgnoredFieldConfig extends AbstractIgnoredFieldConfig {
44   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/ignored/FilledIgnoredFieldConfig.java
... ... @@ -1,44 +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 br.gov.frameworkdemoiselle.configuration.field.ignored;
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 FilledIgnoredFieldConfig extends AbstractIgnoredFieldConfig {
44   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/ignored/PropertyWithoutFileConfig.java
... ... @@ -1,43 +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 br.gov.frameworkdemoiselle.configuration.field.ignored;
38   -
39   -import br.gov.frameworkdemoiselle.configuration.Configuration;
40   -
41   -@Configuration(resource = "nofile")
42   -public class PropertyWithoutFileConfig extends AbstractIgnoredFieldConfig {
43   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/map/AbstractMapFieldConfig.java
... ... @@ -1,60 +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 br.gov.frameworkdemoiselle.configuration.field.map;
38   -
39   -import java.util.Map;
40   -
41   -public abstract class AbstractMapFieldConfig {
42   -
43   - private Map<String, String> stringWithDefinedKeyMap;
44   -
45   - private Map<String, String> stringWithUndefinedKeyMap;
46   -
47   - private Map<String, String> emptyValueMap;
48   -
49   - public Map<String, String> getStringWithUndefinedKeyMap() {
50   - return stringWithUndefinedKeyMap;
51   - }
52   -
53   - public Map<String, String> getStringWithDefinedKeyMap() {
54   - return stringWithDefinedKeyMap;
55   - }
56   -
57   - public Map<String, String> getEmptyValueMap() {
58   - return emptyValueMap;
59   - }
60   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/map/ConfigurationMapFieldTest.java
... ... @@ -1,107 +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 br.gov.frameworkdemoiselle.configuration.field.map;
38   -
39   -import static junit.framework.Assert.assertEquals;
40   -
41   -import java.io.File;
42   -import java.util.HashMap;
43   -import java.util.Map;
44   -
45   -import javax.inject.Inject;
46   -import javax.validation.constraints.Size;
47   -
48   -import org.jboss.arquillian.container.test.api.Deployment;
49   -import org.jboss.arquillian.junit.Arquillian;
50   -import org.jboss.shrinkwrap.api.asset.FileAsset;
51   -import org.jboss.shrinkwrap.api.spec.JavaArchive;
52   -import org.junit.Test;
53   -import org.junit.runner.RunWith;
54   -
55   -import br.gov.frameworkdemoiselle.configuration.AbstractConfigurationTest;
56   -
57   -@RunWith(Arquillian.class)
58   -public class ConfigurationMapFieldTest extends AbstractConfigurationTest {
59   -
60   - @Inject
61   - private PropertiesMapFieldConfig propertiesConfig;
62   -
63   - @Inject
64   - private XMLMapFieldConfig xmlConfig;
65   -
66   - @Deployment
67   - public static JavaArchive createDeployment() {
68   - JavaArchive deployment = createConfigurationDeployment();
69   -
70   - deployment.addPackages(true, ConfigurationMapFieldTest.class.getPackage());
71   - deployment.addAsResource(
72   - new FileAsset(new File("src/test/resources/configuration/field/map/demoiselle.properties")),
73   - "demoiselle.properties").addAsResource(
74   - new FileAsset(new File("src/test/resources/configuration/field/map/demoiselle.xml")), "demoiselle.xml");
75   -
76   - return deployment;
77   - }
78   -
79   - @Test
80   - public void loadStringWithDefinedKeyMap() {
81   - Map<String, String> expected = new HashMap<String, String>();
82   - expected.put("item1", "demoiselle");
83   - expected.put("item2", "framework");
84   -
85   - assertEquals(expected, propertiesConfig.getStringWithDefinedKeyMap());
86   - assertEquals(expected, xmlConfig.getStringWithDefinedKeyMap());
87   - }
88   -
89   - @Test
90   - public void loadStringWithUndefinedKeyMap() {
91   - Map<String, String> expected = new HashMap<String, String>();
92   - expected.put("default", "undefined");
93   -
94   - assertEquals(expected, propertiesConfig.getStringWithUndefinedKeyMap());
95   - assertEquals(expected, xmlConfig.getStringWithUndefinedKeyMap());
96   - }
97   -
98   - @Test
99   - public void loadEmptyKeyMapString() {
100   - Map<String, String> expected = new HashMap<String, String>();
101   - expected.put("item1", "");
102   - expected.put("item2", "");
103   -
104   - assertEquals(expected, propertiesConfig.getEmptyValueMap());
105   - assertEquals(expected, xmlConfig.getEmptyValueMap());
106   - }
107   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/map/PropertiesMapFieldConfig.java
... ... @@ -1,44 +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 br.gov.frameworkdemoiselle.configuration.field.map;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(type = PROPERTIES)
43   -public class PropertiesMapFieldConfig extends AbstractMapFieldConfig {
44   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/map/XMLMapFieldConfig.java
... ... @@ -1,44 +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 br.gov.frameworkdemoiselle.configuration.field.map;
38   -
39   -import br.gov.frameworkdemoiselle.configuration.ConfigType;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(type = ConfigType.XML)
43   -public class XMLMapFieldConfig extends AbstractMapFieldConfig {
44   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/named/AbstractEmptyNamedFieldConfig.java
... ... @@ -1,49 +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 br.gov.frameworkdemoiselle.configuration.field.named;
38   -
39   -import br.gov.frameworkdemoiselle.annotation.Name;
40   -
41   -public abstract class AbstractEmptyNamedFieldConfig {
42   -
43   - @Name("")
44   - private int noNameAttribute;
45   -
46   - public int getNoNameAttribute() {
47   - return noNameAttribute;
48   - }
49   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/named/AbstractNamedFieldConfig.java
... ... @@ -1,63 +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 br.gov.frameworkdemoiselle.configuration.field.named;
38   -
39   -import br.gov.frameworkdemoiselle.annotation.Name;
40   -
41   -public abstract class AbstractNamedFieldConfig {
42   -
43   - @Name("main.int")
44   - private int uniqueNameAttribute;
45   -
46   - @Name("nonexistent.property")
47   - private int notPresentAttribute;
48   -
49   - @Name("attribute.without.file")
50   - private int namedWithoutFileAttribute;
51   -
52   - public int getUniqueNameAttribute() {
53   - return uniqueNameAttribute;
54   - }
55   -
56   - public int getNotPresentAttribute() {
57   - return notPresentAttribute;
58   - }
59   -
60   - public int getNamedWithoutFileAttribute() {
61   - return namedWithoutFileAttribute;
62   - }
63   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/named/ConfigurationNamedFieldTest.java
... ... @@ -1,122 +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 br.gov.frameworkdemoiselle.configuration.field.named;
38   -
39   -import static junit.framework.Assert.assertEquals;
40   -import static junit.framework.Assert.fail;
41   -
42   -import java.io.File;
43   -
44   -import javax.inject.Inject;
45   -
46   -import junit.framework.Assert;
47   -
48   -import org.jboss.arquillian.container.test.api.Deployment;
49   -import org.jboss.arquillian.junit.Arquillian;
50   -import org.jboss.shrinkwrap.api.asset.FileAsset;
51   -import org.jboss.shrinkwrap.api.spec.JavaArchive;
52   -import org.junit.Test;
53   -import org.junit.runner.RunWith;
54   -
55   -import br.gov.frameworkdemoiselle.configuration.AbstractConfigurationTest;
56   -import br.gov.frameworkdemoiselle.configuration.ConfigurationException;
57   -
58   -@RunWith(Arquillian.class)
59   -public class ConfigurationNamedFieldTest extends AbstractConfigurationTest {
60   -
61   - @Inject
62   - private PropertyNamed propertyNamed;
63   -
64   - @Inject
65   - private XMLNamed xmlNamed;
66   -
67   - @Inject
68   - private PropertyEmptyNamed propertyEmptyNamed;
69   -
70   - @Inject
71   - private XMLEmptyNamed xmlEmptyNamed;
72   -
73   - @Deployment
74   - public static JavaArchive createDeployment() {
75   - JavaArchive deployment = createConfigurationDeployment();
76   -
77   - deployment.addPackages(true, ConfigurationNamedFieldTest.class.getPackage());
78   - deployment.addAsResource(
79   - new FileAsset(new File("src/test/resources/configuration/field/named/demoiselle.properties")),
80   - "demoiselle.properties").addAsResource(
81   - new FileAsset(new File("src/test/resources/configuration/field/named/demoiselle.xml")),
82   - "demoiselle.xml");
83   -
84   - return deployment;
85   - }
86   -
87   - @Test
88   - public void loadNamedConfigFromPropertyWithName() {
89   - assertEquals(1, propertyNamed.getUniqueNameAttribute());
90   - assertEquals(1, xmlNamed.getUniqueNameAttribute());
91   - }
92   -
93   - @Test
94   - public void loadNamedConfigFromNonexistentProperty() {
95   - assertEquals(0, propertyNamed.getNotPresentAttribute());
96   - assertEquals(0, xmlNamed.getNotPresentAttribute());
97   - }
98   -
99   - @Test
100   - public void loadNamedConfigFromPropertyWithoutField() {
101   - assertEquals(0, propertyNamed.getNamedWithoutFileAttribute());
102   - assertEquals(0, xmlNamed.getNamedWithoutFileAttribute());
103   - }
104   -
105   - @Test
106   - public void loadEmptyNameConfig() {
107   - try {
108   - xmlEmptyNamed.getNoNameAttribute();
109   - fail();
110   - } catch (ConfigurationException cause) {
111   - assertEquals(IllegalArgumentException.class, cause.getCause().getClass());
112   - }
113   -
114   - try {
115   - propertyEmptyNamed.getNoNameAttribute();
116   - fail();
117   - } catch (ConfigurationException cause) {
118   - assertEquals(IllegalArgumentException.class, cause.getCause().getClass());
119   - }
120   -
121   - }
122   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/named/PropertyEmptyNamed.java
... ... @@ -1,8 +0,0 @@
1   -package br.gov.frameworkdemoiselle.configuration.field.named;
2   -
3   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES;
4   -import br.gov.frameworkdemoiselle.configuration.Configuration;
5   -
6   -@Configuration(type = PROPERTIES)
7   -public class PropertyEmptyNamed extends AbstractEmptyNamedFieldConfig {
8   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/named/PropertyNamed.java
... ... @@ -1,8 +0,0 @@
1   -package br.gov.frameworkdemoiselle.configuration.field.named;
2   -
3   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES;
4   -import br.gov.frameworkdemoiselle.configuration.Configuration;
5   -
6   -@Configuration(type = PROPERTIES)
7   -public class PropertyNamed extends AbstractNamedFieldConfig {
8   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/named/XMLEmptyNamed.java
... ... @@ -1,8 +0,0 @@
1   -package br.gov.frameworkdemoiselle.configuration.field.named;
2   -
3   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.XML;
4   -import br.gov.frameworkdemoiselle.configuration.Configuration;
5   -
6   -@Configuration(type = XML)
7   -public class XMLEmptyNamed extends AbstractEmptyNamedFieldConfig {
8   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/named/XMLNamed.java
... ... @@ -1,8 +0,0 @@
1   -package br.gov.frameworkdemoiselle.configuration.field.named;
2   -
3   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.XML;
4   -import br.gov.frameworkdemoiselle.configuration.Configuration;
5   -
6   -@Configuration(type = XML)
7   -public class XMLNamed extends AbstractNamedFieldConfig {
8   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/notnull/AbstractNotNullFieldConfig.java
... ... @@ -1,49 +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 br.gov.frameworkdemoiselle.configuration.field.notnull;
38   -
39   -import javax.validation.constraints.NotNull;
40   -
41   -public abstract class AbstractNotNullFieldConfig {
42   -
43   - @NotNull
44   - private Integer attibuteNotNull;
45   -
46   - public Integer getAttributeNotNull() {
47   - return attibuteNotNull;
48   - }
49   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/notnull/ConfigurationNotNullFieldTest.java
... ... @@ -1,173 +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 br.gov.frameworkdemoiselle.configuration.field.notnull;
38   -
39   -import static junit.framework.Assert.assertEquals;
40   -import static junit.framework.Assert.fail;
41   -
42   -import java.io.File;
43   -
44   -import javax.inject.Inject;
45   -
46   -import junit.framework.Assert;
47   -
48   -import org.jboss.arquillian.container.test.api.Deployment;
49   -import org.jboss.arquillian.junit.Arquillian;
50   -import org.jboss.shrinkwrap.api.asset.FileAsset;
51   -import org.jboss.shrinkwrap.api.spec.JavaArchive;
52   -import org.junit.Test;
53   -import org.junit.runner.RunWith;
54   -
55   -import br.gov.frameworkdemoiselle.configuration.AbstractConfigurationTest;
56   -import br.gov.frameworkdemoiselle.configuration.ConfigurationException;
57   -
58   -@RunWith(Arquillian.class)
59   -public class ConfigurationNotNullFieldTest extends AbstractConfigurationTest {
60   -
61   - @Inject
62   - private PropertyWithFilledFieldConfig propertyFilledFieldConfig;
63   -
64   - @Inject
65   - private PropertyWithEmptyFieldConfig propertyEmptyFieldsConfig;
66   -
67   - @Inject
68   - private PropertyWithoutNotNullField propertyWithoutNotNullField;
69   -
70   - @Inject
71   - private PropertyWithoutFileConfig propertyNoFileConfig;
72   -
73   - @Inject
74   - private XMLWithFilledFieldConfig xmlFilledFieldConfig;
75   -
76   - @Inject
77   - private XMLWithEmptyFieldConfig xmlEmptyFieldsConfig;
78   -
79   - @Inject
80   - private XMLWithoutNotNullField xmlWithoutNotNullField;
81   -
82   - @Inject
83   - private XMLWithoutFileConfig xmlNoFileConfig;
84   -
85   - @Deployment
86   - public static JavaArchive createDeployment() {
87   - JavaArchive deployment = createConfigurationDeployment();
88   -
89   - deployment.addPackages(true, ConfigurationNotNullFieldTest.class.getPackage());
90   - deployment
91   - .addAsResource(
92   - new FileAsset(new File("src/test/resources/configuration/field/notnull/demoiselle.properties")),
93   - "demoiselle.properties")
94   - .addAsResource(
95   - new FileAsset(new File("src/test/resources/configuration/field/notnull/empty-field.properties")),
96   - "empty-field.properties")
97   - .addAsResource(
98   - new FileAsset(new File(
99   - "src/test/resources/configuration/field/notnull/without-field.properties")),
100   - "without-field.properties")
101   - .addAsResource(
102   - new FileAsset(new File("src/test/resources/configuration/field/notnull/demoiselle.xml")),
103   - "demoiselle.xml")
104   - .addAsResource(
105   - new FileAsset(new File("src/test/resources/configuration/field/notnull/empty-field.xml")),
106   - "empty-field.xml")
107   - .addAsResource(
108   - new FileAsset(new File(
109   - "src/test/resources/configuration/field/notnull/without-field.xml")),
110   - "without-field.xml");
111   -
112   - return deployment;
113   - }
114   -
115   - @Test
116   - public void loadFieldNotNullFromFilledFile() {
117   - Integer expected = 1;
118   -
119   - assertEquals(expected, propertyFilledFieldConfig.getAttributeNotNull());
120   - assertEquals(expected, xmlFilledFieldConfig.getAttributeNotNull());
121   - }
122   -
123   - @Test
124   - public void loadFieldNotNullFromEmptyProperty() {
125   - try {
126   - propertyEmptyFieldsConfig.getAttributeNotNull();
127   - fail();
128   - } catch (ConfigurationException cause) {
129   - Assert.assertEquals(NullPointerException.class, cause.getCause().getClass());
130   - }
131   -
132   - try {
133   - xmlEmptyFieldsConfig.getAttributeNotNull();
134   - fail();
135   - } catch (ConfigurationException cause) {
136   - Assert.assertEquals(NullPointerException.class, cause.getCause().getClass());
137   - }
138   - }
139   -
140   - @Test
141   - public void loadFieldFromPropertyFileWithoutNotNullField() {
142   - try {
143   - propertyWithoutNotNullField.getAttributeNotNull();
144   - fail();
145   - } catch (ConfigurationException cause) {
146   - Assert.assertEquals(NullPointerException.class, cause.getCause().getClass());
147   - }
148   -
149   - try {
150   - xmlWithoutNotNullField.getAttributeNotNull();
151   - fail();
152   - } catch (ConfigurationException cause) {
153   - Assert.assertEquals(NullPointerException.class, cause.getCause().getClass());
154   - }
155   - }
156   -
157   - @Test
158   - public void loadFieldNotNullFromInexistentPropertyFile() {
159   - try {
160   - propertyNoFileConfig.getAttributeNotNull();
161   - fail();
162   - } catch (ConfigurationException cause) {
163   - Assert.assertEquals(NullPointerException.class, cause.getCause().getClass());
164   - }
165   -
166   - try {
167   - xmlNoFileConfig.getAttributeNotNull();
168   - fail();
169   - } catch (ConfigurationException cause) {
170   - Assert.assertEquals(NullPointerException.class, cause.getCause().getClass());
171   - }
172   - }
173   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/notnull/PropertyWithEmptyFieldConfig.java
... ... @@ -1,44 +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 br.gov.frameworkdemoiselle.configuration.field.notnull;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(resource = "empty-field", type = PROPERTIES)
43   -public class PropertyWithEmptyFieldConfig extends AbstractNotNullFieldConfig {
44   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/notnull/PropertyWithFilledFieldConfig.java
... ... @@ -1,44 +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 br.gov.frameworkdemoiselle.configuration.field.notnull;
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 PropertyWithFilledFieldConfig extends AbstractNotNullFieldConfig {
44   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/notnull/PropertyWithoutFileConfig.java
... ... @@ -1,44 +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 br.gov.frameworkdemoiselle.configuration.field.notnull;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(resource = "nofile", type = PROPERTIES)
43   -public class PropertyWithoutFileConfig extends AbstractNotNullFieldConfig {
44   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/notnull/PropertyWithoutNotNullField.java
... ... @@ -1,8 +0,0 @@
1   -package br.gov.frameworkdemoiselle.configuration.field.notnull;
2   -
3   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES;
4   -import br.gov.frameworkdemoiselle.configuration.Configuration;
5   -
6   -@Configuration(resource = "without-field", type = PROPERTIES)
7   -public class PropertyWithoutNotNullField extends AbstractNotNullFieldConfig {
8   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/notnull/XMLWithEmptyFieldConfig.java
... ... @@ -1,8 +0,0 @@
1   -package br.gov.frameworkdemoiselle.configuration.field.notnull;
2   -
3   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.XML;
4   -import br.gov.frameworkdemoiselle.configuration.Configuration;
5   -
6   -@Configuration(resource = "empty-field", type = XML)
7   -public class XMLWithEmptyFieldConfig extends AbstractNotNullFieldConfig {
8   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/notnull/XMLWithFilledFieldConfig.java
... ... @@ -1,8 +0,0 @@
1   -package br.gov.frameworkdemoiselle.configuration.field.notnull;
2   -
3   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.XML;
4   -import br.gov.frameworkdemoiselle.configuration.Configuration;
5   -
6   -@Configuration(resource = "demoiselle", type = XML)
7   -public class XMLWithFilledFieldConfig extends AbstractNotNullFieldConfig {
8   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/notnull/XMLWithoutFileConfig.java
... ... @@ -1,8 +0,0 @@
1   -package br.gov.frameworkdemoiselle.configuration.field.notnull;
2   -
3   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.XML;
4   -import br.gov.frameworkdemoiselle.configuration.Configuration;
5   -
6   -@Configuration(resource = "nofile", type = XML)
7   -public class XMLWithoutFileConfig extends AbstractNotNullFieldConfig {
8   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/notnull/XMLWithoutNotNullField.java
... ... @@ -1,8 +0,0 @@
1   -package br.gov.frameworkdemoiselle.configuration.field.notnull;
2   -
3   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.XML;
4   -import br.gov.frameworkdemoiselle.configuration.Configuration;
5   -
6   -@Configuration(resource = "without-field", type = XML)
7   -public class XMLWithoutNotNullField extends AbstractNotNullFieldConfig {
8   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/primitiveorwrapper/AbstractPrimitiveOrWrapperEmptyFieldConfig.java
... ... @@ -1,76 +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 br.gov.frameworkdemoiselle.configuration.field.primitiveorwrapper;
38   -
39   -public abstract class AbstractPrimitiveOrWrapperEmptyFieldConfig {
40   -
41   - private int primitiveInteger;
42   -
43   - private int nullPrimitiveInteger;
44   -
45   - private int errorPrimitiveInteger;
46   -
47   - private Integer wrappedInteger;
48   -
49   - private Integer nullWrappedInteger;
50   -
51   - private Integer errorWrappedInteger;
52   -
53   - public Integer getWrappedInteger() {
54   - return wrappedInteger;
55   - }
56   -
57   - public int getPrimitiveInteger() {
58   - return primitiveInteger;
59   - }
60   -
61   - public int getNullPrimitiveInteger() {
62   - return nullPrimitiveInteger;
63   - }
64   -
65   - public Integer getNullWrappedInteger() {
66   - return nullWrappedInteger;
67   - }
68   -
69   - public int getErrorPrimitiveInteger() {
70   - return errorPrimitiveInteger;
71   - }
72   -
73   - public Integer getErrorWrappedInteger() {
74   - return errorWrappedInteger;
75   - }
76   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/primitiveorwrapper/AbstractPrimitiveOrWrapperErrorFieldConfig.java
... ... @@ -1,64 +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 br.gov.frameworkdemoiselle.configuration.field.primitiveorwrapper;
38   -
39   -public abstract class AbstractPrimitiveOrWrapperErrorFieldConfig {
40   -
41   - private int emptyPrimitiveInteger;
42   -
43   - private int errorPrimitiveInteger;
44   -
45   - private Integer emptyWrappedInteger;
46   -
47   - private Integer errorWrappedInteger;
48   -
49   - public int getEmptyPrimitiveInteger() {
50   - return emptyPrimitiveInteger;
51   - }
52   -
53   - public Integer getEmptyWrappedInteger() {
54   - return emptyWrappedInteger;
55   - }
56   -
57   - public int getErrorPrimitiveInteger() {
58   - return errorPrimitiveInteger;
59   - }
60   -
61   - public Integer getErrorWrappedInteger() {
62   - return errorWrappedInteger;
63   - }
64   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/primitiveorwrapper/AbstractPrimitiveOrWrapperFieldConfig.java
... ... @@ -1,52 +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 br.gov.frameworkdemoiselle.configuration.field.primitiveorwrapper;
38   -
39   -public abstract class AbstractPrimitiveOrWrapperFieldConfig {
40   -
41   - private int primitiveInteger;
42   -
43   - private Integer wrappedInteger;
44   -
45   - public Integer getWrappedInteger() {
46   - return wrappedInteger;
47   - }
48   -
49   - public int getPrimitiveInteger() {
50   - return primitiveInteger;
51   - }
52   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/primitiveorwrapper/ConfigurationPrimitiveOrWrapperFieldTest.java
... ... @@ -1,211 +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 br.gov.frameworkdemoiselle.configuration.field.primitiveorwrapper;
38   -
39   -import static junit.framework.Assert.assertEquals;
40   -import static junit.framework.Assert.fail;
41   -
42   -import java.io.File;
43   -
44   -import javax.inject.Inject;
45   -
46   -import org.apache.commons.configuration.ConversionException;
47   -import org.jboss.arquillian.container.test.api.Deployment;
48   -import org.jboss.arquillian.junit.Arquillian;
49   -import org.jboss.shrinkwrap.api.asset.FileAsset;
50   -import org.jboss.shrinkwrap.api.spec.JavaArchive;
51   -import org.junit.BeforeClass;
52   -import org.junit.Test;
53   -import org.junit.runner.RunWith;
54   -
55   -import br.gov.frameworkdemoiselle.configuration.AbstractConfigurationTest;
56   -import br.gov.frameworkdemoiselle.configuration.ConfigurationException;
57   -
58   -@RunWith(Arquillian.class)
59   -public class ConfigurationPrimitiveOrWrapperFieldTest extends AbstractConfigurationTest {
60   -
61   - @Inject
62   - private PropertiesPrimitiveOrWrapperFieldConfig propertiesConfig;
63   -
64   - @Inject
65   - private XMLPrimitiveOrWrapperFieldConfig xmlConfig;
66   -
67   - @Inject
68   - private SystemPrimitiveOrWrapperFieldConfig systemConfig;
69   -
70   - @Inject
71   - private PropertiesPrimitiveOrWrapperErrorFieldConfig propertiesErrorConfig;
72   -
73   - @Inject
74   - private XMLPrimitiveOrWrapperErrorFieldConfig xmlErrorConfig;
75   -
76   - @Inject
77   - private SystemPrimitiveOrWrapperErrorFieldConfig systemErrorConfig;
78   -
79   - @Deployment
80   - public static JavaArchive createDeployment() {
81   - JavaArchive deployment = createConfigurationDeployment();
82   -
83   - deployment.addPackages(true, ConfigurationPrimitiveOrWrapperFieldTest.class.getPackage());
84   - deployment.addAsResource(
85   - new FileAsset(new File(
86   - "src/test/resources/configuration/field/primitiveorwrapper/demoiselle.properties")),
87   - "demoiselle.properties").addAsResource(
88   - new FileAsset(new File("src/test/resources/configuration/field/primitiveorwrapper/demoiselle.xml")),
89   - "demoiselle.xml");
90   -
91   - return deployment;
92   - }
93   -
94   - @BeforeClass
95   - public static void afterClass() {
96   - System.setProperty("primitiveInteger", String.valueOf(1));
97   - System.setProperty("emptyPrimitiveInteger", String.valueOf(""));
98   - System.setProperty("errorPrimitiveInteger", String.valueOf("a"));
99   - System.setProperty("wrappedInteger", String.valueOf(2));
100   - System.setProperty("emptyWrappedInteger", String.valueOf(""));
101   - System.setProperty("errorWrappedInteger", String.valueOf("a"));
102   - }
103   -
104   - @Test
105   - public void loadPrimitiveInteger() {
106   - int expected = 1;
107   -
108   - assertEquals(expected, systemConfig.getPrimitiveInteger());
109   - assertEquals(expected, propertiesConfig.getPrimitiveInteger());
110   - assertEquals(expected, xmlConfig.getPrimitiveInteger());
111   - }
112   -
113   - @Test
114   - public void loadWrappedInteger() {
115   - Integer expected = 2;
116   -
117   - assertEquals(expected, systemConfig.getWrappedInteger());
118   - assertEquals(expected, propertiesConfig.getWrappedInteger());
119   - assertEquals(expected, xmlConfig.getWrappedInteger());
120   - }
121   -
122   - @Test
123   - public void loadEmptyPrimitiveInteger() {
124   - try {
125   - systemErrorConfig.getEmptyPrimitiveInteger();
126   - } catch (ConfigurationException cause) {
127   - assertEquals(ConversionException.class, cause.getCause().getClass());
128   - }
129   -
130   - try {
131   - propertiesErrorConfig.getEmptyPrimitiveInteger();
132   - } catch (ConfigurationException cause) {
133   - assertEquals(ConversionException.class, cause.getCause().getClass());
134   - }
135   -
136   - try {
137   - propertiesErrorConfig.getEmptyPrimitiveInteger();
138   - } catch (ConfigurationException cause) {
139   - assertEquals(ConversionException.class, cause.getCause().getClass());
140   - }
141   - }
142   -
143   - @Test
144   - public void loadNullWrappedInteger() {
145   - try {
146   - systemErrorConfig.getEmptyWrappedInteger();
147   - } catch (ConfigurationException cause) {
148   - assertEquals(ConversionException.class, cause.getCause().getClass());
149   - }
150   -
151   - try {
152   - propertiesErrorConfig.getEmptyWrappedInteger();
153   - } catch (ConfigurationException cause) {
154   - assertEquals(ConversionException.class, cause.getCause().getClass());
155   - }
156   -
157   - try {
158   - propertiesErrorConfig.getEmptyWrappedInteger();
159   - } catch (ConfigurationException cause) {
160   - assertEquals(ConversionException.class, cause.getCause().getClass());
161   - }
162   - }
163   -
164   - @Test
165   - public void loadErrorPrimitiveInteger() {
166   - try {
167   - propertiesErrorConfig.getErrorPrimitiveInteger();
168   - fail();
169   - } catch (ConfigurationException cause) {
170   - assertEquals(ConversionException.class, cause.getCause().getClass());
171   - }
172   -
173   - try {
174   - propertiesErrorConfig.getErrorPrimitiveInteger();
175   - fail();
176   - } catch (ConfigurationException cause) {
177   - assertEquals(ConversionException.class, cause.getCause().getClass());
178   - }
179   -
180   - try {
181   - xmlErrorConfig.getErrorPrimitiveInteger();
182   - fail();
183   - } catch (ConfigurationException cause) {
184   - assertEquals(ConversionException.class, cause.getCause().getClass());
185   - }
186   - }
187   -
188   - @Test
189   - public void loadErrorWrappedInteger() {
190   - try {
191   - propertiesErrorConfig.getErrorWrappedInteger();
192   - fail();
193   - } catch (ConfigurationException cause) {
194   - assertEquals(ConversionException.class, cause.getCause().getClass());
195   - }
196   -
197   - try {
198   - propertiesErrorConfig.getErrorWrappedInteger();
199   - fail();
200   - } catch (ConfigurationException cause) {
201   - assertEquals(ConversionException.class, cause.getCause().getClass());
202   - }
203   -
204   - try {
205   - xmlErrorConfig.getErrorWrappedInteger();
206   - fail();
207   - } catch (ConfigurationException cause) {
208   - assertEquals(ConversionException.class, cause.getCause().getClass());
209   - }
210   - }
211   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/primitiveorwrapper/PropertiesPrimitiveOrWrapperErrorFieldConfig.java
... ... @@ -1,44 +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 br.gov.frameworkdemoiselle.configuration.field.primitiveorwrapper;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(type = PROPERTIES)
43   -public class PropertiesPrimitiveOrWrapperErrorFieldConfig extends AbstractPrimitiveOrWrapperErrorFieldConfig {
44   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/primitiveorwrapper/PropertiesPrimitiveOrWrapperFieldConfig.java
... ... @@ -1,44 +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 br.gov.frameworkdemoiselle.configuration.field.primitiveorwrapper;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(type = PROPERTIES)
43   -public class PropertiesPrimitiveOrWrapperFieldConfig extends AbstractPrimitiveOrWrapperFieldConfig {
44   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/primitiveorwrapper/SystemPrimitiveOrWrapperErrorFieldConfig.java
... ... @@ -1,45 +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 br.gov.frameworkdemoiselle.configuration.field.primitiveorwrapper;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.SYSTEM;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(type = SYSTEM)
43   -public class SystemPrimitiveOrWrapperErrorFieldConfig extends AbstractPrimitiveOrWrapperErrorFieldConfig {
44   -
45   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/primitiveorwrapper/SystemPrimitiveOrWrapperFieldConfig.java
... ... @@ -1,45 +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 br.gov.frameworkdemoiselle.configuration.field.primitiveorwrapper;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.SYSTEM;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(type = SYSTEM)
43   -public class SystemPrimitiveOrWrapperFieldConfig extends AbstractPrimitiveOrWrapperFieldConfig {
44   -
45   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/primitiveorwrapper/XMLPrimitiveOrWrapperErrorFieldConfig.java
... ... @@ -1,45 +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 br.gov.frameworkdemoiselle.configuration.field.primitiveorwrapper;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.XML;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(type = XML)
43   -public class XMLPrimitiveOrWrapperErrorFieldConfig extends AbstractPrimitiveOrWrapperErrorFieldConfig {
44   -
45   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/primitiveorwrapper/XMLPrimitiveOrWrapperFieldConfig.java
... ... @@ -1,45 +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 br.gov.frameworkdemoiselle.configuration.field.primitiveorwrapper;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.XML;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(type = XML)
43   -public class XMLPrimitiveOrWrapperFieldConfig extends AbstractPrimitiveOrWrapperFieldConfig {
44   -
45   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/string/AbstractStringFieldConfig.java
... ... @@ -1,58 +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 br.gov.frameworkdemoiselle.configuration.field.string;
38   -
39   -public abstract class AbstractStringFieldConfig {
40   -
41   - private String stringWithSpace;
42   -
43   - private String stringWithComma;
44   -
45   - private String emptyString;
46   -
47   - public String getStringWithSpace() {
48   - return stringWithSpace;
49   - }
50   -
51   - public String getStringWithComma() {
52   - return stringWithComma;
53   - }
54   -
55   - public String getEmptyString() {
56   - return emptyString;
57   - }
58   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/string/ConfigurationStringFieldTest.java
... ... @@ -1,113 +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 br.gov.frameworkdemoiselle.configuration.field.string;
38   -
39   -import static junit.framework.Assert.assertEquals;
40   -
41   -import java.io.File;
42   -
43   -import javax.inject.Inject;
44   -
45   -import org.jboss.arquillian.container.test.api.Deployment;
46   -import org.jboss.arquillian.junit.Arquillian;
47   -import org.jboss.shrinkwrap.api.asset.FileAsset;
48   -import org.jboss.shrinkwrap.api.spec.JavaArchive;
49   -import org.junit.BeforeClass;
50   -import org.junit.Test;
51   -import org.junit.runner.RunWith;
52   -
53   -import br.gov.frameworkdemoiselle.configuration.AbstractConfigurationTest;
54   -
55   -@RunWith(Arquillian.class)
56   -public class ConfigurationStringFieldTest extends AbstractConfigurationTest {
57   -
58   - @Inject
59   - private PropertiesStringFieldConfig propertiesConfig;
60   -
61   - @Inject
62   - private XMLStringFieldConfig xmlConfig;
63   -
64   - @Inject
65   - private SystemBasicFieldConfig systemConfig;
66   -
67   - @Deployment
68   - public static JavaArchive createDeployment() {
69   - JavaArchive deployment = createConfigurationDeployment();
70   -
71   - deployment.addPackages(true, ConfigurationStringFieldTest.class.getPackage());
72   - deployment.addAsResource(
73   - new FileAsset(new File("src/test/resources/configuration/field/string/demoiselle.properties")),
74   - "demoiselle.properties").addAsResource(
75   - new FileAsset(new File("src/test/resources/configuration/field/string/demoiselle.xml")),
76   - "demoiselle.xml");
77   -
78   - return deployment;
79   - }
80   -
81   - @BeforeClass
82   - public static void afterClass() {
83   - System.setProperty("stringWithSpace", String.valueOf("demoiselle framework"));
84   - System.setProperty("stringWithComma", String.valueOf("demoiselle, framework"));
85   - System.setProperty("emptyString", String.valueOf(""));
86   - }
87   -
88   - @Test
89   - public void loadStringWithSpace() {
90   - String expected = "demoiselle framework";
91   -
92   - assertEquals(expected, systemConfig.getStringWithSpace());
93   - assertEquals(expected, propertiesConfig.getStringWithSpace());
94   - assertEquals(expected, xmlConfig.getStringWithSpace());
95   - }
96   -
97   - @Test
98   - public void loadStringWithComma() {
99   - String expected = "demoiselle, framework";
100   -
101   - assertEquals(expected, systemConfig.getStringWithComma());
102   - assertEquals(expected, propertiesConfig.getStringWithComma());
103   - assertEquals(expected, xmlConfig.getStringWithComma());
104   - }
105   -
106   - @Test
107   - public void loadEmptyString() {
108   - String expected = "";
109   - assertEquals(expected, systemConfig.getEmptyString());
110   - assertEquals(expected, propertiesConfig.getEmptyString());
111   - assertEquals(expected, xmlConfig.getEmptyString());
112   - }
113   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/string/PropertiesStringFieldConfig.java
... ... @@ -1,44 +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 br.gov.frameworkdemoiselle.configuration.field.string;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(type = PROPERTIES)
43   -public class PropertiesStringFieldConfig extends AbstractStringFieldConfig {
44   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/string/SystemBasicFieldConfig.java
... ... @@ -1,45 +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 br.gov.frameworkdemoiselle.configuration.field.string;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.SYSTEM;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(type = SYSTEM)
43   -public class SystemBasicFieldConfig extends AbstractStringFieldConfig {
44   -
45   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/string/XMLStringFieldConfig.java
... ... @@ -1,45 +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 br.gov.frameworkdemoiselle.configuration.field.string;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.XML;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(type = XML)
43   -public class XMLStringFieldConfig extends AbstractStringFieldConfig {
44   -
45   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/prefix/AbstractPrefixConfig.java
... ... @@ -1,50 +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 br.gov.frameworkdemoiselle.configuration.prefix;
38   -
39   -public abstract class AbstractPrefixConfig {
40   -
41   - private String prefixedAttribute;
42   -
43   - public String getPrefixedAttribute() {
44   - return prefixedAttribute;
45   - }
46   -
47   - public void setPrefixedAttribute(String prefixedAttribute) {
48   - this.prefixedAttribute = prefixedAttribute;
49   - }
50   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/prefix/ConfigurationPrefixTest.java
... ... @@ -1,112 +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 br.gov.frameworkdemoiselle.configuration.prefix;
38   -
39   -import static junit.framework.Assert.assertNull;
40   -import static org.junit.Assert.assertEquals;
41   -
42   -import java.io.File;
43   -
44   -import javax.inject.Inject;
45   -
46   -import org.jboss.arquillian.container.test.api.Deployment;
47   -import org.jboss.arquillian.junit.Arquillian;
48   -import org.jboss.shrinkwrap.api.asset.FileAsset;
49   -import org.jboss.shrinkwrap.api.spec.JavaArchive;
50   -import org.junit.Test;
51   -import org.junit.runner.RunWith;
52   -
53   -import br.gov.frameworkdemoiselle.configuration.AbstractConfigurationTest;
54   -
55   -@RunWith(Arquillian.class)
56   -public class ConfigurationPrefixTest extends AbstractConfigurationTest {
57   -
58   - @Inject
59   - private PropertyPrefixEndingWithoutDot propertyEndingWithoutDotPrefix;
60   -
61   - @Inject
62   - private PropertyMissingPrefix propertyMissingPrefix;
63   -
64   - @Inject
65   - private PropertyPrefixEndingWithDot propertyEndingWithDotPrefix;
66   -
67   -
68   - @Inject
69   - private XMLPrefixEndingWithoutDot xmlEndingWithoutDotPrefix;
70   -
71   - @Inject
72   - private XMLMissingPrefix xmlMissingPrefix;
73   -
74   - @Inject
75   - private XMLPrefixEndingWithDot xmlEndingWithDotPrefix;
76   -
77   - @Deployment
78   - public static JavaArchive createDeployment() {
79   - JavaArchive deployment = createConfigurationDeployment();
80   -
81   - deployment.addPackages(true, ConfigurationPrefixTest.class.getPackage());
82   - deployment.addAsResource(
83   - new FileAsset(new File("src/test/resources/configuration/prefix/demoiselle.properties")),
84   - "demoiselle.properties").addAsResource(
85   - new FileAsset(new File("src/test/resources/configuration/prefix/demoiselle.xml")),
86   - "demoiselle.xml");
87   -
88   - return deployment;
89   - }
90   -
91   - @Test
92   - public void loadFromPrefixedExistentProperty() {
93   - String expected = "prefix ending without dot";
94   -
95   - assertEquals(expected, propertyEndingWithoutDotPrefix.getPrefixedAttribute());
96   - assertEquals(expected, xmlEndingWithoutDotPrefix.getPrefixedAttribute());
97   - }
98   -
99   - @Test
100   - public void loadFromPrefixedWithouPrefixOnProperty() {
101   - assertNull(propertyMissingPrefix.getPrefixedAttribute());
102   - assertNull(xmlMissingPrefix.getPrefixedAttribute());
103   - }
104   -
105   - @Test
106   - public void loadPrefixEndingWithDot() {
107   - String expected = "prefix ending with dot";
108   -
109   - assertEquals(expected, propertyEndingWithDotPrefix.getPrefixedAttribute());
110   - assertEquals(expected, propertyEndingWithDotPrefix.getPrefixedAttribute());
111   - }
112   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/prefix/PropertyMissingPrefix.java
... ... @@ -1,7 +0,0 @@
1   -package br.gov.frameworkdemoiselle.configuration.prefix;
2   -
3   -import br.gov.frameworkdemoiselle.configuration.Configuration;
4   -
5   -@Configuration(prefix = "missing.prefix")
6   -public class PropertyMissingPrefix extends AbstractPrefixConfig {
7   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/prefix/PropertyPrefixEndingWithDot.java
... ... @@ -1,7 +0,0 @@
1   -package br.gov.frameworkdemoiselle.configuration.prefix;
2   -
3   -import br.gov.frameworkdemoiselle.configuration.Configuration;
4   -
5   -@Configuration(prefix = "endingWithDot.")
6   -public class PropertyPrefixEndingWithDot extends AbstractPrefixConfig {
7   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/prefix/PropertyPrefixEndingWithoutDot.java
... ... @@ -1,7 +0,0 @@
1   -package br.gov.frameworkdemoiselle.configuration.prefix;
2   -
3   -import br.gov.frameworkdemoiselle.configuration.Configuration;
4   -
5   -@Configuration(prefix = "prefix")
6   -public class PropertyPrefixEndingWithoutDot extends AbstractPrefixConfig {
7   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/prefix/XMLMissingPrefix.java
... ... @@ -1,8 +0,0 @@
1   -package br.gov.frameworkdemoiselle.configuration.prefix;
2   -
3   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.XML;
4   -import br.gov.frameworkdemoiselle.configuration.Configuration;
5   -
6   -@Configuration(type = XML, prefix = "missing.prefix")
7   -public class XMLMissingPrefix extends AbstractPrefixConfig {
8   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/prefix/XMLPrefixEndingWithDot.java
... ... @@ -1,8 +0,0 @@
1   -package br.gov.frameworkdemoiselle.configuration.prefix;
2   -
3   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.XML;
4   -import br.gov.frameworkdemoiselle.configuration.Configuration;
5   -
6   -@Configuration(type = XML, prefix = "endingWithDot.")
7   -public class XMLPrefixEndingWithDot extends AbstractPrefixConfig {
8   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/prefix/XMLPrefixEndingWithoutDot.java
... ... @@ -1,8 +0,0 @@
1   -package br.gov.frameworkdemoiselle.configuration.prefix;
2   -
3   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.XML;
4   -import br.gov.frameworkdemoiselle.configuration.Configuration;
5   -
6   -@Configuration(type = XML, prefix = "prefix")
7   -public class XMLPrefixEndingWithoutDot extends AbstractPrefixConfig {
8   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/resource/AbstractResourceConfig.java
... ... @@ -1,46 +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 br.gov.frameworkdemoiselle.configuration.resource;
38   -
39   -public abstract class AbstractResourceConfig {
40   -
41   - private String string;
42   -
43   - public String getStringWithComma() {
44   - return string;
45   - }
46   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/resource/ConfigurationResourceTest.java
... ... @@ -1,132 +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 br.gov.frameworkdemoiselle.configuration.resource;
38   -
39   -import static junit.framework.Assert.assertEquals;
40   -
41   -import java.io.File;
42   -
43   -import javax.inject.Inject;
44   -
45   -import org.jboss.arquillian.container.test.api.Deployment;
46   -import org.jboss.arquillian.junit.Arquillian;
47   -import org.jboss.shrinkwrap.api.asset.FileAsset;
48   -import org.jboss.shrinkwrap.api.spec.JavaArchive;
49   -import org.junit.Test;
50   -import org.junit.runner.RunWith;
51   -
52   -import br.gov.frameworkdemoiselle.configuration.AbstractConfigurationTest;
53   -
54   -@RunWith(Arquillian.class)
55   -public class ConfigurationResourceTest extends AbstractConfigurationTest {
56   -
57   - @Inject
58   - private PropertiesDefaultFileConfig propDefault;
59   -
60   - @Inject
61   - private PropertiesNamedDefaultFileConfig propNamedDefault;
62   -
63   - @Inject
64   - private PropertiesNotDefaultFileConfig propNotDefault;
65   -
66   - @Inject
67   - private PropertiesWithoutFileConfig propWithoutFile;
68   -
69   - @Inject
70   - private XMLDefaultFileConfig xmlDefault;
71   -
72   - @Inject
73   - private XMLNamedDefaultFileConfig xmlNamedDefault;
74   -
75   - @Inject
76   - private XMLNotDefaultFileConfig xmlNotDefault;
77   -
78   - @Inject
79   - private XMLWithoutFileConfig xmlWithoutFile;
80   -
81   - @Deployment
82   - public static JavaArchive createDeployment() {
83   - JavaArchive deployment = createConfigurationDeployment();
84   -
85   - deployment.addPackages(true, ConfigurationResourceTest.class.getPackage());
86   - deployment
87   - .addAsResource(
88   - new FileAsset(new File("src/test/resources/configuration/resource/demoiselle.properties")),
89   - "demoiselle.properties")
90   - .addAsResource(new FileAsset(new File("src/test/resources/configuration/resource/demoiselle.xml")),
91   - "demoiselle.xml")
92   - .addAsResource(
93   - new FileAsset(new File("src/test/resources/configuration/resource/resource.properties")),
94   - "resource.properties")
95   - .addAsResource(new FileAsset(new File("src/test/resources/configuration/resource/resource.xml")),
96   - "resource.xml");
97   -
98   - return deployment;
99   - }
100   -
101   - @Test
102   - public void loadFromDefaultFile() {
103   - String expected = "demoiselle";
104   -
105   - assertEquals(expected, propDefault.getStringWithComma());
106   - assertEquals(expected, xmlDefault.getStringWithComma());
107   - }
108   -
109   - @Test
110   - public void loadFromNamedDefaultFile() {
111   - String expected = "demoiselle";
112   -
113   - assertEquals(expected, propNamedDefault.getStringWithComma());
114   - assertEquals(expected, xmlNamedDefault.getStringWithComma());
115   - }
116   -
117   - @Test
118   - public void loadFromNotDefaultFile() {
119   - String expected = "demoiselle";
120   -
121   - assertEquals(expected, propNotDefault.getStringWithComma());
122   - assertEquals(expected, xmlNotDefault.getStringWithComma());
123   - }
124   -
125   - @Test
126   - public void loadFromNonexistentFile() {
127   - String expected = null;
128   -
129   - assertEquals(expected, propWithoutFile.getStringWithComma());
130   - assertEquals(expected, xmlWithoutFile.getStringWithComma());
131   - }
132   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/resource/PropertiesDefaultFileConfig.java
... ... @@ -1,45 +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 br.gov.frameworkdemoiselle.configuration.resource;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(type = PROPERTIES)
43   -public class PropertiesDefaultFileConfig extends AbstractResourceConfig {
44   -
45   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/resource/PropertiesNamedDefaultFileConfig.java
... ... @@ -1,45 +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 br.gov.frameworkdemoiselle.configuration.resource;
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 PropertiesNamedDefaultFileConfig extends AbstractResourceConfig {
44   -
45   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/resource/PropertiesNotDefaultFileConfig.java
... ... @@ -1,45 +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 br.gov.frameworkdemoiselle.configuration.resource;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(resource = "resource", type = PROPERTIES)
43   -public class PropertiesNotDefaultFileConfig extends AbstractResourceConfig {
44   -
45   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/resource/PropertiesWithoutFileConfig.java
... ... @@ -1,45 +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 br.gov.frameworkdemoiselle.configuration.resource;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.PROPERTIES;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(resource = "nofile", type = PROPERTIES)
43   -public class PropertiesWithoutFileConfig extends AbstractResourceConfig {
44   -
45   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/resource/XMLDefaultFileConfig.java
... ... @@ -1,45 +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 br.gov.frameworkdemoiselle.configuration.resource;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.XML;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(type = XML)
43   -public class XMLDefaultFileConfig extends AbstractResourceConfig {
44   -
45   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/resource/XMLNamedDefaultFileConfig.java
... ... @@ -1,45 +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 br.gov.frameworkdemoiselle.configuration.resource;
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 XMLNamedDefaultFileConfig extends AbstractResourceConfig {
44   -
45   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/resource/XMLNotDefaultFileConfig.java
... ... @@ -1,45 +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 br.gov.frameworkdemoiselle.configuration.resource;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.XML;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(resource = "resource", type = XML)
43   -public class XMLNotDefaultFileConfig extends AbstractResourceConfig {
44   -
45   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/resource/XMLWithoutFileConfig.java
... ... @@ -1,45 +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 br.gov.frameworkdemoiselle.configuration.resource;
38   -
39   -import static br.gov.frameworkdemoiselle.configuration.ConfigType.XML;
40   -import br.gov.frameworkdemoiselle.configuration.Configuration;
41   -
42   -@Configuration(resource = "nofile", type = XML)
43   -public class XMLWithoutFileConfig extends AbstractResourceConfig {
44   -
45   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/scope/AbstractScopedConfig.java
... ... @@ -1,49 +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 br.gov.frameworkdemoiselle.configuration.scope;
38   -
39   -import br.gov.frameworkdemoiselle.configuration.Configuration;
40   -
41   -@Configuration
42   -public abstract class AbstractScopedConfig {
43   -
44   - private String string;
45   -
46   - public String getStringWithComma() {
47   - return string;
48   - }
49   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/scope/ConfigurationScopeTest.java
... ... @@ -1,76 +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 br.gov.frameworkdemoiselle.configuration.scope;
38   -
39   -import static junit.framework.Assert.assertNotSame;
40   -import static junit.framework.Assert.assertSame;
41   -
42   -import org.jboss.arquillian.container.test.api.Deployment;
43   -import org.jboss.arquillian.junit.Arquillian;
44   -import org.jboss.shrinkwrap.api.spec.JavaArchive;
45   -import org.junit.Test;
46   -import org.junit.runner.RunWith;
47   -
48   -import br.gov.frameworkdemoiselle.configuration.AbstractConfigurationTest;
49   -import br.gov.frameworkdemoiselle.util.Beans;
50   -
51   -@RunWith(Arquillian.class)
52   -public class ConfigurationScopeTest extends AbstractConfigurationTest {
53   -
54   - @Deployment
55   - public static JavaArchive createDeployment() {
56   - JavaArchive deployment = createConfigurationDeployment();
57   - deployment.addPackages(true, ConfigurationScopeTest.class.getPackage());
58   - return deployment;
59   - }
60   -
61   - @Test
62   - public void twoInvocationsSameInstance() {
63   - DefaultScopeWithoutSuperClassConfig config1 = Beans.getReference(DefaultScopeWithoutSuperClassConfig.class);
64   - DefaultScopeWithoutSuperClassConfig config2 = Beans.getReference(DefaultScopeWithoutSuperClassConfig.class);
65   -
66   - assertSame(config1, config2);
67   - }
68   -
69   - @Test
70   - public void twoInvocationsDifferentInstances() {
71   - DependentScopeWithoutSuperClassConfig config1 = Beans.getReference(DependentScopeWithoutSuperClassConfig.class);
72   - DependentScopeWithoutSuperClassConfig config2 = Beans.getReference(DependentScopeWithoutSuperClassConfig.class);
73   -
74   - assertNotSame(config1, config2);
75   - }
76   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/scope/DefaultScopeWithoutSuperClassConfig.java
... ... @@ -1,49 +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 br.gov.frameworkdemoiselle.configuration.scope;
38   -
39   -import br.gov.frameworkdemoiselle.configuration.Configuration;
40   -
41   -@Configuration
42   -public class DefaultScopeWithoutSuperClassConfig {
43   -
44   - private String string;
45   -
46   - public String getString() {
47   - return string;
48   - }
49   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/scope/DependentScopeWithoutSuperClassConfig.java
... ... @@ -1,52 +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 br.gov.frameworkdemoiselle.configuration.scope;
38   -
39   -import javax.enterprise.context.Dependent;
40   -
41   -import br.gov.frameworkdemoiselle.configuration.Configuration;
42   -
43   -@Dependent
44   -@Configuration
45   -public class DependentScopeWithoutSuperClassConfig {
46   -
47   - private String string;
48   -
49   - public String getString() {
50   - return string;
51   - }
52   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/util/ExceptionsTest.java
... ... @@ -1,89 +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 br.gov.frameworkdemoiselle.util;
38   -
39   -import static org.junit.Assert.assertFalse;
40   -import static org.junit.Assert.assertTrue;
41   -import static org.junit.Assert.fail;
42   -
43   -import org.junit.Test;
44   -
45   -import br.gov.frameworkdemoiselle.exception.ApplicationException;
46   -
47   -public class ExceptionsTest {
48   -
49   - @Test
50   - public void testIsApplicationException() {
51   - assertTrue(Exceptions.isApplicationException(new MyException()));
52   - assertFalse(Exceptions.isApplicationException(new Exception()));
53   - }
54   -
55   - @Test
56   - public void testHandleRuntimeException() {
57   - try {
58   - Exceptions.handleToRuntimeException(new SomeRuntimeException());
59   - fail();
60   - } catch (Throwable t) {
61   - if (!RuntimeException.class.isInstance(t)) {
62   - fail();
63   - }
64   - }
65   -
66   - try {
67   - Exceptions.handleToRuntimeException(new Exception());
68   - fail();
69   - } catch (Throwable t) {
70   - if (!RuntimeException.class.isInstance(t)) {
71   - fail();
72   - }
73   - }
74   -
75   - }
76   -
77   -}
78   -
79   -@ApplicationException
80   -class MyException extends Exception {
81   -
82   - private static final long serialVersionUID = 1L;
83   -}
84   -
85   -class SomeRuntimeException extends RuntimeException {
86   -
87   - private static final long serialVersionUID = 1L;
88   -
89   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/util/ReflectionsTest.java
... ... @@ -1,73 +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 br.gov.frameworkdemoiselle.util;
38   -
39   -import static org.junit.Assert.assertEquals;
40   -
41   -import java.lang.reflect.Member;
42   -
43   -import org.junit.Test;
44   -
45   -public class ReflectionsTest {
46   -
47   - @Test
48   - public void testGetGenericTypeArgumentClass() {
49   - assertEquals(Long.class, Reflections.getGenericTypeArgument(OtherClass.class, 0));
50   - assertEquals(String.class, Reflections.getGenericTypeArgument(OtherClass.class, 1));
51   - }
52   -
53   - @Test
54   - public void testGetGenericTypeArgumentMember() throws SecurityException, NoSuchFieldException {
55   - Member[] members = OtherClass.class.getFields();
56   - assertEquals(Long.class, Reflections.getGenericTypeArgument(members[0], 0));
57   - assertEquals(String.class, Reflections.getGenericTypeArgument(members[1], 0));
58   - }
59   -}
60   -
61   -class SomeClass<T, I> {
62   -
63   - public void setNumber(T t) {
64   -
65   - }
66   -}
67   -
68   -class OtherClass extends SomeClass<Long, String> {
69   -
70   - public Class<Long> number;
71   -
72   - public Class<String> text;
73   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/util/ResourceBundleTest.java
... ... @@ -1,124 +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 br.gov.frameworkdemoiselle.util;
38   -
39   -import static org.junit.Assert.assertEquals;
40   -import static org.junit.Assert.assertFalse;
41   -import static org.junit.Assert.assertTrue;
42   -
43   -import java.util.Enumeration;
44   -import java.util.Locale;
45   -
46   -import org.junit.Before;
47   -import org.junit.Ignore;
48   -import org.junit.Test;
49   -
50   -@Ignore
51   -public class ResourceBundleTest {
52   -
53   - /**
54   - * This is a workaround to mock java.util.ResourceBundle. Since getString(key) method is defined as final, there is
55   - * no way to extend and override it. For that reason, setting expectations (i.e. expect(...)) won't work.
56   - */
57   - private ResourceBundle resourceBundle;
58   -
59   - @Before
60   - public void setUp() throws Exception {
61   - resourceBundle = new ResourceBundle("resource-bundle", new Locale("pt"));
62   - }
63   -
64   - @Test
65   - public void containsKey() {
66   - assertTrue(resourceBundle.containsKey("msgWithoutParams"));
67   -
68   - assertFalse(resourceBundle.containsKey("inexistentKey"));
69   - }
70   -
71   - @Test
72   - public void getKeys() {
73   - int keyCount = 0;
74   -
75   - Enumeration<String> e = resourceBundle.getKeys();
76   -
77   - while (e.hasMoreElements()) {
78   - keyCount++;
79   - e.nextElement();
80   - }
81   -
82   - assertEquals(resourceBundle.keySet().size(), keyCount);
83   - }
84   -
85   - @Test
86   - public void testGetLocale() {
87   - assertEquals(resourceBundle.getLocale(), new Locale("pt"));
88   - }
89   -
90   - @Test
91   - public void testKeySet() {
92   - assertEquals(2, resourceBundle.keySet().size());
93   - }
94   -
95   - @Test
96   - public void getString() {
97   - assertEquals("no params", resourceBundle.getString("msgWithoutParams"));
98   -
99   - assertEquals("params: a, b", resourceBundle.getString("msgWithParams", "a", "b"));
100   -
101   - assertEquals("params: {0}, {1}", resourceBundle.getString("msgWithParams"));
102   - }
103   -
104   - /**
105   - * For this test, java.util.ResourceBundle is mocked to force an exception. Since the getString method is called
106   - * from the actual ResourceBundle, not from the mock, it tries to find a handleGetObject method that doesn't exist.
107   - *
108   - * @throws Exception
109   - */
110   - // @Test(expected = RuntimeException.class)
111   - // public void getStringWhenHandleGetObjectThrowsException() {
112   - // mockResourceBundle = createMock(java.util.ResourceBundle.class);
113   - // resourceBundle = new ResourceBundle(mockResourceBundle);
114   - //
115   - // replay(mockResourceBundle);
116   - //
117   - // resourceBundle.getString("msgWithParams");
118   - //
119   - // verify(mockResourceBundle);
120   - //
121   - // Assert.fail();
122   - // }
123   -
124   -}
impl/core/src/test/java/br/gov/frameworkdemoiselle/util/StringsTest.java
... ... @@ -1,201 +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 br.gov.frameworkdemoiselle.util;
38   -
39   -import static org.junit.Assert.assertEquals;
40   -import static org.junit.Assert.assertFalse;
41   -import static org.junit.Assert.assertNull;
42   -import static org.junit.Assert.assertTrue;
43   -
44   -import org.junit.Test;
45   -
46   -import br.gov.frameworkdemoiselle.annotation.Ignore;
47   -
48   -public class StringsTest {
49   -
50   - @Test
51   - public void getString() {
52   - testEqualsGetString("teste", "teste");
53   - testEqualsGetString("", "");
54   - testEqualsGetString(null, null);
55   - testEqualsGetString(null, null, "teste");
56   - testEqualsGetString("{0}", "teste", "teste");
57   - testEqualsGetString("teste", "teste", (Object[]) null);
58   - testEqualsGetString("teste {0}", "teste 1", "1");
59   - testEqualsGetString("{0} teste", "Um teste", "Um");
60   - testEqualsGetString("{1} testando {0}", "Apenas testando novamente", "novamente", "Apenas");
61   - testEqualsGetString("{0} testando {1}", "Apenas testando {1}", "Apenas", null);
62   - testEqualsGetString("testando {1} novamente", "testando isto novamente", "aquilo", "isto");
63   - testEqualsGetString("teste", "teste", "1", "2");
64   - testEqualsGetString("teste {0}.", "teste \\.", "\\");
65   - }
66   -
67   - @Test
68   - public void isEmpty() {
69   - assertTrue(Strings.isEmpty(null));
70   - assertTrue(Strings.isEmpty(""));
71   - assertTrue(Strings.isEmpty(" "));
72   - assertTrue(Strings.isEmpty(" "));
73   -
74   - assertFalse(Strings.isEmpty(" _ "));
75   - assertFalse(Strings.isEmpty("."));
76   - assertFalse(Strings.isEmpty("null"));
77   - }
78   -
79   - @Test
80   - public void isResourceBundleKeyFormat() {
81   - assertTrue(Strings.isResourceBundleKeyFormat("{x}"));
82   - assertTrue(Strings.isResourceBundleKeyFormat("{.}"));
83   - assertTrue(Strings.isResourceBundleKeyFormat("{*}"));
84   - assertTrue(Strings.isResourceBundleKeyFormat("{$}"));
85   - assertFalse(Strings.isResourceBundleKeyFormat("{}"));
86   - assertFalse(Strings.isResourceBundleKeyFormat(""));
87   - assertFalse(Strings.isResourceBundleKeyFormat(" "));
88   - assertFalse(Strings.isResourceBundleKeyFormat(null));
89   - assertFalse(Strings.isResourceBundleKeyFormat("a{a}a"));
90   - assertFalse(Strings.isResourceBundleKeyFormat("a{a}"));
91   - assertFalse(Strings.isResourceBundleKeyFormat("{a}a"));
92   - assertFalse(Strings.isResourceBundleKeyFormat(" {a} "));
93   - assertFalse(Strings.isResourceBundleKeyFormat("{a"));
94   - assertFalse(Strings.isResourceBundleKeyFormat("a}"));
95   - }
96   -
97   - @Test
98   - public void camelCaseToSymbolSeparated() {
99   - assertEquals(null, Strings.camelCaseToSymbolSeparated(null, null));
100   - assertEquals(null, Strings.camelCaseToSymbolSeparated(null, "."));
101   - assertEquals("myvar", Strings.camelCaseToSymbolSeparated("myVar", null));
102   - assertEquals("myvar", Strings.camelCaseToSymbolSeparated("myVar", ""));
103   - assertEquals("my.var", Strings.camelCaseToSymbolSeparated("myVar", "."));
104   - assertEquals("my-var", Strings.camelCaseToSymbolSeparated("MyVar", "-"));
105   - assertEquals("my?var?name", Strings.camelCaseToSymbolSeparated("myVarName", "?"));
106   - assertEquals("my___var___name", Strings.camelCaseToSymbolSeparated("myVarName", "___"));
107   - }
108   -
109   - @Test
110   - public void firstToUpper() {
111   - assertNull(Strings.firstToUpper(null));
112   - assertEquals("", Strings.firstToUpper(""));
113   - assertEquals("A", Strings.firstToUpper("a"));
114   - assertEquals("A", Strings.firstToUpper("A"));
115   - assertEquals("Ab", Strings.firstToUpper("Ab"));
116   - assertEquals("AB", Strings.firstToUpper("AB"));
117   - assertEquals("Ab", Strings.firstToUpper("ab"));
118   - assertEquals("AB", Strings.firstToUpper("aB"));
119   - }
120   -
121   - @Test
122   - public void toStringWhenObjectIsNull() {
123   - assertEquals("", Strings.toString(null));
124   - }
125   -
126   - @Test
127   - public void classToString() throws SecurityException, NoSuchFieldException {
128   - @SuppressWarnings("unused")
129   - class Test {
130   -
131   - private String name = "myName";
132   -
133   - private String lastname = "myLastname";
134   -
135   - private String nullField = null;
136   -
137   - @Ignore
138   - private String ignore = "ignoreMe";
139   -
140   - }
141   -
142   - String result = Strings.toString(new Test());
143   - assertTrue(result.contains("Test [name=myName, lastname=myLastname, nullField=null, this"));
144   - }
145   -
146   - private void testEqualsGetString(String in, String expected, Object... params) {
147   - String out = Strings.getString(in, params);
148   - assertEquals(expected, out);
149   - }
150   -
151   - @Test
152   - public void removeBraces() {
153   - assertNull(Strings.removeBraces(null));
154   - assertEquals("", Strings.removeBraces(""));
155   - assertEquals(" ", Strings.removeBraces(" "));
156   - assertEquals(" {x} ", Strings.removeBraces(" {x} "));
157   - assertEquals("{x} ", Strings.removeBraces("{x} "));
158   - assertEquals(" {x}", Strings.removeBraces(" {x}"));
159   - assertEquals("x", Strings.removeBraces("{x}"));
160   - assertEquals("a b c", Strings.removeBraces("{a b c}"));
161   - assertEquals("{}", Strings.removeBraces("{}"));
162   - assertEquals("{}", Strings.removeBraces("{{}}"));
163   - assertEquals("?", Strings.removeBraces("{?}"));
164   - assertEquals("*", Strings.removeBraces("{*}"));
165   - }
166   -
167   - @Test
168   - public void insertBraces() {
169   - assertNull(Strings.insertBraces(null));
170   - assertEquals("", Strings.insertBraces(""));
171   - assertEquals(" ", Strings.insertBraces(" "));
172   - assertEquals("{ x }", Strings.insertBraces(" x "));
173   - assertEquals("{ {x} }", Strings.insertBraces(" {x} "));
174   - assertEquals("{{x}", Strings.insertBraces("{x"));
175   - assertEquals("{*}", Strings.insertBraces("*"));
176   - assertEquals("{?}", Strings.insertBraces("?"));
177   - }
178   -
179   - @Test
180   - public void removeCharsWhenStringIsNull() {
181   - assertEquals(null, Strings.removeChars(null, 'a'));
182   - }
183   -
184   - @Test
185   - public void removeCharsWhenStringIsNotNull() {
186   - String string = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus lobortis.";
187   - string = Strings.removeChars(string, 'L', 'l');
188   - assertEquals(-1, string.indexOf('L'));
189   - assertEquals(-1, string.indexOf('l'));
190   - }
191   -
192   - @Test
193   - public void insertZeros() {
194   - String string = "Lorem ipsum";
195   - assertEquals("00000", Strings.insertZeros(null, 5));
196   - assertEquals(string, Strings.insertZeros(string, string.length() - 1));
197   - assertEquals(string, Strings.insertZeros(string, string.length()));
198   - assertEquals("0" + string, Strings.insertZeros(string, string.length() + 1));
199   - assertEquals("00" + string, Strings.insertZeros(string, string.length() + 2));
200   - }
201   -}
impl/core/src/test/java/configuration/AbstractConfigurationTest.java 0 → 100644
... ... @@ -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;
  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/defaultvalue/AbstractDefaultValueConfig.java 0 → 100644
... ... @@ -0,0 +1,60 @@
  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.defaultvalue;
  38 +
  39 +public abstract class AbstractDefaultValueConfig {
  40 +
  41 + private String stringDefaultWithoutKey = "Initialized value and without key in the property file";
  42 +
  43 + private String stringDefaultWithKey = "Initialized value and key in the property file";
  44 +
  45 + public String getStringDefaultWithoutKey() {
  46 + return stringDefaultWithoutKey;
  47 + }
  48 +
  49 + public String getStringDefaultWithKey() {
  50 + return stringDefaultWithKey;
  51 + }
  52 +
  53 + public void setStringDefaultWithoutKey(String stringDefaultWithoutKey) {
  54 + this.stringDefaultWithoutKey = stringDefaultWithoutKey;
  55 + }
  56 +
  57 + public void setStringDefaultWithKey(String stringDefaultWithKey) {
  58 + this.stringDefaultWithKey = stringDefaultWithKey;
  59 + }
  60 +}
... ...
impl/core/src/test/java/configuration/defaultvalue/ConfigurationDefaultValueTest.java 0 → 100644
... ... @@ -0,0 +1,96 @@
  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.defaultvalue;
  38 +
  39 +import static junit.framework.Assert.assertEquals;
  40 +
  41 +import java.io.File;
  42 +
  43 +import javax.inject.Inject;
  44 +
  45 +import org.jboss.arquillian.container.test.api.Deployment;
  46 +import org.jboss.arquillian.junit.Arquillian;
  47 +import org.jboss.shrinkwrap.api.asset.FileAsset;
  48 +import org.jboss.shrinkwrap.api.spec.JavaArchive;
  49 +import org.junit.Test;
  50 +import org.junit.runner.RunWith;
  51 +
  52 +import configuration.AbstractConfigurationTest;
  53 +
  54 +
  55 +@RunWith(Arquillian.class)
  56 +public class ConfigurationDefaultValueTest extends AbstractConfigurationTest {
  57 +
  58 + @Inject
  59 + private FilledDefaultValueConfig filledFieldConfig;
  60 +
  61 + @Inject
  62 + private EmptyDefaultValueConfig emptyFieldsConfig;
  63 +
  64 + @Inject
  65 + private PropertyWithInexistenceFileConfig noFileConfig;
  66 +
  67 + @Deployment
  68 + public static JavaArchive createDeployment() {
  69 + JavaArchive deployment = createConfigurationDeployment();
  70 +
  71 + deployment.addPackages(true, ConfigurationDefaultValueTest.class.getPackage());
  72 + deployment.addAsResource(
  73 + new FileAsset(new File("src/test/resources/configuration/field/default/demoiselle.properties")),
  74 + "demoiselle.properties").addAsResource(
  75 + new FileAsset(new File("src/test/resources/configuration/field/default/demoiselle.xml")),
  76 + "demoiselle.xml");
  77 +
  78 + return deployment;
  79 + }
  80 +
  81 + @Test
  82 + public void loadDefaultValueWithoutKey() {
  83 + String expected = "Initialized value and without key in the property file";
  84 +
  85 + assertEquals(expected, filledFieldConfig.getStringDefaultWithoutKey());
  86 + assertEquals(expected, emptyFieldsConfig.getStringDefaultWithoutKey());
  87 + assertEquals(expected, noFileConfig.getStringDefaultWithoutKey());
  88 + }
  89 +
  90 + @Test
  91 + public void loadDefaultValueWithKey() {
  92 + assertEquals("Initialized value of the property file", filledFieldConfig.getStringDefaultWithKey());
  93 + assertEquals("Initialized value and key in the property file", noFileConfig.getStringDefaultWithKey());
  94 + assertEquals("", emptyFieldsConfig.getStringDefaultWithKey());
  95 + }
  96 +}
... ...
impl/core/src/test/java/configuration/defaultvalue/EmptyDefaultValueConfig.java 0 → 100644
... ... @@ -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.defaultvalue;
  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 EmptyDefaultValueConfig extends AbstractDefaultValueConfig {
  44 +}
... ...
impl/core/src/test/java/configuration/defaultvalue/FilledDefaultValueConfig.java 0 → 100644
... ... @@ -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.defaultvalue;
  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 FilledDefaultValueConfig extends AbstractDefaultValueConfig {
  44 +}
... ...
impl/core/src/test/java/configuration/defaultvalue/PropertyWithInexistenceFileConfig.java 0 → 100644
... ... @@ -0,0 +1,43 @@
  1 +/*
  2 + * Demoiselle Framework
  3 + * Copyright (C) 2010 SERPRO
  4 + * ----------------------------------------------------------------------------
  5 + * This file is part of Demoiselle Framework.
  6 + *
  7 + * Demoiselle Framework is free software; you can redistribute it and/or
  8 + * modify it under the terms of the GNU Lesser General Public License version 3
  9 + * as published by the Free Software Foundation.
  10 + *
  11 + * This program is distributed in the hope that it will be useful,
  12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14 + * GNU General Public License for more details.
  15 + *
  16 + * You should have received a copy of the GNU Lesser General Public License version 3
  17 + * along with this program; if not, see <http://www.gnu.org/licenses/>
  18 + * or write to the Free Software Foundation, Inc., 51 Franklin Street,
  19 + * Fifth Floor, Boston, MA 02110-1301, USA.
  20 + * ----------------------------------------------------------------------------
  21 + * Este arquivo é parte do Framework Demoiselle.
  22 + *
  23 + * O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou
  24 + * modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação
  25 + * do Software Livre (FSF).
  26 + *
  27 + * Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA
  28 + * GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou
  29 + * APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português
  30 + * para maiores detalhes.
  31 + *
  32 + * Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título
  33 + * "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses/>
  34 + * ou escreva para a Fundação do Software Livre (FSF) Inc.,
  35 + * 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA.
  36 + */
  37 +package configuration.defaultvalue;
  38 +
  39 +import br.gov.frameworkdemoiselle.configuration.Configuration;
  40 +
  41 +@Configuration(resource = "nofile")
  42 +public class PropertyWithInexistenceFileConfig extends AbstractDefaultValueConfig {
  43 +}
... ...
impl/core/src/test/java/configuration/field/array/AbstractArrayEmptyFieldConfig.java 0 → 100644
... ... @@ -0,0 +1,58 @@
  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.array;
  38 +
  39 +public abstract class AbstractArrayEmptyFieldConfig {
  40 +
  41 + private int[] emptyPrimitiveIntegers;
  42 +
  43 + private Integer[] emptyWrapperIntegers;
  44 +
  45 + private Integer[] errorTypeWrapperIntegers;
  46 +
  47 + public Integer[] getEmptyWrapperIntegers() {
  48 + return emptyWrapperIntegers;
  49 + }
  50 +
  51 + public int[] getEmptyPrimitiveIntegers() {
  52 + return emptyPrimitiveIntegers;
  53 + }
  54 +
  55 + public Integer[] getErrorTypeWrapperIntegers() {
  56 + return errorTypeWrapperIntegers;
  57 + }
  58 +}
... ...