1   package com.atlassian.core.util.map;
2   
3   import java.util.Map;
4   import junit.framework.TestCase;
5   
6   public class EasyMapTest extends TestCase
7   {
8       public void testEasyMapKeyValues() throws Exception
9       {
10          Map myMap = EasyMap.build("hello", "world", "hey", "there");
11          assertEquals("world", myMap.get("hello"));
12          assertEquals("there", myMap.get("hey"));
13  
14          try
15          {
16              myMap = EasyMap.build("hello", "world", "hey");
17              fail("should have thrown a RuntimeException");
18          }
19          catch (Throwable e)
20          {
21              assertTrue(e instanceof RuntimeException);
22              assertEquals("The number of parameters should be even when building a map", e.getMessage());
23          }
24      }
25  }