summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakozak2011-11-23 10:55:33 (EST)
committer Winston Prakash2011-12-01 20:47:20 (EST)
commita4705dfdd2cf61a0537e97b32e25262cc42f05c5 (patch)
tree97b561b20077c1e91b3359c82c7c8706f23b8936
parentc950012bea45803bd3bd1cddeb962b2394afaa9a (diff)
downloadorg.eclipse.hudson.core-a4705dfdd2cf61a0537e97b32e25262cc42f05c5.zip
org.eclipse.hudson.core-a4705dfdd2cf61a0537e97b32e25262cc42f05c5.tar.gz
org.eclipse.hudson.core-a4705dfdd2cf61a0537e97b32e25262cc42f05c5.tar.bz2
Disable cascading JS for tests. Fix DescribableListProperty (when getDefaultValue was called - result was not used for such Property. All values were missed)
Signed-off-by: Winston Prakash <winston.prakash@gmail.com>
-rw-r--r--hudson-core/src/main/java/hudson/model/AbstractProject.java2
-rw-r--r--hudson-core/src/main/java/org/eclipse/hudson/api/model/project/property/DescribableListProjectProperty.java4
-rw-r--r--hudson-war/src/main/webapp/scripts/cascading.js7
3 files changed, 8 insertions, 5 deletions
diff --git a/hudson-core/src/main/java/hudson/model/AbstractProject.java b/hudson-core/src/main/java/hudson/model/AbstractProject.java
index e603805..8ea5c09 100644
--- a/hudson-core/src/main/java/hudson/model/AbstractProject.java
+++ b/hudson-core/src/main/java/hudson/model/AbstractProject.java
@@ -1575,7 +1575,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
@SuppressWarnings("unchecked")
public void setScm(SCM scm) throws IOException {
getProperty(SCM_PROPERTY_NAME, SCMProjectProperty.class).setValue(scm);
- //save();
+ save();
}
/**
diff --git a/hudson-core/src/main/java/org/eclipse/hudson/api/model/project/property/DescribableListProjectProperty.java b/hudson-core/src/main/java/org/eclipse/hudson/api/model/project/property/DescribableListProjectProperty.java
index 7b400c0..1dc3aae 100644
--- a/hudson-core/src/main/java/org/eclipse/hudson/api/model/project/property/DescribableListProjectProperty.java
+++ b/hudson-core/src/main/java/org/eclipse/hudson/api/model/project/property/DescribableListProjectProperty.java
@@ -32,7 +32,9 @@ public class DescribableListProjectProperty extends BaseProjectProperty<Describa
@Override
public DescribableList getDefaultValue() {
- return new DescribableList(getJob());
+ DescribableList result = new DescribableList(getJob());
+ setOriginalValue(result, false);
+ return result;
}
@Override
diff --git a/hudson-war/src/main/webapp/scripts/cascading.js b/hudson-war/src/main/webapp/scripts/cascading.js
index be0d8db..aca9ee7 100644
--- a/hudson-war/src/main/webapp/scripts/cascading.js
+++ b/hudson-war/src/main/webapp/scripts/cascading.js
@@ -37,7 +37,8 @@ function getJobUrl() {
}
function onCascadingProjectUpdated() {
- jQuery('select[name=cascadingProjectName]').change(function() {
+ if(isRunAsTest) return;
+ jQuery('select[name=cascadingProjectName]').change(function() {
var jobUrl = getJobUrl()+'/updateCascadingProject';
var cascadingProject = jQuery(this).val();
new Ajax.Request(jobUrl+'?projectName='+cascadingProject, {
@@ -46,10 +47,11 @@ function onCascadingProjectUpdated() {
location.reload(true);
}
});
- });
+ });
}
function onProjectPropertyChanged() {
+ if(isRunAsTest) return;
jQuery('input').change(function() {
var ref = jQuery(this).attr('id');
var cascadingProperty = '';
@@ -72,4 +74,3 @@ jQuery(document).ready(function(){
onCascadingProjectUpdated();
onProjectPropertyChanged();
});
-