[cal10n-dev] branch, master, updated. v0.5.1-1-gafd6865

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Tue Sep 1 21:20:14 CEST 2009


The branch, master has been updated
       via  afd6865749bfcdef8132c154c2519e18cc9426c6 (commit)
      from  59238843c01851b0ebfbb7971f28bf8a8c90470f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=cal10n.git;a=commit;h=afd6865749bfcdef8132c154c2519e18cc9426c6
http://github.com/ceki/cal10n/commit/afd6865749bfcdef8132c154c2519e18cc9426c6

commit afd6865749bfcdef8132c154c2519e18cc9426c6
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Tue Sep 1 21:17:38 2009 +0200

    Fixing CAL-1

diff --git a/cal10n-api/src/main/java/ch/qos/cal10n/MessageConveyor.java b/cal10n-api/src/main/java/ch/qos/cal10n/MessageConveyor.java
index dc8a95a..4815e3e 100644
--- a/cal10n-api/src/main/java/ch/qos/cal10n/MessageConveyor.java
+++ b/cal10n-api/src/main/java/ch/qos/cal10n/MessageConveyor.java
@@ -67,7 +67,7 @@ public class MessageConveyor implements IMessageConveyor {
     String keyAsStr = key.toString();
 
     String resouceBundleName = AnnotationExtractor.getResourceBundleName(key
-        .getClass());
+        .getDeclaringClass());
     if (resouceBundleName == null) {
       throw new IllegalArgumentException(
           "Missing @ResourceBundleName annotation in enum type [" + key.getClass().getName()
diff --git a/cal10n-api/src/test/java/ch/qos/cal10n/sample/Colors.java b/cal10n-api/src/test/java/ch/qos/cal10n/sample/Colors.java
index 4248147..e05bb00 100644
--- a/cal10n-api/src/test/java/ch/qos/cal10n/sample/Colors.java
+++ b/cal10n-api/src/test/java/ch/qos/cal10n/sample/Colors.java
@@ -28,5 +28,9 @@ import ch.qos.cal10n.ResourceBundleName;
 @ResourceBundleName("colors")
 @LocaleNames({"en_UK", "fr"})
 public enum Colors {
-  RED, BLUE, GREEN;
+  RED {
+     
+  },
+  BLUE, 
+  GREEN;
 }
diff --git a/cal10n-api/src/test/java/ch/qos/cal10n/sample/MessageConveyorTest.java b/cal10n-api/src/test/java/ch/qos/cal10n/sample/MessageConveyorTest.java
index f60ce2c..4bef85d 100644
--- a/cal10n-api/src/test/java/ch/qos/cal10n/sample/MessageConveyorTest.java
+++ b/cal10n-api/src/test/java/ch/qos/cal10n/sample/MessageConveyorTest.java
@@ -30,6 +30,7 @@ import org.junit.Test;
 
 import ch.qos.cal10n.MessageConveyor;
 import ch.qos.cal10n.MessageParameterObj;
+import ch.qos.cal10n.sample.Host.OtherColors;
 
 public class MessageConveyorTest {
 
@@ -49,6 +50,26 @@ public class MessageConveyorTest {
 
   }
 
+  // see http://jira.qos.ch/browse/CAL-1
+  @Test
+  public void nestedEnum_EN() {
+    MessageConveyor rbbmc = new MessageConveyor(Locale.UK);
+    {
+      String val = rbbmc.getMessage(Colors.RED);
+      assertEquals("roses are red", val);
+    }
+
+    {
+      String val = rbbmc.getMessage(OtherColors.RED);
+      assertEquals("roses are red", val);
+    }
+
+    {
+      String val = rbbmc.getMessage(OtherColors.BLUE);
+      assertEquals("violets are blue", val);
+    }
+  }
+
   @Test
   public void smoke_FR() {
     MessageConveyor rbbmc = new MessageConveyor(Locale.FRANCE);

-----------------------------------------------------------------------

Summary of changes:
 .../main/java/ch/qos/cal10n/MessageConveyor.java   |    2 +-
 .../src/test/java/ch/qos/cal10n/sample/Colors.java |    6 ++++-
 .../ch/qos/cal10n/sample/MessageConveyorTest.java  |   21 ++++++++++++++++++++
 3 files changed, 27 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Compiler assisted localization library


More information about the cal10n-dev mailing list