Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 18ee8b5cd -> b71f66436


ATLAS-2957: Fix and enable disabled StormHook Integrations Tests

(cherry picked from commit 243a43218fa8a72ff653bf0b61af9ac1c5b1ef85)


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

Branch: refs/heads/branch-1.0
Commit: b71f66436656202bcfb03071ed0a9ddf5eca9ca6
Parents: 18ee8b5
Author: Sarath Subramanian <ssubraman...@hortonworks.com>
Authored: Tue Nov 6 15:35:35 2018 -0800
Committer: Sarath Subramanian <ssubraman...@hortonworks.com>
Committed: Tue Nov 6 15:43:37 2018 -0800

----------------------------------------------------------------------
 .../org/apache/atlas/storm/hook/StormAtlasHookIT.java |  5 ++---
 .../org/apache/atlas/hook/FailedMessagesLogger.java   | 14 ++++++++------
 pom.xml                                               |  4 ++++
 3 files changed, 14 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/b71f6643/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
----------------------------------------------------------------------
diff --git 
a/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
 
b/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
index 7040870..e11e1b8 100644
--- 
a/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
+++ 
b/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
@@ -36,7 +36,7 @@ import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
-@Test(enabled = false)
+@Test
 public class StormAtlasHookIT {
 
     public static final Logger LOG = 
LoggerFactory.getLogger(StormAtlasHookIT.class);
@@ -70,8 +70,7 @@ public class StormAtlasHookIT {
         atlasClient = null;
     }
 
-    //TODO: Fix failing test
-    @Test(enabled = false)
+    @Test
     public void testAddEntities() throws Exception {
         StormTopology stormTopology = StormTestUtil.createTestTopology();
         StormTestUtil.submitTopology(stormCluster, TOPOLOGY_NAME, 
stormTopology);

http://git-wip-us.apache.org/repos/asf/atlas/blob/b71f6643/notification/src/main/java/org/apache/atlas/hook/FailedMessagesLogger.java
----------------------------------------------------------------------
diff --git 
a/notification/src/main/java/org/apache/atlas/hook/FailedMessagesLogger.java 
b/notification/src/main/java/org/apache/atlas/hook/FailedMessagesLogger.java
index 0b3723a..b319e81 100644
--- a/notification/src/main/java/org/apache/atlas/hook/FailedMessagesLogger.java
+++ b/notification/src/main/java/org/apache/atlas/hook/FailedMessagesLogger.java
@@ -73,17 +73,19 @@ public class FailedMessagesLogger {
      * @return directory under which host component's logs are stored.
      */
     private String getRootLoggerDirectory() {
-        String rootLoggerDirectory = null;
-        org.apache.log4j.Logger rootLogger = 
org.apache.log4j.Logger.getRootLogger();
+        String      rootLoggerDirectory = null;
+        Logger      rootLogger          = Logger.getRootLogger();
+        Enumeration allAppenders        = rootLogger.getAllAppenders();
 
-        Enumeration allAppenders = rootLogger.getAllAppenders();
         if (allAppenders != null) {
             while (allAppenders.hasMoreElements()) {
                 Appender appender = (Appender) allAppenders.nextElement();
+
                 if (appender instanceof FileAppender) {
-                    FileAppender fileAppender = (FileAppender) appender;
-                    String rootLoggerFile = fileAppender.getFile();
-                    rootLoggerDirectory = new File(rootLoggerFile).getParent();
+                    FileAppender fileAppender   = (FileAppender) appender;
+                    String       rootLoggerFile = fileAppender.getFile();
+
+                    rootLoggerDirectory = rootLoggerFile != null ? new 
File(rootLoggerFile).getParent() : null;
                     break;
                 }
             }

http://git-wip-us.apache.org/repos/asf/atlas/blob/b71f6643/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 2e13586..146142f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1891,6 +1891,8 @@
                     <systemProperties>
                         <user.dir>${project.basedir}</user.dir>
                         
<atlas.data>${project.build.directory}/data</atlas.data>
+                        
<atlas.log.dir>${project.build.directory}/logs</atlas.log.dir>
+                        <atlas.log.file>application.log</atlas.log.file>
                         
<log4j.configuration>atlas-log4j.xml</log4j.configuration>
                         
<embedded.solr.directory>${project.basedir}/target</embedded.solr.directory>
                     </systemProperties>
@@ -1921,6 +1923,8 @@
                     <systemPropertyVariables>
                         <projectBaseDir>${projectBaseDir}</projectBaseDir>
                         
<atlas.data>${project.build.directory}/data</atlas.data>
+                        
<atlas.log.dir>${project.build.directory}/logs</atlas.log.dir>
+                        <atlas.log.file>application.log</atlas.log.file>
                         
<log4j.configuration>atlas-log4j.xml</log4j.configuration>
                         
<embedded.solr.directory>${project.basedir}/target</embedded.solr.directory>
                     </systemPropertyVariables>

Reply via email to