Commit 62d7edd70ee3d029c10771b2ae05e83e33822ceb
1 parent
d3ef2e8d
Exists in
master
Organização do código
Showing
4 changed files
with
67 additions
and
53 deletions
Show diff stats
impl/core/pom.xml
... | ... | @@ -180,32 +180,9 @@ |
180 | 180 | <groupId>org.javassist</groupId> |
181 | 181 | <artifactId>javassist</artifactId> |
182 | 182 | </dependency> |
183 | - | |
184 | 183 | <dependency> |
185 | 184 | <groupId>commons-configuration</groupId> |
186 | 185 | <artifactId>commons-configuration</artifactId> |
187 | - <exclusions> | |
188 | - <exclusion> | |
189 | - <artifactId>commons-digester</artifactId> | |
190 | - <groupId>commons-digester</groupId> | |
191 | - </exclusion> | |
192 | - <exclusion> | |
193 | - <artifactId>log4j</artifactId> | |
194 | - <groupId>log4j</groupId> | |
195 | - </exclusion> | |
196 | - <exclusion> | |
197 | - <artifactId>servlet-api</artifactId> | |
198 | - <groupId>javax.servlet</groupId> | |
199 | - </exclusion> | |
200 | - <exclusion> | |
201 | - <artifactId>logkit</artifactId> | |
202 | - <groupId>logkit</groupId> | |
203 | - </exclusion> | |
204 | - <exclusion> | |
205 | - <artifactId>avalon-framework</artifactId> | |
206 | - <groupId>avalon-framework</groupId> | |
207 | - </exclusion> | |
208 | - </exclusions> | |
209 | 186 | </dependency> |
210 | 187 | |
211 | 188 | <!-- for tests --> |
... | ... | @@ -217,19 +194,16 @@ |
217 | 194 | <dependency> |
218 | 195 | <groupId>org.jboss.arquillian.junit</groupId> |
219 | 196 | <artifactId>arquillian-junit-container</artifactId> |
220 | - <version>${arquillian.version}</version> | |
221 | 197 | <scope>test</scope> |
222 | 198 | </dependency> |
223 | 199 | <dependency> |
224 | 200 | <groupId>org.jboss.arquillian.container</groupId> |
225 | 201 | <artifactId>arquillian-weld-se-embedded-1.1</artifactId> |
226 | - <version>${arquillian.weld.se.embedded.version}</version> | |
227 | 202 | <scope>test</scope> |
228 | 203 | </dependency> |
229 | 204 | <dependency> |
230 | 205 | <groupId>org.jboss.weld.se</groupId> |
231 | 206 | <artifactId>weld-se-core</artifactId> |
232 | - <version>${weld.se.version}</version> | |
233 | 207 | <scope>test</scope> |
234 | 208 | </dependency> |
235 | 209 | |
... | ... | @@ -297,10 +271,6 @@ |
297 | 271 | </repositories> |
298 | 272 | |
299 | 273 | <properties> |
300 | - <arquillian.version>1.0.3.Final</arquillian.version> | |
301 | - <arquillian.weld.se.embedded.version>1.0.0.CR6</arquillian.weld.se.embedded.version> | |
302 | - <weld.se.version>1.1.8.Final</weld.se.version> | |
303 | - | |
304 | 274 | <!-- |
305 | 275 | <jacoco.version>0.6.0.201210061924</jacoco.version> |
306 | 276 | --> | ... | ... |
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/ConfigurationLoader.java
... | ... | @@ -129,36 +129,42 @@ public class ConfigurationLoader implements Serializable { |
129 | 129 | } |
130 | 130 | |
131 | 131 | private void loadConfiguration() { |
132 | - AbstractConfiguration conf; | |
132 | + org.apache.commons.configuration.Configuration config = createConfiguration(); | |
133 | + | |
134 | + if (config instanceof FileConfiguration) { | |
135 | + ((FileConfiguration) config).setURL(Reflections.getResourceAsURL(this.resource)); | |
136 | + | |
137 | + try { | |
138 | + ((FileConfiguration) config).load(); | |
139 | + | |
140 | + } catch (org.apache.commons.configuration.ConfigurationException cause) { | |
141 | + // TODO Logar como warning. | |
142 | + config = null; | |
143 | + } | |
144 | + } | |
145 | + | |
146 | + this.configuration = config; | |
147 | + } | |
148 | + | |
149 | + private org.apache.commons.configuration.Configuration createConfiguration() { | |
150 | + AbstractConfiguration config; | |
133 | 151 | |
134 | 152 | switch (this.type) { |
135 | 153 | case SYSTEM: |
136 | - conf = new SystemConfiguration(); | |
154 | + config = new SystemConfiguration(); | |
137 | 155 | break; |
138 | 156 | |
139 | 157 | case XML: |
140 | - conf = new XMLConfiguration(); | |
158 | + config = new XMLConfiguration(); | |
141 | 159 | break; |
142 | 160 | |
143 | 161 | default: |
144 | - conf = new PropertiesConfiguration(); | |
162 | + config = new PropertiesConfiguration(); | |
145 | 163 | break; |
146 | 164 | } |
147 | 165 | |
148 | - conf.setDelimiterParsingDisabled(true); | |
149 | - | |
150 | - if (conf instanceof FileConfiguration) { | |
151 | - ((FileConfiguration) conf).setURL(Reflections.getResourceAsURL(this.resource)); | |
152 | - | |
153 | - try { | |
154 | - ((FileConfiguration) conf).load(); | |
155 | - | |
156 | - } catch (org.apache.commons.configuration.ConfigurationException cause) { | |
157 | - conf = null; | |
158 | - } | |
159 | - } | |
160 | - | |
161 | - this.configuration = conf; | |
166 | + config.setDelimiterParsingDisabled(true); | |
167 | + return config; | |
162 | 168 | } |
163 | 169 | |
164 | 170 | private void loadPrefix() { | ... | ... |
impl/core/src/test/java/br/gov/frameworkdemoiselle/configuration/defaultvalue/ConfigurationDefaultValueTest.java
... | ... | @@ -46,12 +46,10 @@ import org.jboss.arquillian.container.test.api.Deployment; |
46 | 46 | import org.jboss.arquillian.junit.Arquillian; |
47 | 47 | import org.jboss.shrinkwrap.api.asset.FileAsset; |
48 | 48 | import org.jboss.shrinkwrap.api.spec.JavaArchive; |
49 | -import org.junit.Ignore; | |
50 | 49 | import org.junit.Test; |
51 | 50 | import org.junit.runner.RunWith; |
52 | 51 | |
53 | 52 | import br.gov.frameworkdemoiselle.configuration.AbstractConfigurationTest; |
54 | -import br.gov.frameworkdemoiselle.configuration.ConfigurationException; | |
55 | 53 | |
56 | 54 | @RunWith(Arquillian.class) |
57 | 55 | public class ConfigurationDefaultValueTest extends AbstractConfigurationTest { | ... | ... |
parent/bom/pom.xml
... | ... | @@ -34,7 +34,8 @@ |
34 | 34 | ou escreva para a Fundação do Software Livre (FSF) Inc., |
35 | 35 | 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. |
36 | 36 | --> |
37 | -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
37 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
38 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
38 | 39 | |
39 | 40 | <modelVersion>4.0.0</modelVersion> |
40 | 41 | |
... | ... | @@ -274,6 +275,28 @@ |
274 | 275 | <groupId>commons-configuration</groupId> |
275 | 276 | <artifactId>commons-configuration</artifactId> |
276 | 277 | <version>${commons.configuration.version}</version> |
278 | + <exclusions> | |
279 | + <exclusion> | |
280 | + <artifactId>commons-digester</artifactId> | |
281 | + <groupId>commons-digester</groupId> | |
282 | + </exclusion> | |
283 | + <exclusion> | |
284 | + <artifactId>log4j</artifactId> | |
285 | + <groupId>log4j</groupId> | |
286 | + </exclusion> | |
287 | + <exclusion> | |
288 | + <artifactId>servlet-api</artifactId> | |
289 | + <groupId>javax.servlet</groupId> | |
290 | + </exclusion> | |
291 | + <exclusion> | |
292 | + <artifactId>logkit</artifactId> | |
293 | + <groupId>logkit</groupId> | |
294 | + </exclusion> | |
295 | + <exclusion> | |
296 | + <artifactId>avalon-framework</artifactId> | |
297 | + <groupId>avalon-framework</groupId> | |
298 | + </exclusion> | |
299 | + </exclusions> | |
277 | 300 | </dependency> |
278 | 301 | <dependency> |
279 | 302 | <groupId>commons-dbcp</groupId> |
... | ... | @@ -315,6 +338,21 @@ |
315 | 338 | <artifactId>easymock</artifactId> |
316 | 339 | <version>${easymock.version}</version> |
317 | 340 | </dependency> |
341 | + <dependency> | |
342 | + <groupId>org.jboss.arquillian.junit</groupId> | |
343 | + <artifactId>arquillian-junit-container</artifactId> | |
344 | + <version>${arquillian.version}</version> | |
345 | + </dependency> | |
346 | + <dependency> | |
347 | + <groupId>org.jboss.arquillian.container</groupId> | |
348 | + <artifactId>arquillian-weld-se-embedded-1.1</artifactId> | |
349 | + <version>${arquillian.weld.se.embedded.version}</version> | |
350 | + </dependency> | |
351 | + <dependency> | |
352 | + <groupId>org.jboss.weld.se</groupId> | |
353 | + <artifactId>weld-se-core</artifactId> | |
354 | + <version>${weld.version}</version> | |
355 | + </dependency> | |
318 | 356 | </dependencies> |
319 | 357 | </dependencyManagement> |
320 | 358 | |
... | ... | @@ -358,8 +396,10 @@ |
358 | 396 | |
359 | 397 | <junit.version>4.8.1</junit.version> |
360 | 398 | <easymock.version>3.0</easymock.version> |
361 | - <arquillian.junit.version>1.0.0.Alpha4.SP2</arquillian.junit.version> | |
362 | - <arquillian.weld.embdedded.version>1.0.0.Alpha2</arquillian.weld.embdedded.version> | |
399 | + | |
400 | + <arquillian.version>1.0.3.Final</arquillian.version> | |
401 | + <arquillian.weld.se.embedded.version>1.0.0.CR6</arquillian.weld.se.embedded.version> | |
402 | + | |
363 | 403 | <powermock.version>1.4.6</powermock.version> |
364 | 404 | <primefaces.version>3.4</primefaces.version> |
365 | 405 | <slf4j.version>1.6.1</slf4j.version> | ... | ... |