# ignite-sprint-4 Fixed update notifier test.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6d2a7597 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6d2a7597 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6d2a7597 Branch: refs/heads/ignite-834 Commit: 6d2a7597658cee5c1bf2ff607762baefcc17783d Parents: 4a096d9 Author: Andrey <anovi...@gridgain.com> Authored: Wed May 6 13:50:00 2015 +0700 Committer: Andrey <anovi...@gridgain.com> Committed: Wed May 6 13:50:00 2015 +0700 ---------------------------------------------------------------------- .../internal/GridUpdateNotifierSelfTest.java | 21 ++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6d2a7597/modules/core/src/test/java/org/apache/ignite/internal/GridUpdateNotifierSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridUpdateNotifierSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridUpdateNotifierSelfTest.java index 65e927b..abc9109 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/GridUpdateNotifierSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/GridUpdateNotifierSelfTest.java @@ -18,6 +18,7 @@ package org.apache.ignite.internal; import org.apache.ignite.*; +import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.lang.*; import org.apache.ignite.plugin.*; import org.apache.ignite.testframework.junits.common.*; @@ -31,6 +32,8 @@ import java.util.concurrent.*; */ @GridCommonTest(group = "Kernal Self") public class GridUpdateNotifierSelfTest extends GridCommonAbstractTest { + private String updateStatusParams; + /** {@inheritDoc} */ @Override protected long getTestTimeout() { return 30 * 1000; @@ -41,6 +44,12 @@ public class GridUpdateNotifierSelfTest extends GridCommonAbstractTest { super.beforeTestsStarted(); System.setProperty(IgniteSystemProperties.IGNITE_UPDATE_NOTIFIER, "true"); + + Properties props = U.field(IgniteProperties.class, "PROPS"); + + updateStatusParams = props.getProperty("ignite.update.status.params"); + + props.setProperty("ignite.update.status.params", "ver=" + IgniteProperties.get("ignite.version")); } /** {@inheritDoc} */ @@ -48,6 +57,10 @@ public class GridUpdateNotifierSelfTest extends GridCommonAbstractTest { super.afterTestsStopped(); System.setProperty(IgniteSystemProperties.IGNITE_UPDATE_NOTIFIER, "false"); + + Properties props = U.field(IgniteProperties.class, "PROPS"); + + props.setProperty("ignite.update.status.params", updateStatusParams); } /** @@ -67,8 +80,12 @@ public class GridUpdateNotifierSelfTest extends GridCommonAbstractTest { assertNotNull("Ignite latest version has not been detected.", ver); - assertEquals("Wrong latest version.", IgniteProductVersion.fromString(nodeVer).maintenance(), - IgniteProductVersion.fromString(ver).maintenance()); + byte nodeMaintenance = IgniteProductVersion.fromString(nodeVer).maintenance(); + + byte lastMaintenance = IgniteProductVersion.fromString(ver).maintenance(); + + assertTrue("Wrong latest version.", (nodeMaintenance == 0 && lastMaintenance == 0) || + (nodeMaintenance > 0 && lastMaintenance > 0)); ntf.reportStatus(log); }