use of org.eclipse.scout.rt.client.ui.form.fields.composer.node.EitherOrNode in project scout.rt by eclipse.
the class ComposerFieldTest method testImportEitherOrNode.
@Test
public void testImportEitherOrNode() throws Exception {
// setup field data
ComposerEitherOrNodeData eitherNodeData = new ComposerEitherOrNodeData();
eitherNodeData.setBeginOfEitherOr(true);
ComposerEitherOrNodeData orNodeData = new ComposerEitherOrNodeData();
List<TreeNodeData> rootList = Arrays.<TreeNodeData>asList(eitherNodeData, orNodeData);
m_fieldData.setRoots(rootList);
// import
m_composerField.importFormFieldData(m_fieldData, false);
// verify import
ITreeNode rootNode = m_composerField.getTree().getRootNode();
assertEquals(2, rootNode.getChildNodeCount());
//
ITreeNode eitherNode = rootNode.getChildNode(0);
assertTrue(eitherNode instanceof EitherOrNode);
assertTrue(((EitherOrNode) eitherNode).isBeginOfEitherOr());
assertFalse(((EitherOrNode) eitherNode).isNegative());
//
ITreeNode orNode = rootNode.getChildNode(1);
assertTrue(orNode instanceof EitherOrNode);
assertFalse(((EitherOrNode) orNode).isBeginOfEitherOr());
assertFalse(((EitherOrNode) orNode).isNegative());
}
Aggregations