TreeViewer viewer = editor.testingGetViewer();
viewer.setSelection(new StructuredSelection(featureType.getDescriptor(0)));
action.runWithEvent(new Event());
SimpleFeatureTypeBuilder builder = (SimpleFeatureTypeBuilder) editor.testingGetViewer().getInput();
assertEquals(1, builder.buildFeatureType().getAttributeCount());
assertEquals(String.class, builder.buildFeatureType().getDescriptor(0).getType().getBinding());
assertEquals("name", builder.buildFeatureType().getDescriptor(0).getName()); //$NON-NLS-1$
IAction create = editor.getCreateAttributeAction();
create.runWithEvent(new Event());
create.runWithEvent(new Event());
assertEquals(3, builder.buildFeatureType().getAttributeCount());
List<AttributeDescriptor> attrs = new ArrayList<AttributeDescriptor>(2);
attrs.add(builder.buildFeatureType().getDescriptor(1));
attrs.add(builder.buildFeatureType().getDescriptor(2));
viewer.setSelection(new StructuredSelection(attrs));
action.runWithEvent(new Event());
assertEquals(1, builder.buildFeatureType().getAttributeCount());
assertEquals(String.class, builder.buildFeatureType().getDescriptor(0).getType().getBinding());
assertEquals("name", builder.buildFeatureType().getDescriptor(0).getName()); //$NON-NLS-1$
}