@Test
public void test1() {
Map<String, Action> actions = new HashMap<>();
actions.put("action", new TestAction());
ActionParser parser = new ActionParser(actions);
checkAction(parser.loadAction("action(param1=value1)"), "param1", "value1");
checkAction(parser.loadAction("action(param1=value1,param2=2)"), "param1", "value1", "param2", "2");
checkAction(parser.loadAction("action(param1=value1,param2=2\\(\\=\\,\\\\)"), "param1", "value1", "param2", "2(=,\\");
checkAction(parser.loadAction("action(param1=value1,"), "param1", "value1");
checkAction(parser.loadAction("action(param1=value1"), "param1", "value1");
checkAction(parser.loadAction("action(param1="), "param1", "");
checkAction(parser.loadAction("action(param1"), "param1", "");
checkAction(parser.loadAction("action("));
checkAction(parser.loadAction("action"));
checkAction(parser.loadAction("action(uknownParam=aa)"));
Assert.assertEquals("action(param1=value1,param2=value2)", parser.saveAction(parser.loadAction("action(param1=value1,param2=value2)")));
Assert.assertEquals("action(param1=value1,param2=)", parser.saveAction(parser.loadAction("action(param1=value1)")));
Assert.assertEquals("action(param1=value1,param2=2\\(\\=\\,\\\\)", parser.saveAction(parser.loadAction("action(param1=value1,param2=2\\(\\=\\,\\\\)")));
}