@Test
public void testCloseableBSF() throws Exception {
final SiteContext site = micro.getSite();
final String canonicalName = TestController.class.getCanonicalName();
Context context = new MicroContext<String>()
.with(Globals.LOG, site.getLog())
.with(Globals.SITE, site);
site.getControllerManager().execute("Foo.bsh", (MicroContext) context, Collections.singletonMap("foo", "bar"));
Assert.assertTrue("Foo is not Bar, broken configuration",
((String) context.get("foo")).equalsIgnoreCase("bar"));
site.getControllerManager().execute("Bat.bsh", (MicroContext) context, Collections.singletonMap("Bat", "Man"));
Assert.assertTrue("Bat is not the Man, c'mon man",
((String) context.get("Bat")).equalsIgnoreCase("Man"));
site.getControllerManager().execute("ca.simplegames.micro.TestController",
(MicroContext) context, Collections.singletonMap("class", canonicalName));
Assert.assertTrue("Can't execute Java class",
((String) context.get("class")).equalsIgnoreCase(canonicalName));
}