ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathanhur...@apache.org
Subject ambari git commit: AMBARI-9987 - Alerts: Cannot See Units for DataNode Health Summary Alert Definition (jonathanhurley)
Date Tue, 10 Mar 2015 04:17:26 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.0.0 13d506a9f -> f47d4e123


AMBARI-9987 - Alerts: Cannot See Units for DataNode Health Summary Alert Definition (jonathanhurley)


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

Branch: refs/heads/branch-2.0.0
Commit: f47d4e12316c87a97ede639d673fde54b4a91430
Parents: 13d506a
Author: Jonathan Hurley <jhurley@hortonworks.com>
Authored: Mon Mar 9 15:29:17 2015 -0400
Committer: Jonathan Hurley <jhurley@hortonworks.com>
Committed: Tue Mar 10 00:17:14 2015 -0400

----------------------------------------------------------------------
 .../common-services/HDFS/2.1.0.2.0/alerts.json  |  2 +-
 .../stacks/BIGTOP/0.8/services/HDFS/alerts.json |  2 +-
 .../server/api/services/AmbariMetaInfoTest.java |  9 ++-
 .../services/KerberosServiceMetaInfoTest.java   | 37 +++++++-----
 .../AmbariManagementControllerTest.java         | 25 ++++----
 .../server/orm/InMemoryDefaultTestModule.java   | 13 ++--
 .../ambari/server/orm/JdbcPropertyTest.java     |  6 +-
 .../authorization/AuthorizationTestModule.java  | 17 ++----
 ...thorizationTestModuleForLdapDNWithSpace.java | 13 ++--
 .../ambari/server/upgrade/UpgradeTest.java      | 62 ++++++++++++++------
 ambari-server/src/test/resources/version        |  1 +
 11 files changed, 105 insertions(+), 82 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f47d4e12/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json
index 8f55cde..da8ebba 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json
@@ -366,7 +366,7 @@
               "text": "Dead/Stale Datanode(s): {0}/{1} out of {2}",
               "value": 1
             },
-            "units" : "DataNode(s)"
+            "units" : "DNs"
           },
           "jmx": {
             "property_list": [

http://git-wip-us.apache.org/repos/asf/ambari/blob/f47d4e12/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/alerts.json
b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/alerts.json
index 95464b7..a268ad9 100644
--- a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/alerts.json
+++ b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/alerts.json
@@ -366,7 +366,7 @@
               "text": "Dead/Stale Datanode(s): {0}/{1} out of {2}",
               "value": 1
             },
-            "units" : "DataNode(s)"
+            "units" : "DNs"
           },
           "jmx": {
             "property_list": [

http://git-wip-us.apache.org/repos/asf/ambari/blob/f47d4e12/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
index 0d944ab..c7878db 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
@@ -40,7 +40,6 @@ import java.util.Map;
 import java.util.Set;
 
 import javax.persistence.EntityManager;
-import javax.xml.bind.JAXBException;
 
 import junit.framework.Assert;
 
@@ -141,7 +140,7 @@ public class AmbariMetaInfoTest {
   @Before
   public void before() throws Exception {
     File stacks = new File("src/test/resources/stacks");
-    File version = new File("target/version");
+    File version = new File("src/test/resources/version");
     if (System.getProperty("os.name").contains("Windows")) {
       stacks = new File(ClassLoader.getSystemClassLoader().getResource("stacks").getPath());
       version = new File(new File(ClassLoader.getSystemClassLoader().getResource("").getPath()).getParent(),
"version");
@@ -536,7 +535,7 @@ public class AmbariMetaInfoTest {
   public void testMetaInfoFileFilter() throws Exception {
     String buildDir = tmpFolder.getRoot().getAbsolutePath();
     File stackRoot = new File("src/test/resources/stacks");
-    File version = new File("target/version");
+    File version = new File("src/test/resources/version");
     if (System.getProperty("os.name").contains("Windows")) {
       stackRoot = new File(ClassLoader.getSystemClassLoader().getResource("stacks").getPath());
       version = new File(new File(ClassLoader.getSystemClassLoader().getResource("").getPath()).getParent(),
"version");
@@ -796,7 +795,7 @@ public class AmbariMetaInfoTest {
   @Test
   public void testBadStack() throws Exception {
     File stackRoot = new File("src/test/resources/bad-stacks");
-    File version = new File("target/version");
+    File version = new File("src/test/resources/version");
     if (System.getProperty("os.name").contains("Windows")) {
       stackRoot = new File(ClassLoader.getSystemClassLoader().getResource("bad-stacks").getPath());
       version = new File(new File(ClassLoader.getSystemClassLoader().getResource("").getPath()).getParent(),
"version");
@@ -1777,7 +1776,7 @@ public class AmbariMetaInfoTest {
   private TestAmbariMetaInfo setupTempAmbariMetaInfo(String buildDir, boolean replayMocks)
throws Exception {
     File stackRootTmp = new File(buildDir + "/ambari-metaInfo");
     File stackRoot = new File("src/test/resources/stacks");
-    File version = new File("target/version");
+    File version = new File("src/test/resources/version");
 
     if (System.getProperty("os.name").contains("Windows")) {
       stackRoot = new File(ClassLoader.getSystemClassLoader().getResource("stacks").getPath());

http://git-wip-us.apache.org/repos/asf/ambari/blob/f47d4e12/ambari-server/src/test/java/org/apache/ambari/server/api/services/KerberosServiceMetaInfoTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/KerberosServiceMetaInfoTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/api/services/KerberosServiceMetaInfoTest.java
index 8a4616a..fe006ea 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/KerberosServiceMetaInfoTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/KerberosServiceMetaInfoTest.java
@@ -18,7 +18,19 @@
 
 package org.apache.ambari.server.api.services;
 
+import static org.easymock.EasyMock.createNiceMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 import junit.framework.Assert;
+
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.events.publishers.AmbariEventPublisher;
@@ -37,15 +49,6 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.File;
-import java.lang.reflect.Field;
-import java.util.*;
-
-import static org.easymock.EasyMock.createNiceMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.junit.Assert.fail;
-
 public class KerberosServiceMetaInfoTest {
   private final static Logger LOG = LoggerFactory.getLogger(KerberosServiceMetaInfoTest.class);
   private ServiceInfo serviceInfo = null;
@@ -68,9 +71,9 @@ public class KerberosServiceMetaInfoTest {
       AutoDeployInfo expectedAutoDeploy = expectedAutoDeployMap.get(component.getName());
       AutoDeployInfo componentAutoDeploy = component.getAutoDeploy();
 
-      if (expectedAutoDeploy == null)
+      if (expectedAutoDeploy == null) {
         Assert.assertNull(componentAutoDeploy);
-      else {
+      } else {
         Assert.assertNotNull(componentAutoDeploy);
         Assert.assertEquals(expectedAutoDeploy.isEnabled(), componentAutoDeploy.isEnabled());
         Assert.assertEquals(expectedAutoDeploy.getCoLocate(), componentAutoDeploy.getCoLocate());
@@ -106,9 +109,9 @@ public class KerberosServiceMetaInfoTest {
       Map<String, ? extends DependencyInfo> expectedDependencyMap = expectedDependenciesMap.get(component.getName());
       List<DependencyInfo> componentDependencies = component.getDependencies();
 
-      if (expectedDependencyMap == null)
+      if (expectedDependencyMap == null) {
         Assert.assertNull(componentDependencies);
-      else {
+      } else {
         Assert.assertEquals(expectedDependencyMap.size(), componentDependencies.size());
 
         for (DependencyInfo componentDependency : componentDependencies) {
@@ -124,9 +127,9 @@ public class KerberosServiceMetaInfoTest {
           Assert.assertEquals(expectedDependency.getComponentName(), componentDependency.getComponentName());
           Assert.assertEquals(expectedDependency.getScope(), componentDependency.getScope());
 
-          if (expectedDependencyAutoDeploy == null)
+          if (expectedDependencyAutoDeploy == null) {
             Assert.assertNull(componentDependencyAutoDeploy);
-          else {
+          } else {
             Assert.assertNotNull(componentDependencyAutoDeploy);
             Assert.assertEquals(expectedDependencyAutoDeploy.isEnabled(), componentDependencyAutoDeploy.isEnabled());
             Assert.assertEquals(expectedDependencyAutoDeploy.getCoLocate(), componentDependencyAutoDeploy.getCoLocate());
@@ -143,7 +146,9 @@ public class KerberosServiceMetaInfoTest {
     LOG.info("Stacks file " + stackRoot.getAbsolutePath());
     LOG.info("Common Services file " + commonServicesRoot.getAbsolutePath());
 
-    AmbariMetaInfo metaInfo = createAmbariMetaInfo(stackRoot, commonServicesRoot, new File("target/version"),
true);
+    AmbariMetaInfo metaInfo = createAmbariMetaInfo(stackRoot,
+        commonServicesRoot, new File("src/test/resources/version"), true);
+
     metaInfo.init();
 
     serviceInfo = metaInfo.getService("HDP", "2.2", "KERBEROS");

http://git-wip-us.apache.org/repos/asf/ambari/blob/f47d4e12/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
index adf562b..31c315b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
@@ -8046,7 +8046,9 @@ public class AmbariManagementControllerTest {
     assertEquals(original, repo.getDefaultBaseUrl());
 
     // verify change with new meta info
-    AmbariMetaInfo ami = new AmbariMetaInfo(new File("src/test/resources/stacks"), null,
new File("target/version"));
+    AmbariMetaInfo ami = new AmbariMetaInfo(new File(
+        "src/test/resources/stacks"), null, new File(
+        "src/test/resources/version"));
     injector.injectMembers(ami);
     ami.init();
 
@@ -8587,12 +8589,9 @@ public class AmbariManagementControllerTest {
       protected void configure() {
         Properties properties = new Properties();
         properties.setProperty(Configuration.SERVER_PERSISTENCE_TYPE_KEY, "in-memory");
-        properties.setProperty(Configuration.METADETA_DIR_PATH,
-            "src/test/resources/stacks");
-        properties.setProperty(Configuration.SERVER_VERSION_FILE,
-            "target/version");
-        properties.setProperty(Configuration.OS_VERSION_KEY,
-            "centos6");
+        properties.setProperty(Configuration.METADETA_DIR_PATH,"src/test/resources/stacks");
+        properties.setProperty(Configuration.SERVER_VERSION_FILE,"src/test/resources/version");
+        properties.setProperty(Configuration.OS_VERSION_KEY,"centos6");
         properties.setProperty(Configuration.SHARED_RESOURCES_DIR_KEY, "src/test/resources/");
         try {
           install(new ControllerModule(properties));
@@ -8771,14 +8770,10 @@ public class AmbariManagementControllerTest {
       @Override
       protected void configure() {
         Properties properties = new Properties();
-        properties.setProperty(Configuration.SERVER_PERSISTENCE_TYPE_KEY, "in-memory");
-
-        properties.setProperty(Configuration.METADETA_DIR_PATH,
-            "src/test/resources/stacks");
-        properties.setProperty(Configuration.SERVER_VERSION_FILE,
-            "target/version");
-        properties.setProperty(Configuration.OS_VERSION_KEY,
-            "centos5");
+        properties.setProperty(Configuration.SERVER_PERSISTENCE_TYPE_KEY,"in-memory");
+        properties.setProperty(Configuration.METADETA_DIR_PATH,"src/test/resources/stacks");
+        properties.setProperty(Configuration.SERVER_VERSION_FILE,"src/test/resources/version");
+        properties.setProperty(Configuration.OS_VERSION_KEY,"centos5");
         properties.setProperty(Configuration.SHARED_RESOURCES_DIR_KEY, "src/test/resources/");
 
         try {

http://git-wip-us.apache.org/repos/asf/ambari/blob/f47d4e12/ambari-server/src/test/java/org/apache/ambari/server/orm/InMemoryDefaultTestModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/orm/InMemoryDefaultTestModule.java
b/ambari-server/src/test/java/org/apache/ambari/server/orm/InMemoryDefaultTestModule.java
index 621caba..174d489 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/orm/InMemoryDefaultTestModule.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/orm/InMemoryDefaultTestModule.java
@@ -18,17 +18,18 @@ package org.apache.ambari.server.orm;
  * limitations under the License.
  */
 
-import com.google.inject.AbstractModule;
-import org.apache.ambari.server.configuration.Configuration;
-import org.apache.ambari.server.controller.ControllerModule;
-import org.springframework.beans.factory.config.BeanDefinition;
-
 import java.io.File;
 import java.util.Collections;
 import java.util.Properties;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicReference;
 
+import org.apache.ambari.server.configuration.Configuration;
+import org.apache.ambari.server.controller.ControllerModule;
+import org.springframework.beans.factory.config.BeanDefinition;
+
+import com.google.inject.AbstractModule;
+
 public class InMemoryDefaultTestModule extends AbstractModule {
 
   /**
@@ -60,7 +61,7 @@ public class InMemoryDefaultTestModule extends AbstractModule {
   @Override
   protected void configure() {
     String stacks = "src/test/resources/stacks";
-    String version = "target/version";
+    String version = "src/test/resources/version";
     String sharedResourcesDir = "src/test/resources/";
     if (System.getProperty("os.name").contains("Windows")) {
       stacks = ClassLoader.getSystemClassLoader().getResource("stacks").getPath();

http://git-wip-us.apache.org/repos/asf/ambari/blob/f47d4e12/ambari-server/src/test/java/org/apache/ambari/server/orm/JdbcPropertyTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/orm/JdbcPropertyTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/orm/JdbcPropertyTest.java
index 2c229cb..0b1f41e 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/orm/JdbcPropertyTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/orm/JdbcPropertyTest.java
@@ -40,7 +40,7 @@ public class JdbcPropertyTest {
     properties = new Properties();
     properties.setProperty(Configuration.SERVER_PERSISTENCE_TYPE_KEY, "in-memory");
     properties.setProperty(Configuration.METADETA_DIR_PATH, "src/test/resources/stacks");
-    properties.setProperty(Configuration.SERVER_VERSION_FILE, "target/version");
+    properties.setProperty(Configuration.SERVER_VERSION_FILE, "src/test/resources/version");
     properties.setProperty(Configuration.OS_VERSION_KEY, "centos5");
     properties.setProperty(Configuration.SHARED_RESOURCES_DIR_KEY, "src/test/resources/");
   }
@@ -57,7 +57,7 @@ public class JdbcPropertyTest {
 
     injector.getInstance(Clusters.class);
   }
-  
+
   @Test
   public void testJdbcProperty() throws Exception {
     properties.setProperty(Configuration.SERVER_JDBC_PROPERTIES_PREFIX + "shutdown", "true");
@@ -71,5 +71,5 @@ public class JdbcPropertyTest {
     }
   }
 
-  
+
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/f47d4e12/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AuthorizationTestModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AuthorizationTestModule.java
b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AuthorizationTestModule.java
index 969615f..bdf5a6f 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AuthorizationTestModule.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AuthorizationTestModule.java
@@ -17,14 +17,12 @@
  */
 package org.apache.ambari.server.security.authorization;
 
-import com.google.inject.AbstractModule;
+import java.util.Properties;
+
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.controller.ControllerModule;
-import org.springframework.security.crypto.password.PasswordEncoder;
-import org.springframework.security.crypto.password.StandardPasswordEncoder;
 
-import java.lang.reflect.Constructor;
-import java.util.Properties;
+import com.google.inject.AbstractModule;
 
 public class AuthorizationTestModule extends AbstractModule {
   @Override
@@ -32,12 +30,9 @@ public class AuthorizationTestModule extends AbstractModule {
     Properties properties = new Properties();
     properties.setProperty(Configuration.CLIENT_SECURITY_KEY, "ldap");
     properties.setProperty(Configuration.SERVER_PERSISTENCE_TYPE_KEY, "in-memory");
-    properties.setProperty(Configuration.METADETA_DIR_PATH,
-        "src/test/resources/stacks");
-    properties.setProperty(Configuration.SERVER_VERSION_FILE,
-        "target/version");
-    properties.setProperty(Configuration.OS_VERSION_KEY,
-        "centos5");
+    properties.setProperty(Configuration.METADETA_DIR_PATH,"src/test/resources/stacks");
+    properties.setProperty(Configuration.SERVER_VERSION_FILE,"src/test/resources/version");
+    properties.setProperty(Configuration.OS_VERSION_KEY,"centos5");
     properties.setProperty(Configuration.SHARED_RESOURCES_DIR_KEY, "src/test/resources/");
     //make ambari detect active configuration
     properties.setProperty(Configuration.LDAP_GROUP_BASE_KEY, "ou=groups,dc=ambari,dc=apache,dc=org");

http://git-wip-us.apache.org/repos/asf/ambari/blob/f47d4e12/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AuthorizationTestModuleForLdapDNWithSpace.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AuthorizationTestModuleForLdapDNWithSpace.java
b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AuthorizationTestModuleForLdapDNWithSpace.java
index ba824a4..d37513e 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AuthorizationTestModuleForLdapDNWithSpace.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/AuthorizationTestModuleForLdapDNWithSpace.java
@@ -17,23 +17,22 @@
  */
 package org.apache.ambari.server.security.authorization;
 
-import com.google.inject.AbstractModule;
 import java.util.Properties;
+
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.controller.ControllerModule;
 
+import com.google.inject.AbstractModule;
+
 public class AuthorizationTestModuleForLdapDNWithSpace extends AbstractModule {
   @Override
   protected void configure() {
     Properties properties = new Properties();
     properties.setProperty(Configuration.CLIENT_SECURITY_KEY, "ldap");
     properties.setProperty(Configuration.SERVER_PERSISTENCE_TYPE_KEY, "in-memory");
-    properties.setProperty(Configuration.METADETA_DIR_PATH,
-        "src/test/resources/stacks");
-    properties.setProperty(Configuration.SERVER_VERSION_FILE,
-        "target/version");
-    properties.setProperty(Configuration.OS_VERSION_KEY,
-        "centos5");
+    properties.setProperty(Configuration.METADETA_DIR_PATH,"src/test/resources/stacks");
+    properties.setProperty(Configuration.SERVER_VERSION_FILE,"src/test/resources/version");
+    properties.setProperty(Configuration.OS_VERSION_KEY,"centos5");
     properties.setProperty(Configuration.SHARED_RESOURCES_DIR_KEY, "src/test/resources/");
     //make ambari detect active configuration
     properties.setProperty(Configuration.LDAP_BASE_DN_KEY, "dc=ambari,dc=the apache,dc=org");

http://git-wip-us.apache.org/repos/asf/ambari/blob/f47d4e12/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeTest.java
index 44bd204..7455706 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeTest.java
@@ -18,15 +18,46 @@
 
 package org.apache.ambari.server.upgrade;
 
-import com.google.inject.Guice;
-import com.google.inject.Injector;
-import com.google.inject.Key;
-import com.google.inject.TypeLiteral;
-import com.google.inject.persist.PersistService;
+import java.io.IOException;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.SQLNonTransientConnectionException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.controller.ControllerModule;
 import org.apache.ambari.server.orm.DBAccessor;
-import org.apache.ambari.server.orm.dao.*;
+import org.apache.ambari.server.orm.dao.BlueprintDAO;
+import org.apache.ambari.server.orm.dao.ClusterDAO;
+import org.apache.ambari.server.orm.dao.ClusterServiceDAO;
+import org.apache.ambari.server.orm.dao.ClusterStateDAO;
+import org.apache.ambari.server.orm.dao.ConfigGroupConfigMappingDAO;
+import org.apache.ambari.server.orm.dao.ConfigGroupDAO;
+import org.apache.ambari.server.orm.dao.ConfigGroupHostMappingDAO;
+import org.apache.ambari.server.orm.dao.ExecutionCommandDAO;
+import org.apache.ambari.server.orm.dao.HostComponentDesiredStateDAO;
+import org.apache.ambari.server.orm.dao.HostComponentStateDAO;
+import org.apache.ambari.server.orm.dao.HostConfigMappingDAO;
+import org.apache.ambari.server.orm.dao.HostDAO;
+import org.apache.ambari.server.orm.dao.HostRoleCommandDAO;
+import org.apache.ambari.server.orm.dao.HostStateDAO;
+import org.apache.ambari.server.orm.dao.KeyValueDAO;
+import org.apache.ambari.server.orm.dao.MetainfoDAO;
+import org.apache.ambari.server.orm.dao.RequestDAO;
+import org.apache.ambari.server.orm.dao.RequestScheduleBatchRequestDAO;
+import org.apache.ambari.server.orm.dao.RequestScheduleDAO;
+import org.apache.ambari.server.orm.dao.RoleSuccessCriteriaDAO;
+import org.apache.ambari.server.orm.dao.ServiceComponentDesiredStateDAO;
+import org.apache.ambari.server.orm.dao.ServiceDesiredStateDAO;
+import org.apache.ambari.server.orm.dao.StageDAO;
+import org.apache.ambari.server.orm.dao.UserDAO;
+import org.apache.ambari.server.orm.dao.ViewDAO;
+import org.apache.ambari.server.orm.dao.ViewInstanceDAO;
 import org.apache.ambari.server.utils.VersionUtils;
 import org.apache.ambari.server.view.ViewRegistry;
 import org.easymock.EasyMock;
@@ -36,11 +67,11 @@ import org.junit.runners.Parameterized;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.IOException;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.sql.SQLNonTransientConnectionException;
-import java.util.*;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.Key;
+import com.google.inject.TypeLiteral;
+import com.google.inject.persist.PersistService;
 
 @RunWith(Parameterized.class)
 public class UpgradeTest {
@@ -62,12 +93,9 @@ public class UpgradeTest {
     properties.setProperty(Configuration.SERVER_PERSISTENCE_TYPE_KEY, "remote");
     properties.setProperty(Configuration.SERVER_JDBC_URL_KEY, Configuration.JDBC_IN_MEMORY_URL);
     properties.setProperty(Configuration.SERVER_JDBC_DRIVER_KEY, Configuration.JDBC_IN_MEMROY_DRIVER);
-    properties.setProperty(Configuration.METADETA_DIR_PATH,
-      "src/test/resources/stacks");
-    properties.setProperty(Configuration.SERVER_VERSION_FILE,
-      "target/version");
-    properties.setProperty(Configuration.OS_VERSION_KEY,
-      "centos5");
+    properties.setProperty(Configuration.METADETA_DIR_PATH,"src/test/resources/stacks");
+    properties.setProperty(Configuration.SERVER_VERSION_FILE,"src/test/resources/version");
+    properties.setProperty(Configuration.OS_VERSION_KEY,"centos5");
     properties.setProperty(Configuration.SHARED_RESOURCES_DIR_KEY, "src/test/resources/");
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/f47d4e12/ambari-server/src/test/resources/version
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/version b/ambari-server/src/test/resources/version
new file mode 100644
index 0000000..359a5b9
--- /dev/null
+++ b/ambari-server/src/test/resources/version
@@ -0,0 +1 @@
+2.0.0
\ No newline at end of file


Mime
View raw message