final TestElement element = TestElement.TYPE.instantiate();
try
{
final DefinitionLoader.Reference<DialogDef> definition = DefinitionLoader.sdef( PartParentFunctionTests.class ).dialog();
final DialogPart dialogPart = new DialogPart();
try
{
dialogPart.init( null, element, definition.resolve(), Collections.<String,String>emptyMap() );
dialogPart.initialize();
final GroupPart groupPart = (GroupPart) dialogPart.children().all().get( 0 );
final PropertyEditorPart propertyEditorPart = (PropertyEditorPart) groupPart.children().all().get( 0 );
testForExpectedValue( new PartFunctionContext( propertyEditorPart, element ), "${ Part }", propertyEditorPart );
testForExpectedValue( new PartFunctionContext( propertyEditorPart, element ), "${ Part.Parent }", groupPart );
testForExpectedValue( new PartFunctionContext( propertyEditorPart, element ), "${ Part.Parent.Parent }", dialogPart );
}
finally
{
dialogPart.dispose();
}
}
finally
{
element.dispose();