summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakozak2011-11-24 08:19:07 (EST)
committer Winston Prakash2011-12-01 20:47:26 (EST)
commit6dc25a8df9150ce6bd444daecc5b72893b6cb938 (patch)
tree11bfad410954fa795ca518c1cad1891631b7ff31
parentf6593427c436160e7d4f58b6befc87c6addaf699 (diff)
downloadorg.eclipse.hudson.core-6dc25a8df9150ce6bd444daecc5b72893b6cb938.zip
org.eclipse.hudson.core-6dc25a8df9150ce6bd444daecc5b72893b6cb938.tar.gz
org.eclipse.hudson.core-6dc25a8df9150ce6bd444daecc5b72893b6cb938.tar.bz2
addPublisher/removePublisher methods were relocated to BaseBuildableProejct.
Signed-off-by: Winston Prakash <winston.prakash@gmail.com>
-rw-r--r--hudson-core/src/main/java/hudson/model/BaseBuildableProject.java27
-rw-r--r--hudson-core/src/main/java/hudson/model/Project.java24
-rw-r--r--hudson-core/src/test/java/org/eclipse/hudson/api/model/project/property/ProjectPropertyTest.java1
3 files changed, 27 insertions, 25 deletions
diff --git a/hudson-core/src/main/java/hudson/model/BaseBuildableProject.java b/hudson-core/src/main/java/hudson/model/BaseBuildableProject.java
index 460e093..3be1bd0 100644
--- a/hudson-core/src/main/java/hudson/model/BaseBuildableProject.java
+++ b/hudson-core/src/main/java/hudson/model/BaseBuildableProject.java
@@ -126,6 +126,7 @@ public abstract class BaseBuildableProject<P extends BaseBuildableProject<P,B>,B
}
@Override
+ @SuppressWarnings("unchecked")
protected List<Action> createTransientActions() {
List<Action> r = super.createTransientActions();
@@ -137,7 +138,6 @@ public abstract class BaseBuildableProject<P extends BaseBuildableProject<P,B>,B
r.addAll(step.getProjectActions(this));
for (Trigger trigger : getTriggersList())
r.addAll(trigger.getProjectActions());
-
return r;
}
@@ -183,6 +183,31 @@ public abstract class BaseBuildableProject<P extends BaseBuildableProject<P,B>,B
}
/**
+ * Adds a new {@link BuildStep} to this {@link Project} and saves the configuration.
+ *
+ * @param publisher publisher.
+ * @throws java.io.IOException exception.
+ */
+ @SuppressWarnings("unchecked")
+ public void addPublisher(Publisher publisher) throws IOException {
+ CascadingUtil.getExternalProjectProperty(this,
+ publisher.getDescriptor().getJsonSafeClassName()).setValue(publisher);
+ }
+
+ /**
+ * Removes a publisher from this project, if it's active.
+ *
+ * @deprecated as of 1.290
+ * Use {@code getPublishersList().remove(x)}
+ * @param publisher publisher.
+ * @throws java.io.IOException exception.
+ */
+ //TODO investigate, whether we can move this method to parent or completer remove it
+ public void removePublisher(Descriptor<Publisher> publisher) throws IOException {
+ getPublishersList().remove(publisher);
+ }
+
+ /**
* @inheritDoc
*/
public Map<Descriptor<BuildWrapper>,BuildWrapper> getBuildWrappers() {
diff --git a/hudson-core/src/main/java/hudson/model/Project.java b/hudson-core/src/main/java/hudson/model/Project.java
index c81b2f2..1c00dfa 100644
--- a/hudson-core/src/main/java/hudson/model/Project.java
+++ b/hudson-core/src/main/java/hudson/model/Project.java
@@ -72,30 +72,6 @@ public abstract class Project<P extends Project<P,B>,B extends Build<P,B>>
return activities;
}
- /**
- * Adds a new {@link BuildStep} to this {@link Project} and saves the configuration.
- *
- * @deprecated as of 1.290
- * Use {@code getPublishersList().add(x)}
- */
- //TODO investigate, whether we can move this method to parent or completer remove it
- public void addPublisher(Publisher buildStep) throws IOException {
- CascadingUtil.getExternalProjectProperty(this,
- buildStep.getDescriptor().getJsonSafeClassName()).setValue(buildStep);
- }
-
- /**
- * Removes a publisher from this project, if it's active.
- *
- * @deprecated as of 1.290
- * Use {@code getPublishersList().remove(x)}
- */
- //TODO investigate, whether we can move this method to parent or completer remove it
- public void removePublisher(Descriptor<Publisher> descriptor) throws IOException {
- getPublishersList().remove(descriptor);
- }
-
-
@Override
public boolean isFingerprintConfigured() {
return getPublishersList().get(Fingerprinter.class)!=null;
diff --git a/hudson-core/src/test/java/org/eclipse/hudson/api/model/project/property/ProjectPropertyTest.java b/hudson-core/src/test/java/org/eclipse/hudson/api/model/project/property/ProjectPropertyTest.java
index c847d16..c37d6f8 100644
--- a/hudson-core/src/test/java/org/eclipse/hudson/api/model/project/property/ProjectPropertyTest.java
+++ b/hudson-core/src/test/java/org/eclipse/hudson/api/model/project/property/ProjectPropertyTest.java
@@ -712,6 +712,7 @@ public class ProjectPropertyTest {
TriggerProjectProperty property = new TriggerProjectProperty(project);
Trigger originalTrigger = new TimerTrigger("* * * * *");
Trigger cascadingTrigger = new TimerTrigger("* * * * *");
+ property.setModified(true);
property.updateOriginalValue(originalTrigger, cascadingTrigger);
//Property isn't overridden because of values equal.
assertFalse(property.isOverridden());