| author | akozak | 2011-11-22 09:41:00 (EST) |
|---|---|---|
| committer | Winston Prakash | 2011-12-01 20:47:01 (EST) |
| commit | 836b4b4b3acdfac20177da63a1315d43a7d6aa68 (patch) (side-by-side diff) | |
| tree | edca5c9ada298786cea1db6df5b4bb30c3df2613 | |
| parent | 3b899bd0bcaeac26c474ee0e287e66b299e4984e (diff) | |
| download | org.eclipse.hudson.core-836b4b4b3acdfac20177da63a1315d43a7d6aa68.zip org.eclipse.hudson.core-836b4b4b3acdfac20177da63a1315d43a7d6aa68.tar.gz org.eclipse.hudson.core-836b4b4b3acdfac20177da63a1315d43a7d6aa68.tar.bz2 | |
Updated MatrixProject configuration page.
Signed-off-by: Winston Prakash <winston.prakash@gmail.com>
5 files changed, 36 insertions, 114 deletions
diff --git a/hudson-core/src/main/java/hudson/matrix/MatrixProject.java b/hudson-core/src/main/java/hudson/matrix/MatrixProject.java index 88f3c29..d411388 100644 --- a/hudson-core/src/main/java/hudson/matrix/MatrixProject.java +++ b/hudson-core/src/main/java/hudson/matrix/MatrixProject.java @@ -83,17 +83,16 @@ import java.util.logging.Logger; public class MatrixProject extends AbstractProject<MatrixProject, MatrixBuild> implements IMatrixProject, TopLevelItem, SCMedItem, ItemGroup<MatrixConfiguration>, Saveable, FlyweightTask, BuildableItemWithBuildWrappers { - protected static final String HAS_COMBINATION_FILTER_PARAM = "hasCombinationFilter"; - protected static final String COMBINATION_FILTER_PARAM = "combinationFilter"; - protected static final String HAS_TOUCH_STONE_COMBINATION_FILTER_PARAM = "hasTouchStoneCombinationFilter"; - protected static final String TOUCH_STONE_COMBINATION_FILTER_PARAM = "touchStoneCombinationFilter"; - protected static final String TOUCH_STONE_RESULT_CONDITION_PARAM = "touchStoneResultCondition"; - protected static final String CUSTOM_WORKSPACE_PARAM = "customWorkspace"; - protected static final String CUSTOM_WORKSPACE_DIRECTORY_PARAM = "customWorkspace.directory"; - protected static final String RUN_SEQUENTIALLY_PROPERTY_NAME = "runSequentially"; - protected static final String COMBINATION_FILTER_PROPERTY_NAME = "combinationFilter"; - protected static final String TOUCH_STONE_COMBINATION_FILTER_PROPERTY_NAME = "touchStoneCombinationFilter"; - protected static final String TOUCH_STONE_RESULT_CONDITION_PROPERTY_NAME = "touchStoneResultCondition"; + public static final String HAS_COMBINATION_FILTER_PARAM = "hasCombinationFilter"; + public static final String HAS_TOUCH_STONE_COMBINATION_FILTER_PARAM = "hasTouchStoneCombinationFilter"; + public static final String TOUCH_STONE_COMBINATION_FILTER_PARAM = "touchStoneCombinationFilter"; + public static final String TOUCH_STONE_RESULT_CONDITION_PARAM = "touchStoneResultCondition"; + public static final String CUSTOM_WORKSPACE_PARAM = "customWorkspace"; + public static final String CUSTOM_WORKSPACE_DIRECTORY_PARAM = "customWorkspace.directory"; + + public static final String RUN_SEQUENTIALLY_PROPERTY_NAME = "runSequentially"; + public static final String COMBINATION_FILTER_PROPERTY_NAME = "combinationFilter"; + public static final String TOUCH_STONE_COMBINATION_FILTER_PROPERTY_NAME = "touchStoneCombinationFilter"; /** * Configuration axes. @@ -152,11 +151,8 @@ public class MatrixProject extends AbstractProject<MatrixProject, MatrixBuild> i /** * Required result on the touchstone combinations, in order to * continue with the rest. - * Package visible for the tests only. - * - * @deprecated as of 2.2.0, use #getTouchStoneResultCondition() and #setTouchStoneResultCondition() instead */ - Result touchStoneResultCondition; + private Result touchStoneResultCondition; /** * @deprecated as of 2.2.0, use #getCustomWorkspace() and #setCustomWorkspace() instead @@ -241,14 +237,14 @@ public class MatrixProject extends AbstractProject<MatrixProject, MatrixBuild> i * @inheritDoc */ public Result getTouchStoneResultCondition() { - return getResultProperty(TOUCH_STONE_RESULT_CONDITION_PROPERTY_NAME).getValue(); + return touchStoneResultCondition; } /** * @inheritDoc */ public void setTouchStoneResultCondition(Result touchStoneResultCondition) { - getResultProperty(TOUCH_STONE_RESULT_CONDITION_PROPERTY_NAME).setValue(touchStoneResultCondition); + this.touchStoneResultCondition = touchStoneResultCondition; } /** @@ -620,7 +616,7 @@ public class MatrixProject extends AbstractProject<MatrixProject, MatrixBuild> i setCombinationFilter( req.getParameter(HAS_COMBINATION_FILTER_PARAM) != null ? Util.nullify(req.getParameter( - COMBINATION_FILTER_PARAM)) : null); + 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))); @@ -638,7 +634,7 @@ public class MatrixProject extends AbstractProject<MatrixProject, MatrixBuild> i checkAxisNames(newAxes); this.axes = new AxisList(newAxes.toList()); - runSequentially = json.has("runSequentially"); + setRunSequentially(json.has(RUN_SEQUENTIALLY_PROPERTY_NAME)); getBuildWrappersList().rebuild(req, json, BuildWrappers.getFor(this)); getBuildersList().rebuildHetero(req, json, Builder.all(), "builder"); diff --git a/hudson-core/src/main/java/hudson/model/Job.java b/hudson-core/src/main/java/hudson/model/Job.java index b95480c..2560ab6 100644 --- a/hudson-core/src/main/java/hudson/model/Job.java +++ b/hudson-core/src/main/java/hudson/model/Job.java @@ -236,10 +236,6 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R return (StringProjectProperty) getProperty(key, StringProjectProperty.class); } - public ResultProjectProperty getResultProperty(String key) { - return (ResultProjectProperty) getProperty(key, ResultProjectProperty.class); - } - public BooleanProjectProperty getBooleanProperty(String key){ return (BooleanProjectProperty) getProperty(key, BooleanProjectProperty.class); } diff --git a/hudson-core/src/main/java/hudson/model/ResultProjectProperty.java b/hudson-core/src/main/java/hudson/model/ResultProjectProperty.java deleted file mode 100644 index f25c241..0000000 --- a/hudson-core/src/main/java/hudson/model/ResultProjectProperty.java +++ b/dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * - * Copyright (c) 2011 Oracle Corporation. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * - * Anton Kozak - * - *******************************************************************************/ -package hudson.model; - -import org.eclipse.hudson.api.model.IJob; - -/** - * Represents {@link Result} property. - * <p/> - * Date: 9/23/11 - * - * @author Anton Kozak - */ -//TODO try to replace it with generics -public class ResultProjectProperty extends BaseProjectProperty<Result> { - - public ResultProjectProperty(IJob job) { - super(job); - } -}
\ No newline at end of file diff --git a/hudson-core/src/main/resources/hudson/matrix/MatrixProject/configure-entries.jelly b/hudson-core/src/main/resources/hudson/matrix/MatrixProject/configure-entries.jelly index e79a293..5daf4f0 100644 --- a/hudson-core/src/main/resources/hudson/matrix/MatrixProject/configure-entries.jelly +++ b/hudson-core/src/main/resources/hudson/matrix/MatrixProject/configure-entries.jelly @@ -51,19 +51,33 @@ addCaption="${%Add axis}"/> </f:block> - <f:optionalBlock field="runSequentially" title="${%Run each configuration sequentially}"/> + <j:set var="runSequentiallyProperty" value="${it.getBooleanProperty(it.RUN_SEQUENTIALLY_PROPERTY_NAME)}"/> + <j:set var="runSequentially" value="${runSequentiallyProperty.getValue()}"/> + <f:optionalBlock + checked="${runSequentially}" + field="runSequentially" + title="${%Run each configuration sequentially}" + isCascadingValue="${runSequentiallyProperty.isPropertyOverridden()}"/> - <f:optionalBlock name="hasCombinationFilter" title="${%Combination Filter}" checked="${!empty(it.combinationFilter)}" - help="/help/matrix/combinationfilter.html"> + <j:set var="combinationFilterProperty" value="${it.getStringProperty(it.COMBINATION_FILTER_PROPERTY_NAME)}"/> + <j:set var="combinationFilter" value="${combinationFilterProperty.getValue()}"/> + <f:optionalBlock name="hasCombinationFilter" title="${%Combination Filter}" + checked="${!empty(combinationFilter)}" + isCascadingValue="${combinationFilterProperty.isPropertyOverridden()}" + help="/help/matrix/combinationfilter.html"> <f:entry title="${%Filter}"> - <f:textbox name="combinationFilter" value="${it.combinationFilter}" /> + <f:textbox name="combinationFilter" value="${combinationFilter}" /> </f:entry> </f:optionalBlock> - <f:optionalBlock name="hasTouchStoneCombinationFilter" title="${%Execute touchstone builds first}" checked="${!empty(it.touchStoneCombinationFilter)}" - help="/help/matrix/touchstone.html"> + <j:set var="touchStoneCombinationFilterProperty" value="${it.getStringProperty(it.TOUCH_STONE_COMBINATION_FILTER_PROPERTY_NAME)}"/> + <j:set var="touchStoneCombinationFilter" value="${touchStoneCombinationFilterProperty.getValue()}"/> + <f:optionalBlock name="hasTouchStoneCombinationFilter" title="${%Execute touchstone builds first}" + checked="${!empty(touchStoneCombinationFilter)}" + isCascadingValue="${touchStoneCombinationFilterProperty.isPropertyOverridden()}" + help="/help/matrix/touchstone.html"> <f:entry title="${%Filter}"> - <f:textbox name="touchStoneCombinationFilter" value="${it.touchStoneCombinationFilter}" /> + <f:textbox name="touchStoneCombinationFilter" value="${touchStoneCombinationFilter}" /> </f:entry> <f:entry title="${%Required result}" description="${%required.result.description}"> <select name="touchStoneResultCondition"> @@ -72,7 +86,6 @@ </select> </f:entry> </f:optionalBlock> - </f:section> <p:config-buildWrappers /> diff --git a/hudson-core/src/test/java/hudson/matrix/MatrixProjectTest.java b/hudson-core/src/test/java/hudson/matrix/MatrixProjectTest.java index 3f1ddbc..7dcc846 100644 --- a/hudson-core/src/test/java/hudson/matrix/MatrixProjectTest.java +++ b/hudson-core/src/test/java/hudson/matrix/MatrixProjectTest.java @@ -223,57 +223,6 @@ public class MatrixProjectTest { } @Test - public void testGetTouchStoneResultConditionParentValue() throws IOException { - Result parentResultCondition = Result.SUCCESS; - MatrixProject parentProject = new MatrixProjectMock("parent"); - parentProject.setTouchStoneResultCondition(parentResultCondition); - - MatrixProject childProject1 = new MatrixProjectMock("child1"); - childProject1.setCascadingProject(parentProject); - assertEquals(childProject1.getTouchStoneResultCondition(), parentResultCondition); - } - - @Test - public void testSetTouchStoneResultConditionDifferentValues() throws IOException { - Result parentResultCondition = Result.SUCCESS; - Result childResultCondition = Result.FAILURE; - MatrixProject parentProject = new MatrixProjectMock("parent"); - parentProject.setTouchStoneResultCondition(parentResultCondition); - - MatrixProject childProject1 = new MatrixProjectMock("child1"); - childProject1.setCascadingProject(parentProject); - childProject1.setTouchStoneResultCondition(childResultCondition); - assertEquals(childProject1.getTouchStoneResultCondition(), childResultCondition); - } - - @Test - public void testSetTouchStoneResultConditionTheSameValues() throws IOException { - Result parentResultCondition = Result.SUCCESS; - MatrixProject parentProject = new MatrixProjectMock("parent"); - parentProject.setTouchStoneResultCondition(parentResultCondition); - - MatrixProject childProject1 = new MatrixProjectMock("child1"); - childProject1.setCascadingProject(parentProject); - childProject1.setTouchStoneResultCondition(parentResultCondition); - assertEquals(childProject1.getTouchStoneResultCondition(), parentResultCondition); - } - - @Test - public void testSetTouchStoneResultConditionParentNull() throws IOException { - Result childResultCondition = Result.FAILURE; - - MatrixProject childProject1 = new MatrixProjectMock("child1"); - childProject1.setTouchStoneResultCondition(childResultCondition); - assertEquals(childProject1.getTouchStoneResultCondition(), childResultCondition); - } - - @Test - public void testSetTouchStoneResultConditionNull() throws IOException { - MatrixProject childProject1 = new MatrixProjectMock("child1"); - assertNull(childProject1.getTouchStoneResultCondition()); - } - - @Test public void testGetCustomWorkspaceChildValue() throws IOException { String parentWorkspace = "/tmp"; String childWorkspace = "/tmp2"; |

