myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r956111 - in /myfaces/extensions/cdi/trunk: jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/message/ jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/ jse...
Date Fri, 18 Jun 2010 19:53:09 GMT
Author: gpetracek
Date: Fri Jun 18 19:53:08 2010
New Revision: 956111

URL: http://svn.apache.org/viewvc?rev=956111&view=rev
Log:
EXTCDI-21 MessageContextConfig serialization test-case and cleanup

Added:
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/SerializationTest.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestDeepObjectCloner.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestEnglishLocaleResolver.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestEnglishNumberConfig.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestFormatter.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestGermanLocaleResolver.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestGermanNumberConfig.java
Modified:
    myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/message/JsfAwareApplicationMessagesMessageResolver.java
    myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/message/JsfAwareMessageContextProducer.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/Formatter.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/LocaleResolver.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageHandler.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageInterpolator.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageResolver.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/AbstractFormatterAwareMessageInterpolator.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultFormatterFactory.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/formatter/DefaultNumberFormatter.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/AbstractTest.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/AllTests.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/ExtensibilityTest.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/FormattedMessageArgumentTest.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/PayloadTest.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/SimpleMessageTest.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestMessageBuilder.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestMessageFactory.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestMessageResolver.java
    myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestPayloadAwareMessageResolver.java

Modified: myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/message/JsfAwareApplicationMessagesMessageResolver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/message/JsfAwareApplicationMessagesMessageResolver.java?rev=956111&r1=956110&r2=956111&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/message/JsfAwareApplicationMessagesMessageResolver.java (original)
+++ myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/message/JsfAwareApplicationMessagesMessageResolver.java Fri Jun 18 19:53:08 2010
@@ -32,6 +32,8 @@ import java.util.MissingResourceExceptio
  */
 class JsfAwareApplicationMessagesMessageResolver implements MessageResolver
 {
+    private static final long serialVersionUID = 4646223879356055470L;
+
     public String getMessage(MessageContext messageContext,
                              String messageDescriptor,
                              Map<Class, Class<? extends MessagePayload>> messagePayload)

Modified: myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/message/JsfAwareMessageContextProducer.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/message/JsfAwareMessageContextProducer.java?rev=956111&r1=956110&r2=956111&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/message/JsfAwareMessageContextProducer.java (original)
+++ myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/message/JsfAwareMessageContextProducer.java Fri Jun 18 19:53:08 2010
@@ -78,6 +78,8 @@ public class JsfAwareMessageContextProdu
     {
         return new LocaleResolver()
         {
+            private static final long serialVersionUID = 5945811297524654438L;
+
             public Locale getLocale()
             {
                 Locale locale = null;

Modified: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/Formatter.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/Formatter.java?rev=956111&r1=956110&r2=956111&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/Formatter.java (original)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/Formatter.java Fri Jun 18 19:53:08 2010
@@ -18,6 +18,8 @@
  */
 package org.apache.myfaces.extensions.cdi.message.api;
 
+import java.io.Serializable;
+
 /**
  * usually a formatter is responsible for one type and allows to format
  * this type as string
@@ -25,7 +27,7 @@ package org.apache.myfaces.extensions.cd
  * @author Gerhard Petracek
  * @author Manfred Geiler
  */
-public interface Formatter<T>
+public interface Formatter<T> extends Serializable
 {
     /**
      * answers the question if the instance is able to format an object of the given type

Modified: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/LocaleResolver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/LocaleResolver.java?rev=956111&r1=956110&r2=956111&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/LocaleResolver.java (original)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/LocaleResolver.java Fri Jun 18 19:53:08 2010
@@ -19,11 +19,12 @@
 package org.apache.myfaces.extensions.cdi.message.api;
 
 import java.util.Locale;
+import java.io.Serializable;
 
 /**
  * @author Gerhard Petracek
  */
-public interface LocaleResolver
+public interface LocaleResolver extends Serializable
 {
     /**
      * @return the current locale

Modified: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageHandler.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageHandler.java?rev=956111&r1=956110&r2=956111&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageHandler.java (original)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageHandler.java Fri Jun 18 19:53:08 2010
@@ -20,13 +20,14 @@ package org.apache.myfaces.extensions.cd
 
 import java.util.List;
 import java.util.Set;
+import java.io.Serializable;
 
 /**
  * an implementation is allowed to store messages directly or to forward messages
  *
  * @author Gerhard Petracek
  */
-public interface MessageHandler
+public interface MessageHandler extends Serializable
 {
     /**
      * called to add a message to a special target (known by the implementations)

Modified: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageInterpolator.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageInterpolator.java?rev=956111&r1=956110&r2=956111&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageInterpolator.java (original)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageInterpolator.java Fri Jun 18 19:53:08 2010
@@ -24,7 +24,7 @@ import java.io.Serializable;
  * @author Manfred Geiler
  * @author Gerhard Petracek
  */
-public interface MessageInterpolator
+public interface MessageInterpolator extends Serializable
 {
     /**
      * replaces the arguments of the given message with the given arguments

Modified: myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageResolver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageResolver.java?rev=956111&r1=956110&r2=956111&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageResolver.java (original)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/api/src/main/java/org/apache/myfaces/extensions/cdi/message/api/MessageResolver.java Fri Jun 18 19:53:08 2010
@@ -21,11 +21,12 @@ package org.apache.myfaces.extensions.cd
 import org.apache.myfaces.extensions.cdi.message.api.payload.MessagePayload;
 
 import java.util.Map;
+import java.io.Serializable;
 
 /**
  * @author Gerhard Petracek
  */
-public interface MessageResolver
+public interface MessageResolver extends Serializable
 {
     static final String MISSING_RESOURCE_MARKER = "???";
 

Modified: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/AbstractFormatterAwareMessageInterpolator.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/AbstractFormatterAwareMessageInterpolator.java?rev=956111&r1=956110&r2=956111&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/AbstractFormatterAwareMessageInterpolator.java (original)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/AbstractFormatterAwareMessageInterpolator.java Fri Jun 18 19:53:08 2010
@@ -23,13 +23,10 @@ import org.apache.myfaces.extensions.cdi
 import org.apache.myfaces.extensions.cdi.message.api.Localizable;
 import org.apache.myfaces.extensions.cdi.message.api.Formatter;
 
-import java.io.Serializable;
-
 /**
  * @author Gerhard Petracek
  */
-abstract class AbstractFormatterAwareMessageInterpolator
-        implements MessageInterpolator, Serializable
+abstract class AbstractFormatterAwareMessageInterpolator implements MessageInterpolator
 {
     @SuppressWarnings({"unchecked"})
     protected Object formatAsString(MessageContext messageContext, Object value)

Modified: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultFormatterFactory.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultFormatterFactory.java?rev=956111&r1=956110&r2=956111&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultFormatterFactory.java (original)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/DefaultFormatterFactory.java Fri Jun 18 19:53:08 2010
@@ -42,13 +42,21 @@ public class DefaultFormatterFactory imp
 {
     private static final long serialVersionUID = -7462205386564870045L;
 
-    protected final Logger logger = Logger.getLogger(getClass().getName());
-
+    transient protected Logger logger = getLogger();
 
     private List<Formatter> formatters = new ArrayList<Formatter>();
     private Map<Class<?>, Formatter> formatterCache = null;
     private Map<FormatterConfigKey, GenericConfig> formatterConfigs = new HashMap<FormatterConfigKey, GenericConfig>();
 
+    private Logger getLogger()
+    {
+        if(this.logger == null)
+        {
+            this.logger = Logger.getLogger(getClass().getName());
+        }
+        return this.logger;
+    }
+
     public FormatterFactory add(Formatter formatter)
     {
         this.formatters.add(formatter);
@@ -81,7 +89,7 @@ public class DefaultFormatterFactory imp
 
             if (found == null)
             {
-                this.logger.info("default formatter used for: " + type.getName());
+                getLogger().info("default formatter used for: " + type.getName());
                 found = FormatterBuilder.createFormatter(type);
             }
 

Modified: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/formatter/DefaultNumberFormatter.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/formatter/DefaultNumberFormatter.java?rev=956111&r1=956110&r2=956111&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/formatter/DefaultNumberFormatter.java (original)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/message/impl/formatter/DefaultNumberFormatter.java Fri Jun 18 19:53:08 2010
@@ -34,6 +34,8 @@ import java.util.Locale;
  */
 class DefaultNumberFormatter implements Formatter<Number>
 {
+    private static final long serialVersionUID = 1639250543559140704L;
+
     private Character groupingSeparator;
     private Character decimalSeparator;
     private Integer minimumFractionDigits;

Modified: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/AbstractTest.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/AbstractTest.java?rev=956111&r1=956110&r2=956111&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/AbstractTest.java (original)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/AbstractTest.java Fri Jun 18 19:53:08 2010
@@ -19,12 +19,9 @@
 package org.apache.myfaces.extensions.cdi.message.test;
 
 import org.apache.myfaces.extensions.cdi.message.api.MessageContext;
-import org.apache.myfaces.extensions.cdi.message.api.LocaleResolver;
 import org.apache.myfaces.extensions.cdi.message.impl.DefaultMessageContext;
 import org.junit.Before;
 
-import java.util.Locale;
-
 /**
  * @author Gerhard Petracek
  */
@@ -38,13 +35,7 @@ public abstract class AbstractTest
     {
         this.messageContext = new DefaultMessageContext(){}.config().use()
                 .messageResolver(new TestMessageResolver())
-                .localeResolver(new LocaleResolver()
-                {
-                    public Locale getLocale()
-                    {
-                        return Locale.ENGLISH;
-                    }
-                })
+                .localeResolver(new TestEnglishLocaleResolver())
                 .create();
     }
 }

Modified: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/AllTests.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/AllTests.java?rev=956111&r1=956110&r2=956111&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/AllTests.java (original)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/AllTests.java Fri Jun 18 19:53:08 2010
@@ -34,7 +34,8 @@ import org.junit.runners.Suite;
         PayloadTest.class,
         ExtensibilityTest.class,
         MessageFilterTest.class,
-        HelperTest.class})
+        HelperTest.class,
+        SerializationTest.class})
 public class AllTests extends TestCase
 {
 }

Modified: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/ExtensibilityTest.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/ExtensibilityTest.java?rev=956111&r1=956110&r2=956111&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/ExtensibilityTest.java (original)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/ExtensibilityTest.java Fri Jun 18 19:53:08 2010
@@ -18,9 +18,8 @@
  */
 package org.apache.myfaces.extensions.cdi.message.test;
 
-import org.apache.myfaces.extensions.cdi.message.api.LocaleResolver;
-import org.apache.myfaces.extensions.cdi.message.api.MessageContext;
 import org.apache.myfaces.extensions.cdi.message.api.Message;
+import org.apache.myfaces.extensions.cdi.message.api.MessageContext;
 import org.apache.myfaces.extensions.cdi.message.impl.DefaultMessageContext;
 import org.apache.myfaces.extensions.cdi.message.impl.SimpleMessageBuilder;
 import static org.junit.Assert.*;
@@ -90,8 +89,8 @@ public class ExtensibilityTest extends A
     {
         MessageContext newMessageContext = this.messageContext.cloneContext();
 
-        this.messageContext.config().change().localeResolver(createLocalResolver1());
-        newMessageContext.config().change().localeResolver(createLocalResolver2());
+        this.messageContext.config().change().localeResolver(new TestGermanLocaleResolver());
+        newMessageContext.config().change().localeResolver(new TestEnglishLocaleResolver());
 
         if (newMessageContext.equals(this.messageContext))
         {
@@ -102,36 +101,10 @@ public class ExtensibilityTest extends A
         assertEquals(Locale.ENGLISH, newMessageContext.config().getLocaleResolver().getLocale());
     }
 
-    private LocaleResolver createLocalResolver1()
-    {
-        return new LocaleResolver()
-        {
-            Locale locale = Locale.GERMAN;
-
-            public Locale getLocale()
-            {
-                return locale;
-            }
-        };
-    }
-
-    private LocaleResolver createLocalResolver2()
-    {
-        return new LocaleResolver()
-        {
-            Locale locale = Locale.ENGLISH;
-
-            public Locale getLocale()
-            {
-                return locale;
-            }
-        };
-    }
-
     @Test
     public void usedMessageResolverTest()
     {
-        MessageContext newMessageContext = this.messageContext.config().use().localeResolver(createGermanLocaleResolver()).create();
+        MessageContext newMessageContext = this.messageContext.config().use().localeResolver(new TestGermanLocaleResolver()).create();
 
         if (newMessageContext.equals(this.messageContext))
         {
@@ -142,7 +115,7 @@ public class ExtensibilityTest extends A
     @Test
     public void changedMessageResolverTest()
     {
-        MessageContext messageContext = this.messageContext.config().change().localeResolver(createGermanLocaleResolver()).create();
+        MessageContext messageContext = this.messageContext.config().change().localeResolver(new TestGermanLocaleResolver()).create();
 
         assertEquals(this.messageContext, messageContext);
     }
@@ -165,15 +138,4 @@ public class ExtensibilityTest extends A
 
         assertTrue(messageContext.typed(TestCustomMessageContext.class).isReachable());
     }
-
-    private LocaleResolver createGermanLocaleResolver()
-    {
-        return new LocaleResolver()
-        {
-            public Locale getLocale()
-            {
-                return Locale.GERMAN;
-            }
-        };
-    }
 }
\ No newline at end of file

Modified: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/FormattedMessageArgumentTest.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/FormattedMessageArgumentTest.java?rev=956111&r1=956110&r2=956111&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/FormattedMessageArgumentTest.java (original)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/FormattedMessageArgumentTest.java Fri Jun 18 19:53:08 2010
@@ -18,18 +18,12 @@
  */
 package org.apache.myfaces.extensions.cdi.message.test;
 
-import org.apache.myfaces.extensions.cdi.message.api.GenericConfig;
-import org.apache.myfaces.extensions.cdi.message.api.LocaleResolver;
 import org.apache.myfaces.extensions.cdi.message.impl.NumberedArgumentAwareMessageInterpolator;
-import org.apache.myfaces.extensions.cdi.message.impl.formatter.NumberFormatterConfigKeys;
 import static org.junit.Assert.assertEquals;
 import org.junit.Test;
 
-import java.io.Serializable;
 import java.math.BigDecimal;
-import java.util.HashMap;
 import java.util.Locale;
-import java.util.Map;
 
 /**
  * @author Gerhard Petracek
@@ -40,8 +34,8 @@ public class FormattedMessageArgumentTes
     public void createFormattedMessageGermanTest()
     {
         String messageText = this.messageContext.config().use().messageInterpolator(new NumberedArgumentAwareMessageInterpolator())
-                .localeResolver(getGermanLocaleResolver())
-                .addFormatterConfig(Number.class, getGermanNumberConfig()).create()
+                .localeResolver(new TestGermanLocaleResolver())
+                .addFormatterConfig(Number.class, new TestGermanNumberConfig()).create()
                 .message().text("{formatted_number}").argument(new BigDecimal("7654.3210")).toText();
 
         assertEquals("value: 7.654,321", messageText);
@@ -51,110 +45,12 @@ public class FormattedMessageArgumentTes
     public void createFormattedMessageEnglishTest()
     {
         String messageText = this.messageContext.config().use().messageInterpolator(new NumberedArgumentAwareMessageInterpolator())
-                .localeResolver(getEnglishLocaleResolver())
-                .addFormatterConfig(Number.class, getGermanNumberConfig(), Locale.GERMAN)
-                .addFormatterConfig(Number.class, getEnglishNumberConfig(), Locale.ENGLISH)
+                .localeResolver(new TestEnglishLocaleResolver())
+                .addFormatterConfig(Number.class, new TestGermanNumberConfig(), Locale.GERMAN)
+                .addFormatterConfig(Number.class, new TestEnglishNumberConfig(), Locale.ENGLISH)
                 .create()
                 .message().text("{formatted_number}").argument(new BigDecimal("7654.3210")).toText();
 
         assertEquals("value: 7,654.321", messageText);
     }
-
-    private LocaleResolver getGermanLocaleResolver()
-    {
-        return new LocaleResolver()
-        {
-            public Locale getLocale()
-            {
-                return Locale.GERMAN;
-            }
-        };
-    }
-
-    private GenericConfig getGermanNumberConfig()
-    {
-        return new GenericConfig()
-        {
-            private Map<String, Serializable> properties = new HashMap<String, Serializable>();
-            private static final long serialVersionUID = 1581606533032801390L;
-
-            {
-                this.properties.put(NumberFormatterConfigKeys.GROUPING_SEPARATOR_KEY, ".");
-                this.properties.put(NumberFormatterConfigKeys.DECIMAL_SEPARATOR_KEY, ",");
-                this.properties.put(NumberFormatterConfigKeys.MINIMUM_FRACTION_DIGITS_KEY, 2);
-                this.properties.put(NumberFormatterConfigKeys.MINIMUM_INTEGER_DIGITS_KEY, 1);
-            }
-
-            public GenericConfig addProperty(String key, Serializable value)
-            {
-                this.properties.put(key, value);
-                return this;
-            }
-
-            public Serializable getProperty(String key)
-            {
-                return this.properties.get(key);
-            }
-
-            public <T extends Serializable> T getProperty(String key, Class<T> targetType)
-            {
-                //noinspection unchecked
-                return (T) getProperty(key);
-            }
-
-            public boolean containsProperty(String key)
-            {
-                return this.properties.containsKey(key);
-            }
-        };
-    }
-
-    private LocaleResolver getEnglishLocaleResolver()
-    {
-        return new LocaleResolver()
-        {
-            public Locale getLocale()
-            {
-                return Locale.ENGLISH;
-            }
-        };
-    }
-
-    private GenericConfig getEnglishNumberConfig()
-    {
-        return new GenericConfig()
-        {
-            private Map<String, Serializable> properties = new HashMap<String, Serializable>();
-            private static final long serialVersionUID = 547837293567706390L;
-
-            {
-                this.properties.put(NumberFormatterConfigKeys.GROUPING_SEPARATOR_KEY, ",");
-                this.properties.put(NumberFormatterConfigKeys.DECIMAL_SEPARATOR_KEY, ".");
-                this.properties.put(NumberFormatterConfigKeys.MINIMUM_FRACTION_DIGITS_KEY, 2);
-                this.properties.put(NumberFormatterConfigKeys.MINIMUM_INTEGER_DIGITS_KEY, 1);
-            }
-
-            public GenericConfig addProperty(String key, Serializable value)
-            {
-                this.properties.put(key, value);
-                return this;
-            }
-
-            public Serializable getProperty(String key)
-            {
-                return this.properties.get(key);
-            }
-
-            public <T extends Serializable> T getProperty(String key, Class<T> targetType)
-            {
-                //noinspection unchecked
-                return (T) getProperty(key);
-            }
-
-            public boolean containsProperty(String key)
-            {
-                return this.properties.containsKey(key);
-            }
-        };
-    }
 }
\ No newline at end of file

Modified: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/PayloadTest.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/PayloadTest.java?rev=956111&r1=956110&r2=956111&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/PayloadTest.java (original)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/PayloadTest.java Fri Jun 18 19:53:08 2010
@@ -22,9 +22,7 @@ import org.apache.myfaces.extensions.cdi
 import org.apache.myfaces.extensions.cdi.message.api.payload.InternalMessage;
 import org.apache.myfaces.extensions.cdi.message.api.payload.MessageSeverity;
 import org.apache.myfaces.extensions.cdi.message.impl.DefaultInternalMessage;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.*;
 import org.junit.Test;
 
 /**

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/SerializationTest.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/SerializationTest.java?rev=956111&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/SerializationTest.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/SerializationTest.java Fri Jun 18 19:53:08 2010
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.extensions.cdi.message.test;
+
+import org.apache.myfaces.extensions.cdi.message.api.MessageContextConfig;
+import org.apache.myfaces.extensions.cdi.message.impl.DefaultFormatterFactory;
+import org.apache.myfaces.extensions.cdi.message.impl.NumberedArgumentAwareMessageInterpolator;
+import static org.junit.Assert.assertNotSame;
+import org.junit.Test;
+
+import java.util.Locale;
+
+/**
+ * @author Gerhard Petracek
+ */
+public class SerializationTest extends AbstractTest
+{
+    @Test
+    public void messageContextConfigSerializationTest()
+    {
+        this.messageContext.config()
+                .change()
+                .messageResolver(new TestMessageResolver())
+                .messageInterpolator(new NumberedArgumentAwareMessageInterpolator())
+                .localeResolver(new TestCustomMessageContext())
+                .addMessageHandler(new TestInMemoryMessageHandler())
+                .formatterFactory(new DefaultFormatterFactory())
+                .addFormatter(new TestFormatter(String.class))
+                .addFormatterConfig(Number.class, new TestEnglishNumberConfig(), Locale.ENGLISH);
+
+        MessageContextConfig clonedConfig = TestDeepObjectCloner.clone(this.messageContext.config(), MessageContextConfig.class);
+
+        assertNotSame(this.messageContext.config(), clonedConfig);
+    }
+
+}
\ No newline at end of file

Modified: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/SimpleMessageTest.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/SimpleMessageTest.java?rev=956111&r1=956110&r2=956111&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/SimpleMessageTest.java (original)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/SimpleMessageTest.java Fri Jun 18 19:53:08 2010
@@ -18,7 +18,6 @@
  */
 package org.apache.myfaces.extensions.cdi.message.test;
 
-import org.apache.myfaces.extensions.cdi.message.api.LocaleResolver;
 import org.apache.myfaces.extensions.cdi.message.api.Message;
 import org.apache.myfaces.extensions.cdi.message.impl.DefaultMessage;
 import org.apache.myfaces.extensions.cdi.message.impl.SimpleMessageBuilder;
@@ -26,8 +25,6 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.fail;
 import org.junit.Test;
 
-import java.util.Locale;
-
 /**
  * @author Gerhard Petracek
  */
@@ -80,7 +77,7 @@ public class SimpleMessageTest extends A
     public void resolveGermanMessageTextTest()
     {
         String messageText = this.messageContext.config()
-                .use().localeResolver(createGermanLocaleResolver())
+                .use().localeResolver(new TestGermanLocaleResolver())
                 .create().message().text("{hello}").toText();
 
         checkGermanHelloMessage(messageText);
@@ -177,17 +174,6 @@ public class SimpleMessageTest extends A
         assertEquals("hello open message", message);
     }
 
-    private LocaleResolver createGermanLocaleResolver()
-    {
-        return new LocaleResolver()
-        {
-            public Locale getLocale()
-            {
-                return Locale.GERMAN;
-            }
-        };
-    }
-
     private void checkDefaultHelloMessage(String messageText)
     {
         assertEquals("test message", messageText);

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestDeepObjectCloner.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestDeepObjectCloner.java?rev=956111&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestDeepObjectCloner.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestDeepObjectCloner.java Fri Jun 18 19:53:08 2010
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.extensions.cdi.message.test;
+
+import java.io.*;
+
+/**
+ * @author Gerhard Petracek
+ */
+class TestDeepObjectCloner
+{
+    public static <T> T clone(Serializable source, Class<T> targetClass)
+    {
+        ObjectOutputStream outputStream = null;
+        ObjectInputStream inputStream = null;
+        try
+        {
+            ByteArrayOutputStream arrayOutputStream = new ByteArrayOutputStream();
+            outputStream = new ObjectOutputStream(arrayOutputStream);
+            outputStream.writeObject(source);
+            outputStream.flush();
+            ByteArrayInputStream arrayInputStream = new ByteArrayInputStream(arrayOutputStream.toByteArray());
+            inputStream = new ObjectInputStream(arrayInputStream);
+            return (T) inputStream.readObject();
+        }
+        catch (Exception e)
+        {
+            throw new IllegalArgumentException("you provided an implementation which isn't serializable or" +
+                    "implemented as anonymous class" + e);
+        }
+        finally
+        {
+            try
+            {
+                if(inputStream != null)
+                {
+                    inputStream.close();
+                }
+
+                if(outputStream != null)
+                {
+                    outputStream.close();
+                }
+            }
+            catch (IOException e)
+            {
+                //noinspection ThrowFromFinallyBlock
+                throw new RuntimeException(e);
+            }
+        }
+    }
+}

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestEnglishLocaleResolver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestEnglishLocaleResolver.java?rev=956111&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestEnglishLocaleResolver.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestEnglishLocaleResolver.java Fri Jun 18 19:53:08 2010
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.extensions.cdi.message.test;
+
+import org.apache.myfaces.extensions.cdi.message.api.LocaleResolver;
+
+import java.util.Locale;
+
+/**
+ * @author Gerhard Petracek
+ */
+class TestEnglishLocaleResolver implements LocaleResolver
+{
+    private static final long serialVersionUID = 1927000487639667773L;
+
+    public Locale getLocale()
+    {
+        return Locale.ENGLISH;
+    }
+}
\ No newline at end of file

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestEnglishNumberConfig.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestEnglishNumberConfig.java?rev=956111&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestEnglishNumberConfig.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestEnglishNumberConfig.java Fri Jun 18 19:53:08 2010
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.extensions.cdi.message.test;
+
+import org.apache.myfaces.extensions.cdi.message.api.GenericConfig;
+import org.apache.myfaces.extensions.cdi.message.impl.formatter.NumberFormatterConfigKeys;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Gerhard Petracek
+ */
+class TestEnglishNumberConfig implements GenericConfig
+{
+    private Map<String, Serializable> properties = new HashMap<String, Serializable>();
+    private static final long serialVersionUID = 547837293567706390L;
+
+    {
+        this.properties.put(NumberFormatterConfigKeys.GROUPING_SEPARATOR_KEY, ",");
+        this.properties.put(NumberFormatterConfigKeys.DECIMAL_SEPARATOR_KEY, ".");
+        this.properties.put(NumberFormatterConfigKeys.MINIMUM_FRACTION_DIGITS_KEY, 2);
+        this.properties.put(NumberFormatterConfigKeys.MINIMUM_INTEGER_DIGITS_KEY, 1);
+    }
+
+    public GenericConfig addProperty(String key, Serializable value)
+    {
+        this.properties.put(key, value);
+        return this;
+    }
+
+    public Serializable getProperty(String key)
+    {
+        return this.properties.get(key);
+    }
+
+    public <T extends Serializable> T getProperty(String key, Class<T> targetType)
+    {
+        //noinspection unchecked
+        return (T) getProperty(key);
+    }
+
+    public boolean containsProperty(String key)
+    {
+        return this.properties.containsKey(key);
+    }
+}
\ No newline at end of file

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestFormatter.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestFormatter.java?rev=956111&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestFormatter.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestFormatter.java Fri Jun 18 19:53:08 2010
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.extensions.cdi.message.test;
+
+import org.apache.myfaces.extensions.cdi.message.api.Formatter;
+import org.apache.myfaces.extensions.cdi.message.api.MessageContext;
+
+import java.io.Serializable;
+
+/**
+ * @author Gerhard Petracek
+ */
+public class TestFormatter implements Formatter<Object>, Serializable
+{
+    private static final long serialVersionUID = 3529715901768617301L;
+
+    private Class responsibleFor;
+
+    TestFormatter(Class type)
+    {
+        this.responsibleFor = type;
+    }
+
+    public boolean isResponsibleFor(Class<?> type)
+    {
+        return type.isAssignableFrom(this.responsibleFor);
+    }
+
+    public String format(MessageContext i18nContext, Object valueToFormat)
+    {
+        return valueToFormat != null ? valueToFormat.toString() : "";
+    }
+}

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestGermanLocaleResolver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestGermanLocaleResolver.java?rev=956111&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestGermanLocaleResolver.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestGermanLocaleResolver.java Fri Jun 18 19:53:08 2010
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.extensions.cdi.message.test;
+
+import org.apache.myfaces.extensions.cdi.message.api.LocaleResolver;
+
+import java.util.Locale;
+
+/**
+ * @author Gerhard Petracek
+ */
+class TestGermanLocaleResolver implements LocaleResolver
+{
+    private static final long serialVersionUID = 1927000487639667775L;
+
+    public Locale getLocale()
+    {
+        return Locale.GERMAN;
+    }
+}

Added: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestGermanNumberConfig.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestGermanNumberConfig.java?rev=956111&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestGermanNumberConfig.java (added)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestGermanNumberConfig.java Fri Jun 18 19:53:08 2010
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.extensions.cdi.message.test;
+
+import org.apache.myfaces.extensions.cdi.message.api.GenericConfig;
+import org.apache.myfaces.extensions.cdi.message.impl.formatter.NumberFormatterConfigKeys;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Gerhard Petracek
+ */
+class TestGermanNumberConfig implements GenericConfig
+{
+    private static final long serialVersionUID = 1581606533032801390L;
+    private Map<String, Serializable> properties = new HashMap<String, Serializable>();
+
+    {
+        this.properties.put(NumberFormatterConfigKeys.GROUPING_SEPARATOR_KEY, ".");
+        this.properties.put(NumberFormatterConfigKeys.DECIMAL_SEPARATOR_KEY, ",");
+        this.properties.put(NumberFormatterConfigKeys.MINIMUM_FRACTION_DIGITS_KEY, 2);
+        this.properties.put(NumberFormatterConfigKeys.MINIMUM_INTEGER_DIGITS_KEY, 1);
+    }
+
+    public GenericConfig addProperty(String key, Serializable value)
+    {
+        this.properties.put(key, value);
+        return this;
+    }
+
+    public Serializable getProperty(String key)
+    {
+        return this.properties.get(key);
+    }
+
+    public <T extends Serializable> T getProperty(String key, Class<T> targetType)
+    {
+        //noinspection unchecked
+        return (T) getProperty(key);
+    }
+
+    public boolean containsProperty(String key)
+    {
+        return this.properties.containsKey(key);
+    }
+}

Modified: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestMessageBuilder.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestMessageBuilder.java?rev=956111&r1=956110&r2=956111&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestMessageBuilder.java (original)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestMessageBuilder.java Fri Jun 18 19:53:08 2010
@@ -18,8 +18,8 @@
  */
 package org.apache.myfaces.extensions.cdi.message.test;
 
-import org.apache.myfaces.extensions.cdi.message.impl.SimpleMessageBuilder;
 import org.apache.myfaces.extensions.cdi.message.api.MessageBuilder;
+import org.apache.myfaces.extensions.cdi.message.impl.SimpleMessageBuilder;
 
 /**
  * @author Gerhard Petracek

Modified: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestMessageFactory.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestMessageFactory.java?rev=956111&r1=956110&r2=956111&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestMessageFactory.java (original)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestMessageFactory.java Fri Jun 18 19:53:08 2010
@@ -18,8 +18,8 @@
  */
 package org.apache.myfaces.extensions.cdi.message.test;
 
-import org.apache.myfaces.extensions.cdi.message.api.MessageFactory;
 import org.apache.myfaces.extensions.cdi.message.api.Message;
+import org.apache.myfaces.extensions.cdi.message.api.MessageFactory;
 import org.apache.myfaces.extensions.cdi.message.api.payload.MessagePayload;
 
 /**

Modified: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestMessageResolver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestMessageResolver.java?rev=956111&r1=956110&r2=956111&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestMessageResolver.java (original)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestMessageResolver.java Fri Jun 18 19:53:08 2010
@@ -18,8 +18,8 @@
  */
 package org.apache.myfaces.extensions.cdi.message.test;
 
-import org.apache.myfaces.extensions.cdi.message.api.MessageResolver;
 import org.apache.myfaces.extensions.cdi.message.api.MessageContext;
+import org.apache.myfaces.extensions.cdi.message.api.MessageResolver;
 import org.apache.myfaces.extensions.cdi.message.api.payload.MessagePayload;
 
 import java.util.Map;
@@ -31,6 +31,8 @@ import java.util.ResourceBundle;
  */
 class TestMessageResolver implements MessageResolver
 {
+    private static final long serialVersionUID = -2511565654167302283L;
+
     private static final String TEST_MESSAGES = "org.apache.myfaces.extensions.cdi.message.test.messages";
     private static final String TEST_TECHNICAL_MESSAGES = "org.apache.myfaces.extensions.cdi.message.test.t_messages";
     private static final String TEST_LABELS = "org.apache.myfaces.extensions.cdi.message.test.labels";

Modified: myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestPayloadAwareMessageResolver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestPayloadAwareMessageResolver.java?rev=956111&r1=956110&r2=956111&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestPayloadAwareMessageResolver.java (original)
+++ myfaces/extensions/cdi/trunk/jse-modules/message-module/impl/src/test/java/org/apache/myfaces/extensions/cdi/message/test/TestPayloadAwareMessageResolver.java Fri Jun 18 19:53:08 2010
@@ -18,8 +18,8 @@
  */
 package org.apache.myfaces.extensions.cdi.message.test;
 
-import org.apache.myfaces.extensions.cdi.message.api.MessageResolver;
 import org.apache.myfaces.extensions.cdi.message.api.MessageContext;
+import org.apache.myfaces.extensions.cdi.message.api.MessageResolver;
 import org.apache.myfaces.extensions.cdi.message.api.payload.MessagePayload;
 import org.apache.myfaces.extensions.cdi.message.api.payload.MessageSeverity;
 



Mime
View raw message