Java 类org.apache.commons.collections.TransformerUtils 实例源码

项目:commandline-hero    文件:HomeController.java   
@RequestMapping(value = "/programs.htm", method = RequestMethod.GET)
public String programs(final Model model) {
    final List<Meta> knownClasses = executionService.getKnownClasses();

    final Map map = TransformedMap.decorate(new MultiValueMap(),
            TransformerUtils.invokerTransformer("getProgram"),
            TransformerUtils.nopTransformer());
    for (final Meta meta : knownClasses) {
        map.put(meta, meta);
    }
    model.addAttribute("programmap", map);
    return "programs";

}
项目:spacewalk    文件:PxtSessionDelegateImplTest.java   
public final void testLoadPxtSessionWhenPxtSessionIdIsNull() {
    setUpLoadPxtSession();

    context().checking(new Expectations() { {
        allowing(mockRequest).getCookies();
        will(returnValue(null));
    } });

    pxtSessionDelegate.setCreatePxtSessionCallback(
            TransformerUtils.constantTransformer(getPxtSession()));

    pxtSessionDelegate.loadPxtSession(getRequest());
}
项目:spacewalk    文件:PxtSessionDelegateImplTest.java   
public final void testLoadPxtSessionWhenPxtSessionIdIsInvalid() {
    setUpLoadPxtSession();

    context().checking(new Expectations() { {
        allowing(mockRequest).getCookies();
        will(returnValue(new Cookie[] {getPxtCookie()}));
    } });

    pxtSessionDelegate.setCreatePxtSessionCallback(
            TransformerUtils.constantTransformer(getPxtSession()));

    pxtSessionDelegate.loadPxtSession(getRequest());
}
项目:spacewalk    文件:PxtSessionDelegateImplTest.java   
PxtSessionDelegateImplStub() {
    findPxtSessionByIdCallback = TransformerUtils.nullTransformer();
    createPxtSessionCallback = TransformerUtils.nullTransformer();
}