ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpapirkovs...@apache.org
Subject git commit: AMBARI-6011. Log on Upgrade path seems wrong. (mpapirkovskyy)
Date Wed, 18 Jun 2014 14:02:27 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 8702256d6 -> 52c914170


AMBARI-6011. Log on Upgrade path seems wrong. (mpapirkovskyy)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/52c91417
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/52c91417
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/52c91417

Branch: refs/heads/trunk
Commit: 52c914170c62fecacf9dc00fe47d7c0c9ca2fae1
Parents: 8702256
Author: Myroslav Papirkovskyy <mpapyrkovskyy@hortonworks.com>
Authored: Wed Jun 18 17:02:22 2014 +0300
Committer: Myroslav Papirkovskyy <mpapyrkovskyy@hortonworks.com>
Committed: Wed Jun 18 17:02:22 2014 +0300

----------------------------------------------------------------------
 .../ambari/server/upgrade/AbstractUpgradeCatalog.java       | 3 +--
 .../org/apache/ambari/server/upgrade/UpgradeCatalog151.java | 6 ++++++
 .../org/apache/ambari/server/upgrade/UpgradeCatalog160.java | 6 ++++++
 .../org/apache/ambari/server/upgrade/UpgradeCatalog161.java | 6 ++++++
 .../apache/ambari/server/upgrade/UpgradeCatalog150Test.java | 6 ++++++
 .../apache/ambari/server/upgrade/UpgradeCatalog151Test.java | 8 +++++++-
 .../apache/ambari/server/upgrade/UpgradeCatalog160Test.java | 8 +++++++-
 .../apache/ambari/server/upgrade/UpgradeCatalog161Test.java | 9 ++++++++-
 8 files changed, 47 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/52c91417/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
index 6a689d6..b809b0a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
@@ -262,8 +262,7 @@ public abstract class AbstractUpgradeCatalog implements UpgradeCatalog
{
 
   @Override
   public String toString() {
-    return "{ " + this.getClass().getCanonicalName() +": " +
-      "sourceVersion = " + getSourceVersion() + ", " +
+    return "{ ugradeCatalog: sourceVersion = " + getSourceVersion() + ", " +
       "targetVersion = " + getTargetVersion() + " }";
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/52c91417/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog151.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog151.java
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog151.java
index 0b75510..72305c5 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog151.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog151.java
@@ -31,6 +31,12 @@ import java.util.List;
  * Upgrade catalog for version 1.5.1.
  */
 public class UpgradeCatalog151 extends AbstractUpgradeCatalog {
+  
+  //SourceVersion is only for book-keeping purpose
+  @Override
+  public String getSourceVersion() {
+    return "1.5.0";
+  }
 
 
   // ----- Constructors ------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ambari/blob/52c91417/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog160.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog160.java
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog160.java
index 2e8e70a..c3f083a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog160.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog160.java
@@ -37,6 +37,12 @@ import com.google.inject.Injector;
  */
 public class UpgradeCatalog160 extends AbstractUpgradeCatalog {
 
+  //SourceVersion is only for book-keeping purpos  
+  @Override
+  public String getSourceVersion() {
+    return "1.5.1";
+  }
+
   // ----- Constructors ------------------------------------------------------
 
   @Inject

http://git-wip-us.apache.org/repos/asf/ambari/blob/52c91417/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java
index ba6684e..2763b86 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java
@@ -43,6 +43,12 @@ import com.google.inject.Injector;
  */
 public class UpgradeCatalog161 extends AbstractUpgradeCatalog {
 
+  //SourceVersion is only for book-keeping purpos
+  @Override
+  public String getSourceVersion() {
+    return "1.6.0";
+  }
+
   /**
    * Logger.
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/52c91417/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog150Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog150Test.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog150Test.java
index a5eb8a5..92e580b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog150Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog150Test.java
@@ -293,4 +293,10 @@ public class UpgradeCatalog150Test {
     }
     Assert.assertFalse(failFlag);
   }
+  
+  @Test
+  public void testGetSourceVersion() {
+    UpgradeCatalog150 upgradeCatalog150 = injector.getInstance(UpgradeCatalog150.class);
+    Assert.assertNull(upgradeCatalog150.getSourceVersion());
+  }  
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/52c91417/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog151Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog151Test.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog151Test.java
index a05eac7..17bd478 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog151Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog151Test.java
@@ -104,5 +104,11 @@ public class UpgradeCatalog151Test {
     Injector injector = Guice.createInjector(module);
     return injector.getInstance(UpgradeCatalog151.class);
   }
-
+  
+  @Test
+  public void testGetSourceVersion() {
+    final DBAccessor dbAccessor     = createNiceMock(DBAccessor.class);
+    UpgradeCatalog upgradeCatalog = getUpgradeCatalog(dbAccessor);
+    Assert.assertEquals("1.5.0", upgradeCatalog.getSourceVersion());
+  }  
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/52c91417/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog160Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog160Test.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog160Test.java
index b37d531..f597986 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog160Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog160Test.java
@@ -271,7 +271,13 @@ public class UpgradeCatalog160Test {
     assertNull(column.getDefaultValue());
     assertTrue(column.isNullable());
   }
-
+  
+  @Test
+  public void testGetSourceVersion() {
+    final DBAccessor dbAccessor     = createNiceMock(DBAccessor.class);
+    UpgradeCatalog upgradeCatalog = getUpgradeCatalog(dbAccessor);
+    Assert.assertEquals("1.5.1", upgradeCatalog.getSourceVersion());
+  }  
   /**
    * Checks that the restart_require column was created correct when using a
    * non-Postgres DB (MySQL, Oracle, etc).

http://git-wip-us.apache.org/repos/asf/ambari/blob/52c91417/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java
index ebe6716..7f3c37f 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java
@@ -311,7 +311,7 @@ public class UpgradeCatalog161Test {
     assertEquals(String.class, column.getType());
     assertNull(column.getDefaultValue());
     assertTrue(column.isNullable());
-
+  
     column = descriptionColumnCapture.getValue();
     assertEquals("description", column.getName());
     assertEquals(255, (int) column.getLength());
@@ -340,4 +340,11 @@ public class UpgradeCatalog161Test {
     assertNull(column.getDefaultValue());
     assertTrue(column.isNullable());
   }
+  
+  @Test
+  public void testGetSourceVersion() {
+    final DBAccessor dbAccessor     = createNiceMock(DBAccessor.class);
+    UpgradeCatalog upgradeCatalog = getUpgradeCatalog(dbAccessor);
+    Assert.assertEquals("1.6.0", upgradeCatalog.getSourceVersion());
+  }   
 }


Mime
View raw message