1   /*
2    * Created by IntelliJ IDEA.
3    * User: owen
4    * Date: Jan 20, 2003
5    * Time: 2:05:35 PM
6    * CVS Revision: $Revision: 1.1 $
7    * Last CVS Commit: $Date: 2003/09/30 07:11:38 $
8    * Author of last CVS Commit: $Author: mcannon $
9    * To change this template use Options | File Templates.
10   */
11  package test.atlassian.core.ofbiz;
12  
13  import junit.framework.TestCase;
14  import org.ofbiz.core.util.UtilMisc;
15  
16  import java.util.Map;
17  
18  public class TestUtilMisc extends TestCase
19  {
20      public TestUtilMisc(String s)
21      {
22          super(s);
23      }
24  
25      public void testSimpleMap()
26      {
27          Map subFields;
28          subFields = UtilMisc.toMap("repeatCount",new Long(7),
29                  "repeatInterval",new Long(2),
30                  "timesTriggered",new Long(3),"trigger",new Long(-1));
31          assertEquals(4, subFields.size());
32          assertEquals(new Long(-1),subFields.get("trigger"));
33          subFields.put("trigger",new Long(1));
34          assertEquals(4, subFields.size());
35          assertEquals(new Long(1),subFields.get("trigger"));
36          assertEquals(new Long(7),subFields.get("repeatCount"));
37          assertEquals(new Long(2),subFields.get("repeatInterval"));
38          assertEquals(new Long(3),subFields.get("timesTriggered"));
39      }
40  }