public class WizardControllerTest extends TestCase {
public void testWizardController()
throws NoSuchFieldException, IllegalAccessException, ComponentSearchException {
// 1. Create a wizard controller test waiting for finish call
final boolean [] finished = {false};
WizardController controller = new ControllerTest(new DefaultUserPreferences(), new SwingViewFactory()) {
@Override
public void finish() {
finished [0] = true;
}
};
WizardPane view = (WizardPane)controller.getView();
// Retrieve view back and next buttons
final JButton backOptionButton = (JButton)TestUtilities.getField(view, "backOptionButton");
final JButton nextFinishOptionButton = (JButton)TestUtilities.getField(view, "nextFinishOptionButton");
String nextFinishOptionButtonText = nextFinishOptionButton.getText();
// Check view displays first step view