ScriptingContainer instance = new ScriptingContainer(LocalContextScope.THREADSAFE);
instance.setError(pstream);
instance.setOutput(pstream);
instance.setWriter(writer);
instance.setErrorWriter(writer);
BiVariableMap result = instance.getVarMap();
result.put("@name", "camellia");
assertEquals("camellia", instance.getVarMap().get("@name"));
result.put("COLOR", "red");
assertEquals("red", instance.getVarMap().get("COLOR"));
// class variable injection does not work
//result.put("@@season", "spring");
//assertEquals("spring", instance.getVarMap().get("@@season"));
result.put("$category", "flower");
assertEquals("flower", instance.getVarMap().get("$category"));
result.put("@name", "maple");
assertEquals("maple", instance.getVarMap().get("@name"));
result.put("COLOR", "orangered");
assertEquals("orangered", instance.getVarMap().get("COLOR"));
result.put("$category", "tree");
assertEquals("tree", instance.getVarMap().get("$category"));
result.put("parameter", 1.2345);
assertEquals(1.2345, instance.getVarMap().get("parameter"));
result.put("@coefficient", 4);
assertEquals(4, instance.getVarMap().get("@coefficient"));
result.clear();
instance = null;
}