@Test
public void testFormExtraction() {

	// input form
	String script = "${input_form=}";
	Map<String, Input> forms = Input.extractSimpleQueryParam(script);
	assertEquals(1, forms.size());
	Input form = forms.get("input_form");
	assertEquals("input_form", form.name);
	assertNull(form.displayName);
	assertEquals("", form.defaultValue);
	assertNull(form.options);
	// input form with display name & default value
	script = "${input_form(Input Form)=xxx}";
	forms = Input.extractSimpleQueryParam(script);
	form = forms.get("input_form");
	assertEquals("xxx", form.defaultValue);
	// selection form
	script = "${select_form(Selection Form)=op1,op1|op2(Option 2)|op3}";
	form = Input.extractSimpleQueryParam(script).get("select_form");
	assertEquals("select_form", form.name);
	assertEquals("op1", form.defaultValue);
	assertArrayEquals(new ParamOption[]{new ParamOption("op1", null),
			new ParamOption("op2", "Option 2"), new ParamOption("op3", null)}, form.options);
	// checkbox form
	script = "${checkbox:checkbox_form=op1,op1|op2|op3}";
	form = Input.extractSimpleQueryParam(script).get("checkbox_form");
	assertEquals("checkbox_form", form.name);
	assertEquals("checkbox", form.type);
	assertArrayEquals(new Object[]{"op1"}, (Object[]) form.defaultValue);
	assertArrayEquals(new ParamOption[]{new ParamOption("op1", null),
			new ParamOption("op2", null), new ParamOption("op3", null)}, form.options);
	// checkbox form with multiple default checks
	script = "${checkbox:checkbox_form(Checkbox Form)=op1|op3,op1(Option 1)|op2|op3}";
	form = Input.extractSimpleQueryParam(script).get("checkbox_form");
	assertEquals("checkbox_form", form.name);
	assertEquals("Checkbox Form", form.displayName);
	assertEquals("checkbox", form.type);
	assertArrayEquals(new Object[]{"op1", "op3"}, (Object[]) form.defaultValue);
	assertArrayEquals(new ParamOption[]{new ParamOption("op1", "Option 1"),
			new ParamOption("op2", null), new ParamOption("op3", null)}, form.options);
	// checkbox form with no default check
	script = "${checkbox:checkbox_form(Checkbox Form)=,op1(Option 1)|op2(Option 2)|op3(Option 3)}";
	form = Input.extractSimpleQueryParam(script).get("checkbox_form");
	assertEquals("checkbox_form", form.name);
	assertEquals("Checkbox Form", form.displayName);
	assertEquals("checkbox", form.type);
	assertArrayEquals(new Object[]{}, (Object[]) form.defaultValue);
	assertArrayEquals(new ParamOption[]{new ParamOption("op1", "Option 1"),
			new ParamOption("op2", "Option 2"), new ParamOption("op3", "Option 3")}, form.options);
}