Ejemplo n.º 1
0
  @Test
  public void rootHasCorrectComponents() {
    Component root = ctx.getRootComponent();

    VerticalLayout vlayout = (VerticalLayout) root;

    assertThat(vlayout.getComponentCount(), is(3));
  }
Ejemplo n.º 2
0
  @Test
  public void rootChildHasCorrectComponents() {
    Component root = ctx.getRootComponent();
    VerticalLayout vlayout = (VerticalLayout) root;
    HorizontalLayout hlayout = (HorizontalLayout) vlayout.getComponent(0);

    assertThat(hlayout.getComponentCount(), is(5));
    assertThat(hlayout.getComponent(0).getCaption(), is("FooBar"));
    assertThat(hlayout.getComponent(1).getCaption(), is("Native click me"));
    assertThat(hlayout.getComponent(2).getCaption(), is("Another button"));
    assertThat(hlayout.getComponent(3).getCaption(), is("Yet another button"));
    assertThat(hlayout.getComponent(4).getCaption(), is("Click me"));
    assertThat(hlayout.getComponent(4).getWidth(), is(150f));

    // Check the remaining two components of the vertical layout
    assertTextField(vlayout);
    assertTextArea(vlayout);
  }