summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakozak2011-11-24 09:26:11 (EST)
committer Winston Prakash2011-12-01 20:47:28 (EST)
commit701a51c5dd2d996303d7d8ffcb0f5c0361d72820 (patch)
treefcd12237212cce5b50aac410b2edbaf137739c10
parent316d27516003425e67f00e2f57901b9b7cd817e6 (diff)
downloadorg.eclipse.hudson.core-701a51c5dd2d996303d7d8ffcb0f5c0361d72820.zip
org.eclipse.hudson.core-701a51c5dd2d996303d7d8ffcb0f5c0361d72820.tar.gz
org.eclipse.hudson.core-701a51c5dd2d996303d7d8ffcb0f5c0361d72820.tar.bz2
Fix ProjectPropery comparision logic. Include transient fields. Fix unit-test for AxisListProperty#allowOverride method
Signed-off-by: Winston Prakash <winston.prakash@gmail.com>
-rw-r--r--hudson-core/src/main/java/hudson/model/AbstractProject.java1
-rw-r--r--hudson-core/src/main/java/org/eclipse/hudson/api/model/project/property/AxisListProjectProperty.java1
-rw-r--r--hudson-core/src/main/java/org/eclipse/hudson/api/model/project/property/BaseProjectProperty.java2
-rw-r--r--hudson-core/src/main/resources/lib/form/nested.jelly2
-rw-r--r--hudson-core/src/test/java/org/eclipse/hudson/api/model/project/property/ProjectPropertyTest.java7
5 files changed, 9 insertions, 4 deletions
diff --git a/hudson-core/src/main/java/hudson/model/AbstractProject.java b/hudson-core/src/main/java/hudson/model/AbstractProject.java
index 07d288b..1e33b1d 100644
--- a/hudson-core/src/main/java/hudson/model/AbstractProject.java
+++ b/hudson-core/src/main/java/hudson/model/AbstractProject.java
@@ -367,6 +367,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
convertQuietPeriodProperty();
convertScmCheckoutRetryCountProperty();
convertJDKProperty();
+ convertScmProperty();
convertTriggerProperties();
convertAppointedNode();
}
diff --git a/hudson-core/src/main/java/org/eclipse/hudson/api/model/project/property/AxisListProjectProperty.java b/hudson-core/src/main/java/org/eclipse/hudson/api/model/project/property/AxisListProjectProperty.java
index 4e92283..4ef3eef 100644
--- a/hudson-core/src/main/java/org/eclipse/hudson/api/model/project/property/AxisListProjectProperty.java
+++ b/hudson-core/src/main/java/org/eclipse/hudson/api/model/project/property/AxisListProjectProperty.java
@@ -16,6 +16,7 @@
package org.eclipse.hudson.api.model.project.property;
import hudson.matrix.AxisList;
+import org.apache.commons.lang3.ObjectUtils;
import org.eclipse.hudson.api.model.IJob;
/**
diff --git a/hudson-core/src/main/java/org/eclipse/hudson/api/model/project/property/BaseProjectProperty.java b/hudson-core/src/main/java/org/eclipse/hudson/api/model/project/property/BaseProjectProperty.java
index 64b1ba1..9e796ed 100644
--- a/hudson-core/src/main/java/org/eclipse/hudson/api/model/project/property/BaseProjectProperty.java
+++ b/hudson-core/src/main/java/org/eclipse/hudson/api/model/project/property/BaseProjectProperty.java
@@ -197,7 +197,7 @@ public class BaseProjectProperty<T> implements IProjectProperty<T> {
*/
public boolean allowOverrideValue(T cascadingValue, T candidateValue) {
return ObjectUtils.notEqual(cascadingValue, candidateValue)
- && !EqualsBuilder.reflectionEquals(cascadingValue, candidateValue);
+ && !EqualsBuilder.reflectionEquals(cascadingValue, candidateValue, true);
}
/**
diff --git a/hudson-core/src/main/resources/lib/form/nested.jelly b/hudson-core/src/main/resources/lib/form/nested.jelly
index 9213e8e..2cf5a4d 100644
--- a/hudson-core/src/main/resources/lib/form/nested.jelly
+++ b/hudson-core/src/main/resources/lib/form/nested.jelly
@@ -25,7 +25,7 @@
</st:attribute>
</st:documentation>
<tr>
- <td colspan="2" class="${attrs.isPropertyOverridden? 'modified' :''}"/>
+ <td colspan="2" class="${attrs.isPropertyOverridden? 'modified' :'original'}"/>
<td colspan="2">
<d:invokeBody />
</td>
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..76c8c00 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
@@ -381,9 +381,12 @@ public class ProjectPropertyTest {
assertFalse(property.allowOverrideValue(null, null));
assertTrue(property.allowOverrideValue(new AxisList(), null));
assertTrue(property.allowOverrideValue(null, new AxisList()));
- assertTrue(property.allowOverrideValue(new AxisList().add(new Axis("DB", "mysql")), new AxisList()));
+ assertTrue(property.allowOverrideValue(new AxisList(new Axis("DB", "mysql")), new AxisList()));
+ assertTrue(property.allowOverrideValue(new AxisList(new Axis("DB", "mysql")),
+ new AxisList(new Axis("DB", "mysql", "mssql"))));
+ assertTrue(property.allowOverrideValue(new AxisList(new Axis("DB", "mysql")),
+ new AxisList(new Axis("DB", "mssql"))));
}
-
@Test
public void testSCMProjectPropertyAllowOverrideValue() {
BaseProjectProperty property = new SCMProjectProperty(project);