@Before public void setUp() throws Exception { repo = tmp.getRoot(); createPretendSlave("slave_one"); createPretendSlave("slave_two"); matrixProject = j.createProject(MatrixProject.class, "matrix_test"); matrixProject.setScm(new MercurialSCM(null, repo.getPath(), null, null, null, null, false)); matrixProject.setAxes(new AxisList(new LabelAxis("label", Arrays.asList("slave_one", "slave_two")))); // TODO switch to MercurialContainer m.hg(repo, "init"); m.touchAndCommit(repo, "a"); }
@Test public void specialCharsInRelativePath() throws Exception { Assume.assumeFalse(Functions.isWindows()); final String ID_PREFIX = "test-../a=%3C%7C%23)/testReport/org.twia.vendor/VendorManagerTest/testCreateAdjustingFirm/"; final String EXPECTED = "org.twia.dao.DAOException: [S2001] Hibernate encountered an error updating Claim [null]"; MatrixProject p = j.jenkins.createProject(MatrixProject.class, "test-" + j.jenkins.getItems().size()); p.setAxes(new AxisList(new TextAxis("a", "<|#)"))); p.setScm(new SingleFileSCM("report.xml", getClass().getResource("junit-report-20090516.xml"))); p.getPublishersList().add(new JUnitResultArchiver("report.xml")); MatrixBuild b = p.scheduleBuild2(0).get(); j.assertBuildStatus(Result.UNSTABLE, b); WebClient wc = j.createWebClient(); HtmlPage page = wc.getPage(b, "testReport"); assertThat(page.asText(), not(containsString(EXPECTED))); ((HtmlAnchor) page.getElementById(ID_PREFIX + "-showlink")).click(); wc.waitForBackgroundJavaScript(10000L); assertThat(page.asText(), containsString(EXPECTED)); ((HtmlAnchor) page.getElementById(ID_PREFIX + "-hidelink")).click(); wc.waitForBackgroundJavaScript(10000L); assertThat(page.asText(), not(containsString(EXPECTED))); }
@Override protected void submit(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, FormException { super.submit(req, rsp); JSONObject json = req.getSubmittedForm(); setCombinationFilter( req.getParameter(HAS_COMBINATION_FILTER_PARAM) != null ? Util.nullify(req.getParameter( COMBINATION_FILTER_PROPERTY_NAME)) : null); if (req.getParameter(HAS_TOUCH_STONE_COMBINATION_FILTER_PARAM)!=null) { setTouchStoneCombinationFilter(Util.nullify(req.getParameter(TOUCH_STONE_COMBINATION_FILTER_PARAM))); setTouchStoneResultCondition(Result.fromString(req.getParameter(TOUCH_STONE_RESULT_CONDITION_PARAM))); } else { setTouchStoneCombinationFilter(null); } setCustomWorkspace( req.hasParameter(CUSTOM_WORKSPACE_PARAM) ? req.getParameter(CUSTOM_WORKSPACE_DIRECTORY_PARAM) : null); // parse system axes DescribableList<Axis, AxisDescriptor> newAxes = DescribableListUtil.buildFromHetero(this, req, json, "axis", Axis.all()); checkAxisNames(newAxes); setAxes(new AxisList(newAxes.toList())); setRunSequentially(json.has(RUN_SEQUENTIALLY_PROPERTY_NAME)); rebuildConfigurations(); }
@Override protected void submit(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, FormException { super.submit(req, rsp); JSONObject json = req.getSubmittedForm(); setCombinationFilter( req.getParameter(HAS_COMBINATION_FILTER_PARAM) != null ? Util.nullify(req.getParameter( COMBINATION_FILTER_PROPERTY_NAME)) : null); if (req.getParameter(HAS_TOUCH_STONE_COMBINATION_FILTER_PARAM)!=null) { setTouchStoneCombinationFilter(Util.nullify(req.getParameter(TOUCH_STONE_COMBINATION_FILTER_PARAM))); setTouchStoneResultCondition(Result.fromString(req.getParameter(TOUCH_STONE_RESULT_CONDITION_PARAM))); } else { setTouchStoneCombinationFilter(null); } setCustomWorkspace( req.hasParameter(CUSTOM_WORKSPACE_PARAM) ? req.getParameter(CUSTOM_WORKSPACE_DIRECTORY_PARAM) : null); // parse system axes DescribableList<Axis, AxisDescriptor> newAxes = DescribableListUtil.buildFromHetero(this, req, json, "axis", Axis.all()); checkAxisNames(newAxes); setAxes(new AxisList(newAxes.toList())); setRunSequentially(json.has(RUN_SEQUENTIALLY_PROPERTY_NAME)); rebuildConfigurations(); }
@Override protected void submit(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, FormException { super.submit(req, rsp); JSONObject json = req.getSubmittedForm(); setCombinationFilter( req.getParameter(HAS_COMBINATION_FILTER_PARAM) != null ? Util.nullify(req.getParameter( COMBINATION_FILTER_PROPERTY_NAME)) : null); if (req.getParameter(HAS_TOUCH_STONE_COMBINATION_FILTER_PARAM)!=null) { setTouchStoneCombinationFilter(Util.nullify(req.getParameter(TOUCH_STONE_COMBINATION_FILTER_PARAM))); setTouchStoneResultCondition(Result.fromString(req.getParameter(TOUCH_STONE_RESULT_CONDITION_PARAM))); } else { setTouchStoneCombinationFilter(null); } setCustomWorkspace( req.hasParameter(CUSTOM_WORKSPACE_PARAM) ? req.getParameter(CUSTOM_WORKSPACE_DIRECTORY_PARAM) : null); // parse system axes DescribableList<Axis, AxisDescriptor> newAxes = DescribableListUtil.buildFromHetero(this, req, json, "axis", Axis.all()); checkAxisNames(newAxes); setAxes(new AxisList(newAxes.toList())); setRunSequentially(json.has(RUN_SEQUENTIALLY_PROPERTY_NAME)); rebuildConfigurations(); }
@Override protected void submit(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, FormException { configSubmit = true; super.submit(req, rsp); JSONObject json = req.getSubmittedForm(); setCombinationFilter( req.getParameter(HAS_COMBINATION_FILTER_PARAM) != null ? Util.nullify(req.getParameter( COMBINATION_FILTER_PROPERTY_NAME)) : null); if (req.getParameter(HAS_TOUCH_STONE_COMBINATION_FILTER_PARAM) != null) { setTouchStoneCombinationFilter(Util.nullify(req.getParameter(TOUCH_STONE_COMBINATION_FILTER_PARAM))); setTouchStoneResultCondition(Result.fromString(req.getParameter(TOUCH_STONE_RESULT_CONDITION_PARAM))); } else { setTouchStoneCombinationFilter(null); } setCustomWorkspace( req.hasParameter(CUSTOM_WORKSPACE_PARAM) ? req.getParameter(CUSTOM_WORKSPACE_DIRECTORY_PARAM) : null); // parse system axes DescribableList<Axis, AxisDescriptor> newAxes = DescribableListUtil.buildFromHetero(this, req, json, "axis", Axis.all()); checkAxisNames(newAxes); setAxes(new AxisList(newAxes.toList())); setRunSequentially(json.has(RUN_SEQUENTIALLY_PROPERTY_NAME)); rebuildConfigurations(); configSubmit = false; }