Commit 74c70faa6d2fb414fb133c518e640907ec255394
Exists in
master
Merge branch '2.3' of git@github.com:demoiselle/framework.git into 2.3
Showing
7 changed files
with
38 additions
and
44 deletions
Show diff stats
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/producer/LocaleProducer.java
@@ -1,16 +0,0 @@ | @@ -1,16 +0,0 @@ | ||
1 | -package br.gov.frameworkdemoiselle.internal.producer; | ||
2 | - | ||
3 | -import java.util.Locale; | ||
4 | - | ||
5 | -import javax.enterprise.inject.Default; | ||
6 | -import javax.enterprise.inject.Produces; | ||
7 | - | ||
8 | -public class LocaleProducer { | ||
9 | - | ||
10 | - @Produces | ||
11 | - @Default | ||
12 | - public Locale create() { | ||
13 | - return Locale.getDefault(); | ||
14 | - } | ||
15 | - | ||
16 | -} |
impl/core/src/test/java/br/gov/frameworkdemoiselle/internal/producer/LocaleProducerTest.java
@@ -1,20 +0,0 @@ | @@ -1,20 +0,0 @@ | ||
1 | -package br.gov.frameworkdemoiselle.internal.producer; | ||
2 | - | ||
3 | -import java.util.Locale; | ||
4 | - | ||
5 | -import junit.framework.Assert; | ||
6 | - | ||
7 | -import org.junit.Test; | ||
8 | - | ||
9 | -public class LocaleProducerTest { | ||
10 | - | ||
11 | - @Test | ||
12 | - public void testCreate() { | ||
13 | - | ||
14 | - Locale locale = (new LocaleProducer()).create(); | ||
15 | - | ||
16 | - Assert.assertNotNull(locale); | ||
17 | - | ||
18 | - } | ||
19 | - | ||
20 | -} |
impl/extension/jsf/src/main/java/br/gov/frameworkdemoiselle/internal/producer/JsfLocaleProducer.java
@@ -22,7 +22,6 @@ import java.io.Serializable; | @@ -22,7 +22,6 @@ import java.io.Serializable; | ||
22 | import java.util.Locale; | 22 | import java.util.Locale; |
23 | 23 | ||
24 | import javax.enterprise.context.RequestScoped; | 24 | import javax.enterprise.context.RequestScoped; |
25 | -import javax.enterprise.inject.Alternative; | ||
26 | import javax.enterprise.inject.Default; | 25 | import javax.enterprise.inject.Default; |
27 | import javax.enterprise.inject.Produces; | 26 | import javax.enterprise.inject.Produces; |
28 | import javax.faces.context.FacesContext; | 27 | import javax.faces.context.FacesContext; |
@@ -32,7 +31,6 @@ import javax.servlet.http.HttpServletRequest; | @@ -32,7 +31,6 @@ import javax.servlet.http.HttpServletRequest; | ||
32 | import br.gov.frameworkdemoiselle.util.Beans; | 31 | import br.gov.frameworkdemoiselle.util.Beans; |
33 | 32 | ||
34 | @RequestScoped | 33 | @RequestScoped |
35 | -@Alternative | ||
36 | public class JsfLocaleProducer implements Serializable { | 34 | public class JsfLocaleProducer implements Serializable { |
37 | 35 | ||
38 | private static final long serialVersionUID = 1L; | 36 | private static final long serialVersionUID = 1L; |
@@ -44,7 +42,7 @@ public class JsfLocaleProducer implements Serializable { | @@ -44,7 +42,7 @@ public class JsfLocaleProducer implements Serializable { | ||
44 | @Named("currentLocale") | 42 | @Named("currentLocale") |
45 | public Locale create() { | 43 | public Locale create() { |
46 | Locale locale; | 44 | Locale locale; |
47 | - | 45 | + |
48 | try { | 46 | try { |
49 | FacesContext facesContext = Beans.getReference(FacesContext.class); | 47 | FacesContext facesContext = Beans.getReference(FacesContext.class); |
50 | 48 |
impl/extension/jsf/src/main/resources/META-INF/beans.xml
@@ -37,8 +37,4 @@ | @@ -37,8 +37,4 @@ | ||
37 | <beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | 37 | <beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
38 | xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd"> | 38 | xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd"> |
39 | 39 | ||
40 | - <alternatives> | ||
41 | - <class>br.gov.frameworkdemoiselle.internal.producer.JsfLocaleProducer</class> | ||
42 | - </alternatives> | ||
43 | - | ||
44 | </beans> | 40 | </beans> |
45 | \ No newline at end of file | 41 | \ No newline at end of file |
impl/extension/se/src/main/java/br/gov/frameworkdemoiselle/internal/producer/SeLocaleProducer.java
0 → 100644
@@ -0,0 +1,16 @@ | @@ -0,0 +1,16 @@ | ||
1 | +package br.gov.frameworkdemoiselle.internal.producer; | ||
2 | + | ||
3 | +import java.util.Locale; | ||
4 | + | ||
5 | +import javax.enterprise.inject.Default; | ||
6 | +import javax.enterprise.inject.Produces; | ||
7 | + | ||
8 | +public class SeLocaleProducer { | ||
9 | + | ||
10 | + @Produces | ||
11 | + @Default | ||
12 | + public Locale create() { | ||
13 | + return Locale.getDefault(); | ||
14 | + } | ||
15 | + | ||
16 | +} |
impl/extension/se/src/test/java/br/gov/frameworkdemoiselle/internal/producer/SeLocaleProducerTest.java
0 → 100644
@@ -0,0 +1,20 @@ | @@ -0,0 +1,20 @@ | ||
1 | +package br.gov.frameworkdemoiselle.internal.producer; | ||
2 | + | ||
3 | +import java.util.Locale; | ||
4 | + | ||
5 | +import junit.framework.Assert; | ||
6 | + | ||
7 | +import org.junit.Test; | ||
8 | + | ||
9 | +public class SeLocaleProducerTest { | ||
10 | + | ||
11 | + @Test | ||
12 | + public void testCreate() { | ||
13 | + | ||
14 | + Locale locale = (new SeLocaleProducer()).create(); | ||
15 | + | ||
16 | + Assert.assertNotNull(locale); | ||
17 | + | ||
18 | + } | ||
19 | + | ||
20 | +} |
parent/framework/pom.xml
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | <parent> | 9 | <parent> |
10 | <groupId>br.gov.frameworkdemoiselle</groupId> | 10 | <groupId>br.gov.frameworkdemoiselle</groupId> |
11 | <artifactId>demoiselle-parent</artifactId> | 11 | <artifactId>demoiselle-parent</artifactId> |
12 | - <version>3</version> | 12 | + <version>4-SNAPSHOT</version> |
13 | <relativePath>../../../internal/parent/demoiselle/pom.xml</relativePath> | 13 | <relativePath>../../../internal/parent/demoiselle/pom.xml</relativePath> |
14 | </parent> | 14 | </parent> |
15 | 15 |