@Test
public void testCreateInlineScriptCheckFactory() throws Exception {

    final ProgressCheck check = ScriptProgressCheck
            .createInlineScriptCheckFactory("", "").newInstance(obj().get());
    assertEquals("check filename", ScriptProgressCheck.FILENAME_INLINE_SCRIPT, check.getCheckName());
    final ProgressCheck checkJs = ScriptProgressCheck
            .createInlineScriptCheckFactory("", "js").newInstance(obj().get());
    assertEquals("checkJs filename", ScriptProgressCheck.FILENAME_INLINE_SCRIPT, checkJs.getCheckName());
    final ProgressCheckFactory checkConfigFactory = ScriptProgressCheck
            .createInlineScriptCheckFactory("function getCheckName() { return config.checkNameForTest; }", "js");
    assertEquals("checkConfig filename when null config",
            ScriptProgressCheck.FILENAME_INLINE_SCRIPT, checkConfigFactory.newInstance(null).getCheckName());
    assertEquals("checkConfig foobar when null config",
            "foobar", checkConfigFactory.newInstance(key("checkNameForTest", "foobar").get()).getCheckName());
}