List of usage examples for org.apache.commons.collections TransformerUtils constantTransformer
public static Transformer constantTransformer(Object constantToReturn)
From source file:CookieBagV2.java
private void prepareCookieBag() { cookieBag = TransformedBag.decorate(new HashBag(Arrays.asList(cookieJar)), TransformerUtils.constantTransformer(cookieJar[2])); // cookieBag.addAll(Arrays.asList(cookieJar)); }
From source file:com.redhat.rhn.frontend.servlets.test.PxtSessionDelegateImplTest.java
public final void testLoadPxtSessionWhenPxtSessionIdIsNull() { setUpLoadPxtSession();/*from w ww.ja v a2s. c om*/ mockRequest.stubs().method("getCookies").will(returnValue(null)); pxtSessionDelegate.setCreatePxtSessionCallback(TransformerUtils.constantTransformer(getPxtSession())); pxtSessionDelegate.loadPxtSession(getRequest()); }
From source file:com.redhat.rhn.frontend.servlets.test.PxtSessionDelegateImplTest.java
public final void testLoadPxtSessionWhenPxtSessionIdIsInvalid() { setUpLoadPxtSession();/*from w ww . jav a 2 s.c o m*/ mockRequest.stubs().method("getCookies").will(returnValue(new Cookie[] { getPxtCookie() })); pxtSessionDelegate.setCreatePxtSessionCallback(TransformerUtils.constantTransformer(getPxtSession())); pxtSessionDelegate.loadPxtSession(getRequest()); }