Commit a5fd4ba2f3f3708979e53db2cc3064698f44fdac

Authored by Emerson Oliveira
1 parent d0568bd5
Exists in master

Adicionados mais testes para carregamento de valores default de

configurações
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/defaultvalue/AbstractDefaultValueConfig.java
@@ -39,9 +39,9 @@ package br.gov.frameworkdemoiselle.configuration.defaultvalue; @@ -39,9 +39,9 @@ package br.gov.frameworkdemoiselle.configuration.defaultvalue;
39 39
40 public abstract class AbstractDefaultValueConfig { 40 public abstract class AbstractDefaultValueConfig {
41 41
42 - private String stringDefaultWithoutKey = "Valor inicializado e sem chave em arquivo de propriedade"; 42 + private String stringDefaultWithoutKey = "Initialized value and without key in the property file";
43 43
44 - private String stringDefaultWithKey = "Valor inicializado e com chave em arquivo de propriedade"; 44 + private String stringDefaultWithKey = "Initialized value and key in the property file";
45 45
46 public String getStringDefaultWithoutKey() { 46 public String getStringDefaultWithoutKey() {
47 return stringDefaultWithoutKey; 47 return stringDefaultWithoutKey;
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/defaultvalue/ConfigurationDefaultValueTest.java
@@ -81,20 +81,17 @@ public class ConfigurationDefaultValueTest extends AbstractConfigurationTest { @@ -81,20 +81,17 @@ public class ConfigurationDefaultValueTest extends AbstractConfigurationTest {
81 81
82 @Test 82 @Test
83 public void loadDefaultValueWithoutKey(){ 83 public void loadDefaultValueWithoutKey(){
84 - String expected = "Valor inicializado e sem chave em arquivo de propriedade"; 84 + String expected = "Initialized value and without key in the property file";
85 85
86 assertEquals(expected, filledFieldConfig.getStringDefaultWithoutKey()); 86 assertEquals(expected, filledFieldConfig.getStringDefaultWithoutKey());
87 assertEquals(expected, emptyFieldsConfig.getStringDefaultWithoutKey()); 87 assertEquals(expected, emptyFieldsConfig.getStringDefaultWithoutKey());
88 assertEquals(expected, noFileConfig.getStringDefaultWithoutKey()); 88 assertEquals(expected, noFileConfig.getStringDefaultWithoutKey());
89 } 89 }
90 90
91 - @Ignore  
92 - @Test(expected = ConfigurationException.class)  
93 - /*TODO: Lançar exceção quando uma chave adicionada em arquivo de configuração não  
94 - * tiver valor associado*/ 91 + @Test
95 public void loadDefaultValueWithKey(){ 92 public void loadDefaultValueWithKey(){
96 - assertEquals("Valor inicializado do arquivo de propriedade", filledFieldConfig.getStringDefaultWithKey());  
97 - assertEquals("Valor inicializado e com chave em arquivo de propriedade", noFileConfig.getStringDefaultWithKey());  
98 - emptyFieldsConfig.getStringDefaultWithKey(); 93 + assertEquals("Initialized value of the property file", filledFieldConfig.getStringDefaultWithKey());
  94 + assertEquals("Initialized value and key in the property file", noFileConfig.getStringDefaultWithKey());
  95 + assertEquals("", emptyFieldsConfig.getStringDefaultWithKey());
99 } 96 }
100 } 97 }
impl/core/src/test/resources/configuration/field/default/demoiselle.properties
@@ -33,4 +33,4 @@ @@ -33,4 +33,4 @@
33 # ou escreva para a Fundação do Software Livre (FSF) Inc., 33 # ou escreva para a Fundação do Software Livre (FSF) Inc.,
34 # 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. 34 # 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA.
35 35
36 -stringDefaultWithKey=Valor inicializado do arquivo de propriedade 36 +stringDefaultWithKey=Initialized value of the property file