public boolean process(JsRequest jsRequest, JsResponseBuilder builder) { if (!jsRequest.getJsUri().cajoleContent()) { ImmutableList.Builder<JsContent> listBuilder = ImmutableList.builder(); for (JsContent js : builder.build().getAllJsContent()) { if (!isCajole(js)) { listBuilder.add(js); } } builder.clearJs().appendAllJs(listBuilder.build()); } return true; }
private JsUri mockJsUri(boolean cajole) { JsUri uri = control.createMock(JsUri.class); expect(uri.cajoleContent()).andReturn(cajole).anyTimes(); return uri; }
private JsUri mockJsUri(boolean cajole) { JsUri uri = control.createMock(JsUri.class); expect(uri.cajoleContent()).andReturn(cajole).anyTimes(); return uri; }
if (ctx.cajoleContent()) { uri.addQueryParameter(Param.CAJOLE.getKey(), "1");
private JsUri mockGadgetContext(boolean nocache, boolean debug, List<String> extern, List<String> loaded, boolean isContainer, Map<String, String> params, JsCompileMode compileMode, String repository) { JsUri context = createMock(JsUri.class); expect(context.getContainer()).andStubReturn(CONTAINER); expect(context.isNoCache()).andStubReturn(nocache); expect(context.isDebug()).andStubReturn(debug); expect(context.getGadget()).andStubReturn(GADGET_URI); expect(context.getContext()).andStubReturn( isContainer ? RenderingContext.CONTAINER : RenderingContext.GADGET); expect(context.getLibs()).andStubReturn(extern); expect(context.getLoadedLibs()).andStubReturn( loaded == null ? ImmutableList.<String>of() : loaded); expect(context.getOnload()).andStubReturn(null); expect(context.isJsload()).andStubReturn(false); expect(context.isNohint()).andStubReturn(false); expect(context.getExtensionParams()).andStubReturn(params); expect(context.getOrigUri()).andStubReturn(null); expect(context.getCompileMode()).andStubReturn(compileMode); expect(context.cajoleContent()).andStubReturn(false); expect(context.getRepository()).andStubReturn(repository); replay(context); return context; }
private JsUri mockGadgetContext(boolean nocache, boolean debug, List<String> extern, List<String> loaded, boolean isContainer, Map<String, String> params, JsCompileMode compileMode, String repository) { JsUri context = createMock(JsUri.class); expect(context.getContainer()).andStubReturn(CONTAINER); expect(context.isNoCache()).andStubReturn(nocache); expect(context.isDebug()).andStubReturn(debug); expect(context.getGadget()).andStubReturn(GADGET_URI); expect(context.getContext()).andStubReturn( isContainer ? RenderingContext.CONTAINER : RenderingContext.GADGET); expect(context.getLibs()).andStubReturn(extern); expect(context.getLoadedLibs()).andStubReturn( loaded == null ? ImmutableList.<String>of() : loaded); expect(context.getOnload()).andStubReturn(null); expect(context.isJsload()).andStubReturn(false); expect(context.isNohint()).andStubReturn(false); expect(context.getExtensionParams()).andStubReturn(params); expect(context.getOrigUri()).andStubReturn(null); expect(context.getCompileMode()).andStubReturn(compileMode); expect(context.cajoleContent()).andStubReturn(false); expect(context.getRepository()).andStubReturn(repository); replay(context); return context; }
public JsUri(UriStatus status, JsUri origJsUri) { super(status, origJsUri.getRefresh(), origJsUri.isDebug(), origJsUri.isNoCache(), origJsUri.getContainer(), origJsUri.getGadget()); this.setCajoleContent(origJsUri.cajoleContent()); this.libs = origJsUri.getLibs(); this.loadedLibs = origJsUri.getLoadedLibs(); this.onload = origJsUri.getOnload(); this.jsload = origJsUri.isJsload(); this.nohint = origJsUri.isNohint(); this.compileMode = origJsUri.getCompileMode(); this.context = origJsUri.getContext(); this.origUri = origJsUri.getOrigUri(); this.repository = origJsUri.getRepository(); this.extensionParams = origJsUri.getExtensionParams(); }