use of org.linkki.core.nls.pmo.sample.SamplePmo in project linkki by linkki-framework.
the class PmoNlsServiceSectionTest method setUp.
@Before
public void setUp() {
BindingContext context = TestBindingContext.create();
BaseSection section = new DefaultPmoBasedSectionFactory().createBaseSection(new SamplePmo(), context);
HorizontalLayout header = (HorizontalLayout) section.getComponent(0);
sectionHeader = (Label) header.getComponent(0);
GridLayout sectionContent = (GridLayout) ((Panel) section.getComponent(1)).getContent();
textfieldLabelWithTranslation = (Label) sectionContent.getComponent(0, 0);
textfieldLabelWithoutTranslation = (Label) sectionContent.getComponent(0, 1);
buttonLabelWithTranslation = (Label) sectionContent.getComponent(0, 2);
buttonWithTranslatedCaption = (Button) sectionContent.getComponent(1, 2);
invisibleButtonLabelWithTranslation = (Label) sectionContent.getComponent(0, 3);
buttonWithoutTranslatedCaption = (Button) sectionContent.getComponent(1, 3);
// test setup
PmoNlsService.get();
textfieldLabelTranslation = getLabelTranslation(SamplePmo.PROPERTY_TEXTFIELD);
assertThat(textfieldLabelTranslation, is(not(SamplePmo.PMO_LABEL)));
buttonLabelTranslation = getLabelTranslation(SamplePmo.PROPERTY_MYBUTTON);
assertThat(buttonLabelTranslation, is(not(SamplePmo.PMO_LABEL)));
buttonCaptionTranslation = getCaptionTranslation(SamplePmo.PROPERTY_MYBUTTON);
assertThat(buttonCaptionTranslation, is(not(SamplePmo.PMO_CAPTION)));
assertThat(getLabelTranslation(SamplePmo.PROPERTY_CBFIELD), is(SamplePmo.PMO_LABEL));
assertThat(getLabelTranslation(SamplePmo.PROPERTY_MYBUTTON2), is(buttonLabelTranslation));
assertThat(getCaptionTranslation(SamplePmo.PROPERTY_MYBUTTON2), is(SamplePmo.PMO_CAPTION));
}
Aggregations