use of org.eclipse.scout.rt.shared.extension.fixture.BasicForm in project scout.rt by eclipse.
the class ExtensionRegistryInstantiationTest method testBasicFormExtensionWithSubclassedFormHandler.
@Test
public void testBasicFormExtensionWithSubclassedFormHandler() throws Exception {
IExtensionRegistry registry = BEANS.get(IExtensionRegistry.class);
registry.register(BasicFormExtension02.class);
// test code
BasicForm basicForm = new BasicForm();
assertExtensions(basicForm.getAllExtensions(), BasicFormExtension02.class);
// because no filter is applied, the form handler is instantiated too, which it shouldn't.
// as soon as a filter checks which inner classes to instantiate, the assertion must be changed to 'assertNull'.
assertNotNull(basicForm.getContribution(BasicFormExtension02.ReadOnlyModifyHandler.class));
}
use of org.eclipse.scout.rt.shared.extension.fixture.BasicForm in project scout.rt by eclipse.
the class ExtensionRegistryInstantiationTest method testNameFieldExtension.
@Test
public void testNameFieldExtension() throws Exception {
BEANS.get(IExtensionRegistry.class).register(NameFieldExtension.class);
BasicForm basicForm = new BasicForm();
assertExtensions(basicForm.getAllExtensions());
assertExtensions(basicForm.getMainBox().getAllExtensions());
assertExtensions(basicForm.getTopBox().getAllExtensions());
assertExtensions(basicForm.getNameField().getAllExtensions(), NameFieldExtension.class);
assertExtensions(basicForm.getBottomBox().getAllExtensions());
assertExtensions(basicForm.getFirstNameField().getAllExtensions());
}
use of org.eclipse.scout.rt.shared.extension.fixture.BasicForm in project scout.rt by eclipse.
the class ExtensionRegistryInstantiationTest method testExtensionForGroupBoxWithSecondInnerField.
@Test
public void testExtensionForGroupBoxWithSecondInnerField() throws Exception {
IExtensionRegistry registry = BEANS.get(IExtensionRegistry.class);
registry.register(TopBoxExtension.class);
// test code
BasicForm basicForm = new BasicForm();
assertExtensions(basicForm.getAllExtensions());
assertExtensions(basicForm.getTopBox().getAllExtensions(), TopBoxExtension.class);
List<IFormField> topBoxFields = basicForm.getTopBox().getFields();
assertEquals(2, topBoxFields.size());
assertTrue(topBoxFields.get(0) instanceof BasicForm.MainBox.TopBox.NameField);
assertFalse(topBoxFields.get(0) instanceof TopBoxExtension.SecondNameField);
assertTrue(topBoxFields.get(1) instanceof TopBoxExtension.SecondNameField);
}
use of org.eclipse.scout.rt.shared.extension.fixture.BasicForm in project scout.rt by eclipse.
the class ExtensionRegistryInstantiationTest method testBasicFormExtension.
@Test
public void testBasicFormExtension() throws Exception {
BEANS.get(IExtensionRegistry.class).register(BasicFormExtension.class);
BasicForm basicForm = new BasicForm();
assertExtensions(basicForm.getAllExtensions(), BasicFormExtension.class);
}
use of org.eclipse.scout.rt.shared.extension.fixture.BasicForm in project scout.rt by eclipse.
the class ExtensionRegistryInstantiationTest method testStaticPojoContainerExtension.
@Test
public void testStaticPojoContainerExtension() throws Exception {
BEANS.get(IExtensionRegistry.class).register(StaticPojoContainerExtension.NameFieldExtension.class);
BEANS.get(IExtensionRegistry.class).register(StaticPojoContainerExtension.FirstNameFieldExtension.class);
BasicForm basicForm = new BasicForm();
assertExtensions(basicForm.getAllExtensions());
assertExtensions(basicForm.getMainBox().getAllExtensions());
assertExtensions(basicForm.getTopBox().getAllExtensions());
assertExtensions(basicForm.getNameField().getAllExtensions(), StaticPojoContainerExtension.NameFieldExtension.class);
assertExtensions(basicForm.getBottomBox().getAllExtensions());
assertExtensions(basicForm.getFirstNameField().getAllExtensions(), StaticPojoContainerExtension.FirstNameFieldExtension.class);
}
Aggregations