private static final String NL = System.getProperty("line.separator");
public void test() {
ExecutionContext context = new MockExecutionContext();
JavaResult dummyResult = new JavaResult(true);
FilterResult.setResults(context, dummyResult);
context.getBeanContext().addBean("string", "blaat", null);
context.getBeanContext().addBean("emptyMap", Collections.emptyMap(), null);
context.getBeanContext().addBean("emptyList", Collections.emptyList(), null);
context.getBeanContext().addBean("emptyArray", new String[0], null);
Map<String, String> stringMap = new HashMap<String, String>();
stringMap.put("v1", "some text");
stringMap.put("v2", "other text");
stringMap.put("v3", null);
context.getBeanContext().addBean("stringMap", stringMap, null);
List<Integer> integerList = new ArrayList<Integer>();
integerList.add(1);
integerList.add(2);
integerList.add(null);
context.getBeanContext().addBean("integerList", integerList, null);
context.getBeanContext().addBean("stringArray", new String[] {"a1", "a2", "a3", null}, null);
Map<String, Object> objectMap = new LinkedHashMap<String, Object>();
objectMap.put("self", objectMap);
Map<String, Object> object2Map = new LinkedHashMap<String, Object>();
object2Map.put("parent", objectMap);
objectMap.put("map", object2Map);
List<Object> list = new ArrayList<Object>();
list.add(list);
list.add(objectMap);
object2Map.put("list", list);
context.getBeanContext().addBean("objectMap", objectMap, null);
context.getAttributes().put("multiline", "hello\nworld");
String actual = MultiLineToStringBuilder.toString(context);
System.out.println(actual);