Clean up error handling to make things slightly friendlier on an initial install.
[cfb.git] / test / net / jaekl / cfb / CfbBundleTest.java
1 package net.jaekl.cfb;
2
3 import static org.junit.Assert.*;
4
5 import org.junit.Test;
6
7 public class CfbBundleTest {
8
9         @Test
10         public void testFallbackGet() {
11                 Object[][] data = {
12                                 { "hello", new Object[] {}, "[hello]" },
13                                 { "hello", new Object[] {"world"}, "[hello][world]"},
14                                 { null, new Object[] {}, "[null]" },
15                                 { 
16                                         "the.quick.brown.fox", 
17                                         new Object[] {"jumps.over", Integer.valueOf(1), "lazy", "dog"}, 
18                                         "[the.quick.brown.fox][jumps.over][1][lazy][dog]"
19                                 }
20                         };
21                 
22                 CfbBundleMock bundle = new CfbBundleMock();
23                 
24                 for (Object[] datum : data) {
25                         String key = (String)datum[0];
26                         Object[] params = (Object[])datum[1];
27                         String expected = (String)datum[2];
28                         String actual = bundle.fallbackGet(key, params);
29                         assertEquals(expected, actual);
30                 }
31         }
32
33 }