@Test public void testContextListenerIsSet() throws Exception { try (WizardCommandController tester = testHarness.createWizardController(MyFirstWizard.class)) { tester.initialize(); Assert.assertTrue("Wizard is not on a valid state", tester.isValid()); Assert.assertTrue("Listener is not set", listener.isContextInitialized()); tester.execute(); } Assert.assertFalse("Listener is still set", listener.isContextInitialized()); }
@Test public void testProjectTypeWithNoBuildSystemRequirements() 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", "norequirements"); Assert.assertEquals( "norequirements", InputComponents.getValueFor(wizard.getInputs().get("type")).toString()); } finally { tempDir.delete(); } }