public void testUnknowParams() throws Exception { Window uispecDialog = createUISpecWindow(JOB_WITH_UNKNOWN_PARAMS); TextBox runTextBox = uispecDialog.getTextBox(ComponentMatchers.componentLabelFor("run")); assertTrue(runTextBox.textEquals("Unkown parameter")); assertTrue(runTextBox.iconEquals(GuiUtil.loadIcon("error.png"))); assertFalse(uispecDialog.getButton("OK").isEnabled()); }
public void testUnsupportedParams() throws Exception { Window uispecDialog = createUISpecWindow(JOB_WITH_UNSUPPORTED_PARAMS); TextBox runTextBox = uispecDialog.getTextBox(ComponentMatchers.componentLabelFor("run")); assertTrue(runTextBox.textEquals("RunParameterDefinition is unsupported.")); assertTrue(runTextBox.iconEquals(GuiUtil.loadIcon("error.png"))); assertFalse(uispecDialog.getButton("OK").isEnabled()); }
public void testDisplay() throws Exception { Window uispecDialog = createUISpecWindow(JOB_WITH_GOOD_PARAMS); assertEquals("This build requires parameters", uispecDialog.getTitle()); assertTrue(uispecDialog.getCheckBox("integrationTest").isSelected()); ComboBox envCombo = uispecDialog.getComboBox("environment"); assertTrue(envCombo.contains("development", "integration", "acceptance", "production")); assertTrue(envCombo.selectionEquals("development")); assertTrue(StringUtils.isEmpty(uispecDialog.findSwingComponent(JTextField.class).getText())); assertTrue(uispecDialog.getButton("OK").isEnabled()); }
public void testLaunchBuild() throws Exception { Window uispecDialog = createUISpecWindow(JOB_WITH_GOOD_PARAMS); uispecDialog.getCheckBox("integrationTest").unselect(); uispecDialog.getComboBox("environment").select("acceptance"); uispecDialog.getButton("OK").click(); ArgumentCaptor<Map> paramMap = ArgumentCaptor.forClass(Map.class); verify(requestManager, times(1)) .runParameterizedBuild(any(Job.class), any(JenkinsConfiguration.class), paramMap.capture()); Map expectedParamMapValue = paramMap.getValue(); assertEquals(3, expectedParamMapValue.size()); assertEquals("false", expectedParamMapValue.get("integrationTest")); assertEquals("acceptance", expectedParamMapValue.get("environment")); assertEquals("", expectedParamMapValue.get("message")); }