public void testProjectTypeSwitching() throws Exception
{
File tempDir = OperatingSystemUtils.createTempDir();
try
{
WizardCommandController wizard = testHarness.createWizardController(NewProjectWizard.class);
wizard.initialize();
Assert.assertFalse(wizard.canMoveToNextStep());
wizard.setValueFor("named", "test");
wizard.setValueFor("targetLocation", tempDir);
wizard.setValueFor("topLevelPackage", "org.example");
wizard.setValueFor("type", "mock");
Assert.assertEquals("buildsystem", InputComponents.getValueFor(wizard.getInputs().get("buildSystem"))
.toString());
wizard.setValueFor("type", "mock2");
Assert.assertEquals("buildsystem2", InputComponents.getValueFor(wizard.getInputs().get("buildSystem"))
.toString());
UISelectOne<ProjectProvider> buildSystems = (UISelectOne<ProjectProvider>) wizard.getInputs().get("buildSystem");
List<ProjectProvider> choices = Iterators.asList(buildSystems.getValueChoices());
Assert.assertEquals(1, choices.size());
wizard.setValueFor("type", "mock3");
choices = Iterators.asList(buildSystems.getValueChoices());
Assert.assertEquals(2, choices.size());
wizard.setValueFor("type", "mock2");
choices = Iterators.asList(buildSystems.getValueChoices());
Assert.assertEquals(1, choices.size());
}
finally
{