Commit 939bbda6cef0ba15abc202896ba973f1dec1d9bb
1 parent
c2109e92
Exists in
master
Adicionados testes de tipos básicos para o System
Showing
1 changed file
with
11 additions
and
3 deletions
Show diff stats
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/field/basic/ConfigurationBasicFieldTest.java
| ... | ... | @@ -10,6 +10,7 @@ import org.jboss.arquillian.container.test.api.Deployment; |
| 10 | 10 | import org.jboss.arquillian.junit.Arquillian; |
| 11 | 11 | import org.jboss.shrinkwrap.api.asset.FileAsset; |
| 12 | 12 | import org.jboss.shrinkwrap.api.spec.JavaArchive; |
| 13 | +import org.junit.BeforeClass; | |
| 13 | 14 | import org.junit.Test; |
| 14 | 15 | import org.junit.runner.RunWith; |
| 15 | 16 | |
| ... | ... | @@ -40,20 +41,23 @@ public class ConfigurationBasicFieldTest extends AbstractConfigurationTest { |
| 40 | 41 | |
| 41 | 42 | return deployment; |
| 42 | 43 | } |
| 43 | - | |
| 44 | + | |
| 44 | 45 | @Test |
| 45 | 46 | public void loadPrimitiveInteger() { |
| 46 | 47 | int expected = 1; |
| 48 | + System.setProperty("primitiveInteger", String.valueOf(expected)); | |
| 47 | 49 | |
| 50 | + assertEquals(expected, systemConfig.getPrimitiveInteger()); | |
| 48 | 51 | assertEquals(expected, propertiesConfig.getPrimitiveInteger()); |
| 49 | 52 | assertEquals(expected, xmlConfig.getPrimitiveInteger()); |
| 50 | - //assertEquals("01748913506", systemConfig.getUserName()); | |
| 51 | 53 | } |
| 52 | 54 | |
| 53 | 55 | @Test |
| 54 | 56 | public void loadWrappedInteger() { |
| 55 | 57 | Integer expected = 2; |
| 58 | + System.setProperty("wrappedInteger", String.valueOf(expected)); | |
| 56 | 59 | |
| 60 | + assertEquals(expected, systemConfig.getWrappedInteger()); | |
| 57 | 61 | assertEquals(expected, propertiesConfig.getWrappedInteger()); |
| 58 | 62 | assertEquals(expected, xmlConfig.getWrappedInteger()); |
| 59 | 63 | } |
| ... | ... | @@ -61,15 +65,19 @@ public class ConfigurationBasicFieldTest extends AbstractConfigurationTest { |
| 61 | 65 | @Test |
| 62 | 66 | public void loadStringWithSpace() { |
| 63 | 67 | String expected = "demoiselle framework"; |
| 68 | + System.setProperty("stringWithSpace", String.valueOf(expected)); | |
| 64 | 69 | |
| 70 | + assertEquals(expected, systemConfig.getStringWithSpace()); | |
| 65 | 71 | assertEquals(expected, propertiesConfig.getStringWithSpace()); |
| 66 | 72 | assertEquals(expected, xmlConfig.getStringWithSpace()); |
| 67 | 73 | } |
| 68 | 74 | |
| 69 | -// @Test | |
| 75 | + //@Test | |
| 70 | 76 | public void loadStringWithComma() { |
| 71 | 77 | String expected = "demoiselle,framework"; |
| 78 | + System.setProperty("stringWithComma", String.valueOf(expected)); | |
| 72 | 79 | |
| 80 | + assertEquals(expected, systemConfig.getStringWithComma()); | |
| 73 | 81 | assertEquals(expected, propertiesConfig.getStringWithComma()); |
| 74 | 82 | assertEquals(expected, xmlConfig.getStringWithComma()); |
| 75 | 83 | } | ... | ... |