Package org.springframework.springfaces.template.ui.DecorateAllHandler

Examples of org.springframework.springfaces.template.ui.DecorateAllHandler.DecoratedChild.apply()


  @Test
  public void shouldApply() throws Exception {
    FaceletHandler handler = mock(ComponentHandler.class);
    List<FaceletHandler> variableDeclarationHandlers = new ArrayList<FaceletHandler>();
    DecoratedChild decorated = this.delegate.createdDecoratedChild(handler, variableDeclarationHandlers);
    decorated.apply(this.ctx, this.parent, "template");
    verify(this.ctx).pushClient(this.templateClient.capture());
    verify(this.ctx).includeFacelet(this.parent, "template");
    this.templateClient.getValue().apply(this.ctx, this.parent, null);
    verify(handler).apply(this.ctx, this.parent);
    verify(this.ctx).popClient(this.templateClient.getValue());
View Full Code Here


  public void shouldApplyDefine() throws Exception {
    FaceletHandler handler = mock(ComponentHandler.class);
    List<FaceletHandler> variableDeclarationHandlers = new ArrayList<FaceletHandler>();
    variableDeclarationHandlers.add(mockDefineHandler());
    DecoratedChild decorated = this.delegate.createdDecoratedChild(handler, variableDeclarationHandlers);
    decorated.apply(this.ctx, this.parent, "template");
    verify(this.ctx).pushClient(this.templateClient.capture());
    this.templateClient.getValue().apply(this.ctx, this.parent, "defineName");
    verify(this.innerDefineHandler).apply(this.ctx, this.parent);
  }
View Full Code Here

    FaceletHandler paramHandler = mock(ParamHandler.class);
    variableDeclarationHandlers.add(paramHandler);
    VariableMapper originalVariableMapper = mock(VariableMapper.class);
    given(this.ctx.getVariableMapper()).willReturn(originalVariableMapper);
    DecoratedChild decorated = this.delegate.createdDecoratedChild(handler, variableDeclarationHandlers);
    decorated.apply(this.ctx, this.parent, null);
    verify(this.ctx, times(2)).setVariableMapper(this.variableMapper.capture());
    assertThat(this.variableMapper.getAllValues().get(0), is(VariableMapperWrapper.class));
    assertThat(this.variableMapper.getAllValues().get(1), is(sameInstance(originalVariableMapper)));
    verify(paramHandler).apply(this.ctx, this.parent);
  }
View Full Code Here

  @Test
  public void shouldApply() throws Exception {
    FaceletHandler handler = mock(ComponentHandler.class);
    List<FaceletHandler> variableDeclarationHandlers = new ArrayList<FaceletHandler>();
    DecoratedChild decorated = this.delegate.createdDecoratedChild(handler, variableDeclarationHandlers);
    decorated.apply(this.ctx, this.parent, "template");
    verify(this.ctx).pushClient(this.templateClient.capture());
    verify(this.ctx).includeFacelet(this.parent, "template");
    this.templateClient.getValue().apply(this.ctx, this.parent, null);
    verify(handler).apply(this.ctx, this.parent);
    verify(this.ctx).popClient(this.templateClient.getValue());
View Full Code Here

  public void shouldApplyDefine() throws Exception {
    FaceletHandler handler = mock(ComponentHandler.class);
    List<FaceletHandler> variableDeclarationHandlers = new ArrayList<FaceletHandler>();
    variableDeclarationHandlers.add(mockDefineHandler());
    DecoratedChild decorated = this.delegate.createdDecoratedChild(handler, variableDeclarationHandlers);
    decorated.apply(this.ctx, this.parent, "template");
    verify(this.ctx).pushClient(this.templateClient.capture());
    this.templateClient.getValue().apply(this.ctx, this.parent, "defineName");
    verify(this.innerDefineHandler).apply(this.ctx, this.parent);
  }
View Full Code Here

    FaceletHandler paramHandler = mock(ParamHandler.class);
    variableDeclarationHandlers.add(paramHandler);
    VariableMapper originalVariableMapper = mock(VariableMapper.class);
    given(this.ctx.getVariableMapper()).willReturn(originalVariableMapper);
    DecoratedChild decorated = this.delegate.createdDecoratedChild(handler, variableDeclarationHandlers);
    decorated.apply(this.ctx, this.parent, null);
    verify(this.ctx, times(2)).setVariableMapper(this.variableMapper.capture());
    assertThat(this.variableMapper.getAllValues().get(0), is(VariableMapperWrapper.class));
    assertThat(this.variableMapper.getAllValues().get(1), is(sameInstance(originalVariableMapper)));
    verify(paramHandler).apply(this.ctx, this.parent);
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.