use of org.linkki.core.ui.components.SubsetChooser in project linkki by linkki-framework.
the class UISubsetChooserTest method testRightCaptionAnnotation.
@Test
public void testRightCaptionAnnotation() {
SubsetChooser subsetChooser = createSubsetChooser(new TestPmo());
assertThat(subsetChooser.getRightColumnCaption(), is("Right Column Caption"));
}
use of org.linkki.core.ui.components.SubsetChooser in project linkki by linkki-framework.
the class UISubsetChooserTest method createSubsetChooser.
/**
* Returns a {@code SubsetChooser} that is bound to a {@link AnnotationTestPmo} using the
* IPM data binder. The {@code SubsetChooser} is part of a mostly mocked UI so that a
* rudimentary Vaadin environment is in place.
*
* @return a {@code SubsetChooser} that is bound to a {@link AnnotationTestPmo}
*/
private SubsetChooser createSubsetChooser(Object pmo) {
try {
SubsetChooser subsetChooser = (SubsetChooser) TestUiUtil.createFirstComponentOf(pmo);
// initializes the internal itemIdMapper which is needed to
// fake selection from UI using AbstractSelect#changeVariables(...)
subsetChooser.paintContent(mock(PaintTarget.class));
return subsetChooser;
} catch (PaintException e) {
throw new RuntimeException(e);
}
}
use of org.linkki.core.ui.components.SubsetChooser in project linkki by linkki-framework.
the class UISubsetChooserTest method testDefaultItemCaptionProvider.
@Test
public void testDefaultItemCaptionProvider() {
SubsetChooser subsetChooser = createSubsetChooser(new TestPmo());
assertThat(subsetChooser.getItemCaption(null), is(""));
assertThat(subsetChooser.getItemCaption(TestEnum.ONE), is("ONE"));
}
use of org.linkki.core.ui.components.SubsetChooser in project linkki by linkki-framework.
the class UISubsetChooserTest method testNullSelectionIsAllowed.
@Test
public void testNullSelectionIsAllowed() {
SubsetChooser subsetChooser = createSubsetChooser(new TestPmo());
assertThat(subsetChooser.isNullSelectionAllowed(), is(true));
}
use of org.linkki.core.ui.components.SubsetChooser in project linkki by linkki-framework.
the class UISubsetChooserIntegrationTest method testLeftRightCaptions.
@Test
public void testLeftRightCaptions() {
SubsetChooser subsetChooser = getDynamicComponent();
assertThat(subsetChooser.getLeftColumnCaption(), is("leftC"));
assertThat(subsetChooser.getRightColumnCaption(), is("rightC"));
}
Aggregations