Commit 699e1ae1742ead924e5a7316c31e4e47833b1f39
1 parent
4d0a3ad0
Exists in
master
Adição dos testes de atributos do tipo array carregados a partir de
arquivo .properties
Showing
1 changed file
with
26 additions
and
10 deletions
Show diff stats
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/array/ConfigurationArrayFieldTest.java
@@ -46,7 +46,6 @@ import org.jboss.arquillian.container.test.api.Deployment; | @@ -46,7 +46,6 @@ import org.jboss.arquillian.container.test.api.Deployment; | ||
46 | import org.jboss.arquillian.junit.Arquillian; | 46 | import org.jboss.arquillian.junit.Arquillian; |
47 | import org.jboss.shrinkwrap.api.asset.FileAsset; | 47 | import org.jboss.shrinkwrap.api.asset.FileAsset; |
48 | import org.jboss.shrinkwrap.api.spec.JavaArchive; | 48 | import org.jboss.shrinkwrap.api.spec.JavaArchive; |
49 | -import org.junit.Ignore; | ||
50 | import org.junit.Test; | 49 | import org.junit.Test; |
51 | import org.junit.runner.RunWith; | 50 | import org.junit.runner.RunWith; |
52 | 51 | ||
@@ -69,7 +68,6 @@ public class ConfigurationArrayFieldTest extends AbstractConfigurationTest { | @@ -69,7 +68,6 @@ public class ConfigurationArrayFieldTest extends AbstractConfigurationTest { | ||
69 | return deployment; | 68 | return deployment; |
70 | } | 69 | } |
71 | 70 | ||
72 | - @Ignore | ||
73 | @Test | 71 | @Test |
74 | public void loadPrimitiveInteger() { | 72 | public void loadPrimitiveInteger() { |
75 | int[] expected = { 1, 20, 0 }; | 73 | int[] expected = { 1, 20, 0 }; |
@@ -77,13 +75,31 @@ public class ConfigurationArrayFieldTest extends AbstractConfigurationTest { | @@ -77,13 +75,31 @@ public class ConfigurationArrayFieldTest extends AbstractConfigurationTest { | ||
77 | assertArrayEquals(expected, propertiesConfig.getPrimitiveIntegers()); | 75 | assertArrayEquals(expected, propertiesConfig.getPrimitiveIntegers()); |
78 | } | 76 | } |
79 | 77 | ||
80 | - // private int[] primitiveIntegers; | 78 | + @Test |
79 | + public void loadWrappedIntegers() { | ||
80 | + Integer[] expected = { -99, 0, 1 }; | ||
81 | + | ||
82 | + assertArrayEquals(expected, propertiesConfig.getWrappedIntegers()); | ||
83 | + } | ||
81 | 84 | ||
82 | - // private Integer[] wrappedIntegers; | ||
83 | - // | ||
84 | - // private String[] strings; | ||
85 | - // | ||
86 | - // private double[] primitiveDoubles; | ||
87 | - // | ||
88 | - // private Double[] wrappedDoubles; | 85 | + @Test |
86 | + public void loadString() { | ||
87 | + String[] expected = { "demoisele", "demoiselle framework", "demoiselle,framework", "demoiselle, framework" }; | ||
88 | + | ||
89 | + assertArrayEquals(expected, propertiesConfig.getStrings()); | ||
90 | + } | ||
91 | + | ||
92 | + @Test | ||
93 | + public void loadPrimitiveDoubles(){ | ||
94 | + double[] expected = { -10, 200000.99999, 0 }; | ||
95 | + | ||
96 | + assertArrayEquals(expected, propertiesConfig.getPrimitiveDoubles(), 0); | ||
97 | + } | ||
98 | + | ||
99 | + @Test | ||
100 | + public void loadWrappedDoubles() { | ||
101 | + Double[] expected = { -456.123456789, 0.0, 52.2 }; | ||
102 | + | ||
103 | + assertArrayEquals(expected, propertiesConfig.getWrappedDoubles()); | ||
104 | + } | ||
89 | } | 105 | } |