Commit 875da31182092a22e269f85a85cc93b08f5fc212
Exists in
master
Merge branch '2.4.0' of git@github.com:demoiselle/framework.git into 2.4.0
Showing
2 changed files
with
14 additions
and
9 deletions
Show diff stats
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/ConfigurationImpl.java
| ... | ... | @@ -49,10 +49,17 @@ public class ConfigurationImpl implements Serializable { |
| 49 | 49 | private boolean loaded = false; |
| 50 | 50 | |
| 51 | 51 | @SuppressWarnings("unused") |
| 52 | - private synchronized void load(Object instance) { | |
| 52 | + private synchronized void load(Object instance) throws Throwable { | |
| 53 | 53 | if (!loaded) { |
| 54 | - Beans.getReference(ConfigurationLoader.class).load(instance); | |
| 55 | 54 | loaded = true; |
| 55 | + | |
| 56 | + try { | |
| 57 | + Beans.getReference(ConfigurationLoader.class).load(instance); | |
| 58 | + | |
| 59 | + } catch (Throwable cause) { | |
| 60 | + loaded = false; | |
| 61 | + throw cause; | |
| 62 | + } | |
| 56 | 63 | } |
| 57 | 64 | } |
| 58 | 65 | } | ... | ... |
impl/core/src/test/java/configuration/field/beanvalidation/ConfigurationBeanValidationFieldTest.java
| ... | ... | @@ -42,8 +42,6 @@ import static junit.framework.Assert.fail; |
| 42 | 42 | import javax.inject.Inject; |
| 43 | 43 | import javax.validation.ConstraintViolationException; |
| 44 | 44 | |
| 45 | -import junit.framework.Assert; | |
| 46 | - | |
| 47 | 45 | import org.jboss.arquillian.container.test.api.Deployment; |
| 48 | 46 | import org.jboss.arquillian.junit.Arquillian; |
| 49 | 47 | import org.jboss.shrinkwrap.api.spec.JavaArchive; |
| ... | ... | @@ -107,14 +105,14 @@ public class ConfigurationBeanValidationFieldTest { |
| 107 | 105 | propertyBeanValidationWithEmptyNotNullFieldConfig.getIntAttributeNull(); |
| 108 | 106 | fail(); |
| 109 | 107 | } catch (ConfigurationException cause) { |
| 110 | - Assert.assertEquals(ConstraintViolationException.class, cause.getCause().getClass()); | |
| 108 | + assertEquals(ConstraintViolationException.class, cause.getCause().getClass()); | |
| 111 | 109 | } |
| 112 | 110 | |
| 113 | 111 | try { |
| 114 | 112 | xmlBeanValidationWithEmptyNotNullFieldConfig.getIntAttributeNull(); |
| 115 | 113 | fail(); |
| 116 | 114 | } catch (ConfigurationException cause) { |
| 117 | - Assert.assertEquals(ConstraintViolationException.class, cause.getCause().getClass()); | |
| 115 | + assertEquals(ConstraintViolationException.class, cause.getCause().getClass()); | |
| 118 | 116 | } |
| 119 | 117 | } |
| 120 | 118 | |
| ... | ... | @@ -124,14 +122,14 @@ public class ConfigurationBeanValidationFieldTest { |
| 124 | 122 | propertyBeanValidationWithEmptyNotNullFieldConfig.getStringAttributeNull(); |
| 125 | 123 | fail(); |
| 126 | 124 | } catch (ConfigurationException cause) { |
| 127 | - Assert.assertEquals(ConstraintViolationException.class, cause.getCause().getClass()); | |
| 125 | + assertEquals(ConstraintViolationException.class, cause.getCause().getClass()); | |
| 128 | 126 | } |
| 129 | 127 | |
| 130 | 128 | try { |
| 131 | 129 | xmlBeanValidationWithEmptyNotNullFieldConfig.getStringAttributeNull(); |
| 132 | 130 | fail(); |
| 133 | 131 | } catch (ConfigurationException cause) { |
| 134 | - Assert.assertEquals(ConstraintViolationException.class, cause.getCause().getClass()); | |
| 132 | + assertEquals(ConstraintViolationException.class, cause.getCause().getClass()); | |
| 135 | 133 | } |
| 136 | 134 | } |
| 137 | 135 | |
| ... | ... | @@ -141,7 +139,7 @@ public class ConfigurationBeanValidationFieldTest { |
| 141 | 139 | propertyWithTwoConstrainViolations.getAttributeWithTwoConstrainValidations(); |
| 142 | 140 | fail(); |
| 143 | 141 | } catch (ConfigurationException cause) { |
| 144 | - Assert.assertEquals(ConstraintViolationException.class, cause.getCause().getClass()); | |
| 142 | + assertEquals(ConstraintViolationException.class, cause.getCause().getClass()); | |
| 145 | 143 | } |
| 146 | 144 | } |
| 147 | 145 | } | ... | ... |