Commit 6c90896b6bfef15a978fc8fdb6230ed1434720d5
1 parent
63481c19
Exists in
master
Organização do código (formatação + import)
Showing
14 changed files
with
33 additions
and
52 deletions
Show diff stats
impl/core/src/test/java/configuration/defaultvalue/ConfigurationDefaultValueTest.java
impl/core/src/test/java/configuration/field/array/AbstractArrayEmptyFieldConfig.java
| ... | ... | @@ -39,11 +39,11 @@ package configuration.field.array; |
| 39 | 39 | public abstract class AbstractArrayEmptyFieldConfig { |
| 40 | 40 | |
| 41 | 41 | private int[] emptyPrimitiveIntegers; |
| 42 | - | |
| 42 | + | |
| 43 | 43 | private Integer[] emptyWrapperIntegers; |
| 44 | - | |
| 44 | + | |
| 45 | 45 | private Integer[] errorTypeWrapperIntegers; |
| 46 | - | |
| 46 | + | |
| 47 | 47 | public Integer[] getEmptyWrapperIntegers() { |
| 48 | 48 | return emptyWrapperIntegers; |
| 49 | 49 | } | ... | ... |
impl/core/src/test/java/configuration/field/array/ConfigurationArrayFieldTest.java
| ... | ... | @@ -53,18 +53,17 @@ import org.jboss.shrinkwrap.api.spec.JavaArchive; |
| 53 | 53 | import org.junit.Test; |
| 54 | 54 | import org.junit.runner.RunWith; |
| 55 | 55 | |
| 56 | -import configuration.AbstractConfigurationTest; | |
| 57 | - | |
| 58 | 56 | import br.gov.frameworkdemoiselle.configuration.ConfigurationException; |
| 57 | +import configuration.AbstractConfigurationTest; | |
| 59 | 58 | |
| 60 | 59 | @RunWith(Arquillian.class) |
| 61 | 60 | public class ConfigurationArrayFieldTest extends AbstractConfigurationTest { |
| 62 | 61 | |
| 63 | 62 | @Inject |
| 64 | 63 | private PropertiesArrayFieldConfig propertiesConfig; |
| 65 | - | |
| 64 | + | |
| 66 | 65 | @Inject |
| 67 | - private PropertiesArrayEmptyFieldConfig propertiesNullConfig; | |
| 66 | + private PropertiesArrayEmptyFieldConfig propertiesNullConfig; | |
| 68 | 67 | |
| 69 | 68 | @Inject |
| 70 | 69 | private XMLArrayFieldConfig xmlConfig; |
| ... | ... | @@ -122,13 +121,13 @@ public class ConfigurationArrayFieldTest extends AbstractConfigurationTest { |
| 122 | 121 | assertArrayEquals(expected, propertiesConfig.getWrappedDoubles()); |
| 123 | 122 | assertArrayEquals(expected, xmlConfig.getWrappedDoubles()); |
| 124 | 123 | } |
| 125 | - | |
| 124 | + | |
| 126 | 125 | @Test |
| 127 | - public void loadEmptyString() { | |
| 126 | + public void loadEmptyString() { | |
| 128 | 127 | String[] expected = { "demoisele", "" }; |
| 129 | 128 | assertArrayEquals(expected, propertiesConfig.getEmptyStrings()); |
| 130 | 129 | } |
| 131 | - | |
| 130 | + | |
| 132 | 131 | @Test |
| 133 | 132 | public void loadEmptyPrimitive() { |
| 134 | 133 | try { |
| ... | ... | @@ -138,9 +137,9 @@ public class ConfigurationArrayFieldTest extends AbstractConfigurationTest { |
| 138 | 137 | assertEquals(ConversionException.class, cause.getCause().getClass()); |
| 139 | 138 | } |
| 140 | 139 | } |
| 141 | - | |
| 140 | + | |
| 142 | 141 | @Test |
| 143 | - public void loadEmptyWrapper() { | |
| 142 | + public void loadEmptyWrapper() { | |
| 144 | 143 | try { |
| 145 | 144 | propertiesNullConfig.getEmptyWrapperIntegers(); |
| 146 | 145 | Assert.fail(); |
| ... | ... | @@ -148,14 +147,14 @@ public class ConfigurationArrayFieldTest extends AbstractConfigurationTest { |
| 148 | 147 | assertEquals(ConversionException.class, cause.getCause().getClass()); |
| 149 | 148 | } |
| 150 | 149 | } |
| 151 | - | |
| 150 | + | |
| 152 | 151 | @Test |
| 153 | - public void loadErrorTypeWrapper() { | |
| 152 | + public void loadErrorTypeWrapper() { | |
| 154 | 153 | try { |
| 155 | 154 | propertiesNullConfig.getErrorTypeWrapperIntegers(); |
| 156 | 155 | Assert.fail(); |
| 157 | 156 | } catch (ConfigurationException cause) { |
| 158 | 157 | assertEquals(ConversionException.class, cause.getCause().getClass()); |
| 159 | 158 | } |
| 160 | - } | |
| 159 | + } | |
| 161 | 160 | } | ... | ... |
impl/core/src/test/java/configuration/field/clazz/ConfigurationClassFieldTest.java
| ... | ... | @@ -50,9 +50,8 @@ import org.jboss.shrinkwrap.api.spec.JavaArchive; |
| 50 | 50 | import org.junit.Test; |
| 51 | 51 | import org.junit.runner.RunWith; |
| 52 | 52 | |
| 53 | -import configuration.AbstractConfigurationTest; | |
| 54 | - | |
| 55 | 53 | import br.gov.frameworkdemoiselle.configuration.ConfigurationException; |
| 54 | +import configuration.AbstractConfigurationTest; | |
| 56 | 55 | |
| 57 | 56 | @RunWith(Arquillian.class) |
| 58 | 57 | public class ConfigurationClassFieldTest extends AbstractConfigurationTest { | ... | ... |
impl/core/src/test/java/configuration/field/custom/ConfigurationCustomFieldTest.java
| ... | ... | @@ -51,9 +51,8 @@ import org.jboss.shrinkwrap.api.spec.JavaArchive; |
| 51 | 51 | import org.junit.Test; |
| 52 | 52 | import org.junit.runner.RunWith; |
| 53 | 53 | |
| 54 | -import configuration.AbstractConfigurationTest; | |
| 55 | - | |
| 56 | 54 | import br.gov.frameworkdemoiselle.configuration.ConfigurationException; |
| 55 | +import configuration.AbstractConfigurationTest; | |
| 57 | 56 | |
| 58 | 57 | @RunWith(Arquillian.class) |
| 59 | 58 | public class ConfigurationCustomFieldTest extends AbstractConfigurationTest { | ... | ... |
impl/core/src/test/java/configuration/field/ignored/ConfigurationIgnoredFieldTest.java
impl/core/src/test/java/configuration/field/map/ConfigurationMapFieldTest.java
| ... | ... | @@ -43,7 +43,6 @@ import java.util.HashMap; |
| 43 | 43 | import java.util.Map; |
| 44 | 44 | |
| 45 | 45 | import javax.inject.Inject; |
| 46 | -import javax.validation.constraints.Size; | |
| 47 | 46 | |
| 48 | 47 | import org.jboss.arquillian.container.test.api.Deployment; |
| 49 | 48 | import org.jboss.arquillian.junit.Arquillian; |
| ... | ... | @@ -54,7 +53,6 @@ import org.junit.runner.RunWith; |
| 54 | 53 | |
| 55 | 54 | import configuration.AbstractConfigurationTest; |
| 56 | 55 | |
| 57 | - | |
| 58 | 56 | @RunWith(Arquillian.class) |
| 59 | 57 | public class ConfigurationMapFieldTest extends AbstractConfigurationTest { |
| 60 | 58 | ... | ... |
impl/core/src/test/java/configuration/field/named/ConfigurationNamedFieldTest.java
| ... | ... | @@ -43,8 +43,6 @@ import java.io.File; |
| 43 | 43 | |
| 44 | 44 | import javax.inject.Inject; |
| 45 | 45 | |
| 46 | -import junit.framework.Assert; | |
| 47 | - | |
| 48 | 46 | import org.jboss.arquillian.container.test.api.Deployment; |
| 49 | 47 | import org.jboss.arquillian.junit.Arquillian; |
| 50 | 48 | import org.jboss.shrinkwrap.api.asset.FileAsset; |
| ... | ... | @@ -52,9 +50,8 @@ import org.jboss.shrinkwrap.api.spec.JavaArchive; |
| 52 | 50 | import org.junit.Test; |
| 53 | 51 | import org.junit.runner.RunWith; |
| 54 | 52 | |
| 55 | -import configuration.AbstractConfigurationTest; | |
| 56 | - | |
| 57 | 53 | import br.gov.frameworkdemoiselle.configuration.ConfigurationException; |
| 54 | +import configuration.AbstractConfigurationTest; | |
| 58 | 55 | |
| 59 | 56 | @RunWith(Arquillian.class) |
| 60 | 57 | public class ConfigurationNamedFieldTest extends AbstractConfigurationTest { | ... | ... |
impl/core/src/test/java/configuration/field/notnull/ConfigurationNotNullFieldTest.java
| ... | ... | @@ -52,9 +52,8 @@ import org.jboss.shrinkwrap.api.spec.JavaArchive; |
| 52 | 52 | import org.junit.Test; |
| 53 | 53 | import org.junit.runner.RunWith; |
| 54 | 54 | |
| 55 | -import configuration.AbstractConfigurationTest; | |
| 56 | - | |
| 57 | 55 | import br.gov.frameworkdemoiselle.configuration.ConfigurationException; |
| 56 | +import configuration.AbstractConfigurationTest; | |
| 58 | 57 | |
| 59 | 58 | @RunWith(Arquillian.class) |
| 60 | 59 | public class ConfigurationNotNullFieldTest extends AbstractConfigurationTest { |
| ... | ... | @@ -106,8 +105,7 @@ public class ConfigurationNotNullFieldTest extends AbstractConfigurationTest { |
| 106 | 105 | new FileAsset(new File("src/test/resources/configuration/field/notnull/empty-field.xml")), |
| 107 | 106 | "empty-field.xml") |
| 108 | 107 | .addAsResource( |
| 109 | - new FileAsset(new File( | |
| 110 | - "src/test/resources/configuration/field/notnull/without-field.xml")), | |
| 108 | + new FileAsset(new File("src/test/resources/configuration/field/notnull/without-field.xml")), | |
| 111 | 109 | "without-field.xml"); |
| 112 | 110 | |
| 113 | 111 | return deployment; |
| ... | ... | @@ -163,7 +161,7 @@ public class ConfigurationNotNullFieldTest extends AbstractConfigurationTest { |
| 163 | 161 | } catch (ConfigurationException cause) { |
| 164 | 162 | Assert.assertEquals(NullPointerException.class, cause.getCause().getClass()); |
| 165 | 163 | } |
| 166 | - | |
| 164 | + | |
| 167 | 165 | try { |
| 168 | 166 | xmlNoFileConfig.getAttributeNotNull(); |
| 169 | 167 | fail(); | ... | ... |
impl/core/src/test/java/configuration/field/primitiveorwrapper/ConfigurationPrimitiveOrWrapperFieldTest.java
| ... | ... | @@ -52,9 +52,8 @@ import org.junit.BeforeClass; |
| 52 | 52 | import org.junit.Test; |
| 53 | 53 | import org.junit.runner.RunWith; |
| 54 | 54 | |
| 55 | -import configuration.AbstractConfigurationTest; | |
| 56 | - | |
| 57 | 55 | import br.gov.frameworkdemoiselle.configuration.ConfigurationException; |
| 56 | +import configuration.AbstractConfigurationTest; | |
| 58 | 57 | |
| 59 | 58 | @RunWith(Arquillian.class) |
| 60 | 59 | public class ConfigurationPrimitiveOrWrapperFieldTest extends AbstractConfigurationTest { |
| ... | ... | @@ -127,18 +126,18 @@ public class ConfigurationPrimitiveOrWrapperFieldTest extends AbstractConfigurat |
| 127 | 126 | } catch (ConfigurationException cause) { |
| 128 | 127 | assertEquals(ConversionException.class, cause.getCause().getClass()); |
| 129 | 128 | } |
| 130 | - | |
| 129 | + | |
| 131 | 130 | try { |
| 132 | 131 | propertiesErrorConfig.getEmptyPrimitiveInteger(); |
| 133 | 132 | } catch (ConfigurationException cause) { |
| 134 | 133 | assertEquals(ConversionException.class, cause.getCause().getClass()); |
| 135 | 134 | } |
| 136 | - | |
| 135 | + | |
| 137 | 136 | try { |
| 138 | 137 | propertiesErrorConfig.getEmptyPrimitiveInteger(); |
| 139 | 138 | } catch (ConfigurationException cause) { |
| 140 | 139 | assertEquals(ConversionException.class, cause.getCause().getClass()); |
| 141 | - } | |
| 140 | + } | |
| 142 | 141 | } |
| 143 | 142 | |
| 144 | 143 | @Test |
| ... | ... | @@ -148,13 +147,13 @@ public class ConfigurationPrimitiveOrWrapperFieldTest extends AbstractConfigurat |
| 148 | 147 | } catch (ConfigurationException cause) { |
| 149 | 148 | assertEquals(ConversionException.class, cause.getCause().getClass()); |
| 150 | 149 | } |
| 151 | - | |
| 150 | + | |
| 152 | 151 | try { |
| 153 | 152 | propertiesErrorConfig.getEmptyWrappedInteger(); |
| 154 | 153 | } catch (ConfigurationException cause) { |
| 155 | 154 | assertEquals(ConversionException.class, cause.getCause().getClass()); |
| 156 | 155 | } |
| 157 | - | |
| 156 | + | |
| 158 | 157 | try { |
| 159 | 158 | propertiesErrorConfig.getEmptyWrappedInteger(); |
| 160 | 159 | } catch (ConfigurationException cause) { | ... | ... |
impl/core/src/test/java/configuration/field/string/ConfigurationStringFieldTest.java
| ... | ... | @@ -52,7 +52,6 @@ import org.junit.runner.RunWith; |
| 52 | 52 | |
| 53 | 53 | import configuration.AbstractConfigurationTest; |
| 54 | 54 | |
| 55 | - | |
| 56 | 55 | @RunWith(Arquillian.class) |
| 57 | 56 | public class ConfigurationStringFieldTest extends AbstractConfigurationTest { |
| 58 | 57 | |
| ... | ... | @@ -103,12 +102,12 @@ public class ConfigurationStringFieldTest extends AbstractConfigurationTest { |
| 103 | 102 | assertEquals(expected, propertiesConfig.getStringWithComma()); |
| 104 | 103 | assertEquals(expected, xmlConfig.getStringWithComma()); |
| 105 | 104 | } |
| 106 | - | |
| 105 | + | |
| 107 | 106 | @Test |
| 108 | 107 | public void loadEmptyString() { |
| 109 | 108 | String expected = ""; |
| 110 | 109 | assertEquals(expected, systemConfig.getEmptyString()); |
| 111 | 110 | assertEquals(expected, propertiesConfig.getEmptyString()); |
| 112 | 111 | assertEquals(expected, xmlConfig.getEmptyString()); |
| 113 | - } | |
| 112 | + } | |
| 114 | 113 | } | ... | ... |
impl/core/src/test/java/configuration/prefix/ConfigurationPrefixTest.java
| ... | ... | @@ -52,7 +52,6 @@ import org.junit.runner.RunWith; |
| 52 | 52 | |
| 53 | 53 | import configuration.AbstractConfigurationTest; |
| 54 | 54 | |
| 55 | - | |
| 56 | 55 | @RunWith(Arquillian.class) |
| 57 | 56 | public class ConfigurationPrefixTest extends AbstractConfigurationTest { |
| 58 | 57 | |
| ... | ... | @@ -64,8 +63,7 @@ public class ConfigurationPrefixTest extends AbstractConfigurationTest { |
| 64 | 63 | |
| 65 | 64 | @Inject |
| 66 | 65 | private PropertyPrefixEndingWithDot propertyEndingWithDotPrefix; |
| 67 | - | |
| 68 | - | |
| 66 | + | |
| 69 | 67 | @Inject |
| 70 | 68 | private XMLPrefixEndingWithoutDot xmlEndingWithoutDotPrefix; |
| 71 | 69 | |
| ... | ... | @@ -83,8 +81,7 @@ public class ConfigurationPrefixTest extends AbstractConfigurationTest { |
| 83 | 81 | deployment.addAsResource( |
| 84 | 82 | new FileAsset(new File("src/test/resources/configuration/prefix/demoiselle.properties")), |
| 85 | 83 | "demoiselle.properties").addAsResource( |
| 86 | - new FileAsset(new File("src/test/resources/configuration/prefix/demoiselle.xml")), | |
| 87 | - "demoiselle.xml"); | |
| 84 | + new FileAsset(new File("src/test/resources/configuration/prefix/demoiselle.xml")), "demoiselle.xml"); | |
| 88 | 85 | |
| 89 | 86 | return deployment; |
| 90 | 87 | } |
| ... | ... | @@ -92,7 +89,7 @@ public class ConfigurationPrefixTest extends AbstractConfigurationTest { |
| 92 | 89 | @Test |
| 93 | 90 | public void loadFromPrefixedExistentProperty() { |
| 94 | 91 | String expected = "prefix ending without dot"; |
| 95 | - | |
| 92 | + | |
| 96 | 93 | assertEquals(expected, propertyEndingWithoutDotPrefix.getPrefixedAttribute()); |
| 97 | 94 | assertEquals(expected, xmlEndingWithoutDotPrefix.getPrefixedAttribute()); |
| 98 | 95 | } |
| ... | ... | @@ -106,7 +103,7 @@ public class ConfigurationPrefixTest extends AbstractConfigurationTest { |
| 106 | 103 | @Test |
| 107 | 104 | public void loadPrefixEndingWithDot() { |
| 108 | 105 | String expected = "prefix ending with dot"; |
| 109 | - | |
| 106 | + | |
| 110 | 107 | assertEquals(expected, propertyEndingWithDotPrefix.getPrefixedAttribute()); |
| 111 | 108 | assertEquals(expected, propertyEndingWithDotPrefix.getPrefixedAttribute()); |
| 112 | 109 | } | ... | ... |
impl/core/src/test/java/configuration/resource/ConfigurationResourceTest.java
impl/core/src/test/java/configuration/scope/ConfigurationScopeTest.java
| ... | ... | @@ -45,9 +45,8 @@ import org.jboss.shrinkwrap.api.spec.JavaArchive; |
| 45 | 45 | import org.junit.Test; |
| 46 | 46 | import org.junit.runner.RunWith; |
| 47 | 47 | |
| 48 | -import configuration.AbstractConfigurationTest; | |
| 49 | - | |
| 50 | 48 | import br.gov.frameworkdemoiselle.util.Beans; |
| 49 | +import configuration.AbstractConfigurationTest; | |
| 51 | 50 | |
| 52 | 51 | @RunWith(Arquillian.class) |
| 53 | 52 | public class ConfigurationScopeTest extends AbstractConfigurationTest { | ... | ... |