@Test public void testValueOfParam() { assertEquals(JsCompileMode.COMPILE_CONCAT, JsCompileMode.valueOfParam(null)); assertEquals(JsCompileMode.COMPILE_CONCAT, JsCompileMode.valueOfParam("0")); assertEquals(JsCompileMode.CONCAT_COMPILE_EXPORT_ALL, JsCompileMode.valueOfParam("1")); assertEquals(JsCompileMode.CONCAT_COMPILE_EXPORT_EXPLICIT, JsCompileMode.valueOfParam("2")); } }
@Test public void testValueOfParam() { assertEquals(JsCompileMode.COMPILE_CONCAT, JsCompileMode.valueOfParam(null)); assertEquals(JsCompileMode.COMPILE_CONCAT, JsCompileMode.valueOfParam("0")); assertEquals(JsCompileMode.CONCAT_COMPILE_EXPORT_ALL, JsCompileMode.valueOfParam("1")); assertEquals(JsCompileMode.CONCAT_COMPILE_EXPORT_EXPLICIT, JsCompileMode.valueOfParam("2")); } }
public JsUri(UriStatus status, Uri origUri, Collection<String> libs, Collection<String> have) { super(status, origUri); if (origUri != null) { String contextParam = origUri.getQueryParameter(Param.CONTAINER_MODE.getKey()); this.context = RenderingContext.valueOfParam(contextParam); String compileParam = origUri.getQueryParameter(Param.COMPILE_MODE.getKey()); this.compileMode = JsCompileMode.valueOfParam(compileParam); this.jsload = "1".equals(origUri.getQueryParameter(Param.JSLOAD.getKey())); this.onload = origUri.getQueryParameter(Param.ONLOAD.getKey()); this.nohint = "1".equals(origUri.getQueryParameter(Param.NO_HINT.getKey())); this.repository = origUri.getQueryParameter(Param.REPOSITORY_ID.getKey()); } else { this.context = RenderingContext.getDefault(); this.compileMode = JsCompileMode.getDefault(); this.jsload = false; this.onload = null; this.nohint = false; this.repository = null; } this.libs = nonNullLibs(libs); this.loadedLibs = nonNullLibs(have); this.origUri = origUri; }