brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject [49/64] [abbrv] incubator-brooklyn git commit: BROOKLYN-162 - adjust software/monitoring for refactoring (i didn't have this loaded)
Date Tue, 18 Aug 2015 15:03:58 GMT
BROOKLYN-162 - adjust software/monitoring for refactoring (i didn't have this loaded)


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/63e20f7e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/63e20f7e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/63e20f7e

Branch: refs/heads/master
Commit: 63e20f7ed57a1b790f86a671a7d4d04af4572bee
Parents: e6ac83b
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Tue Aug 18 14:22:04 2015 +0100
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Tue Aug 18 14:51:57 2015 +0100

----------------------------------------------------------------------
 .../entity/monitoring/monit/MonitNode.java      |  9 ++++----
 .../entity/monitoring/monit/MonitNodeImpl.java  | 20 ++++++++---------
 .../entity/monitoring/monit/MonitSshDriver.java | 17 +++++++--------
 .../monitoring/monit/MonitIntegrationTest.java  | 23 +++++++++-----------
 4 files changed, 32 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/63e20f7e/software/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/monit/MonitNode.java
----------------------------------------------------------------------
diff --git a/software/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/monit/MonitNode.java
b/software/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/monit/MonitNode.java
index 064a54b..aaebab9 100644
--- a/software/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/monit/MonitNode.java
+++ b/software/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/monit/MonitNode.java
@@ -20,16 +20,16 @@ package org.apache.brooklyn.entity.monitoring.monit;
 
 import java.util.Map;
 
-import com.google.common.collect.ImmutableMap;
-import com.google.common.reflect.TypeToken;
-
 import org.apache.brooklyn.api.catalog.Catalog;
 import org.apache.brooklyn.api.entity.proxying.ImplementedBy;
 import org.apache.brooklyn.api.entity.trait.HasShortName;
 import org.apache.brooklyn.api.event.AttributeSensor;
+import org.apache.brooklyn.config.ConfigKey;
 import org.apache.brooklyn.core.util.flags.SetFromFlag;
 
-import brooklyn.config.ConfigKey;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.reflect.TypeToken;
+
 import brooklyn.entity.basic.Attributes;
 import brooklyn.entity.basic.ConfigKeys;
 import brooklyn.entity.basic.SoftwareProcess;
@@ -51,6 +51,7 @@ public interface MonitNode extends SoftwareProcess, HasShortName {
     @SetFromFlag("controlFileUrl")
     public static final ConfigKey<String> CONTROL_FILE_URL = ConfigKeys.newStringConfigKey("monit.control.url",
"URL where monit control (.monitrc) file can be found", "");
 
+    @SuppressWarnings("serial")
     public static final ConfigKey<Map<String, Object>> CONTROL_FILE_SUBSTITUTIONS
= ConfigKeys.newConfigKey(new TypeToken<Map<String, Object>>(){}, "monit.control.substitutions",

         "Additional substitutions to be used in the control file template", ImmutableMap.<String,
Object>of());
     

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/63e20f7e/software/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/monit/MonitNodeImpl.java
----------------------------------------------------------------------
diff --git a/software/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/monit/MonitNodeImpl.java
b/software/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/monit/MonitNodeImpl.java
index 7f71754..237f8c9 100644
--- a/software/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/monit/MonitNodeImpl.java
+++ b/software/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/monit/MonitNodeImpl.java
@@ -22,22 +22,20 @@ import java.util.Map;
 
 import org.apache.brooklyn.api.entity.Entity;
 import org.apache.brooklyn.api.location.Location;
+import org.apache.brooklyn.location.basic.SshMachineLocation;
+import org.apache.brooklyn.util.text.Strings;
+import org.apache.brooklyn.util.time.Duration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.base.Function;
+import com.google.common.collect.Iterables;
+
 import brooklyn.entity.basic.SoftwareProcessImpl;
 import brooklyn.event.feed.ssh.SshFeed;
 import brooklyn.event.feed.ssh.SshPollConfig;
 import brooklyn.event.feed.ssh.SshPollValue;
 
-import org.apache.brooklyn.location.basic.SshMachineLocation;
-
-import brooklyn.util.text.Strings;
-import brooklyn.util.time.Duration;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-
 public class MonitNodeImpl extends SoftwareProcessImpl implements MonitNode {
     
     private static final Logger LOG = LoggerFactory.getLogger(MonitNodeImpl.class);
@@ -47,16 +45,16 @@ public class MonitNodeImpl extends SoftwareProcessImpl implements MonitNode
{
     public MonitNodeImpl() {
     }
     
-    public MonitNodeImpl(Map flags) {
+    public MonitNodeImpl(Map<?,?> flags) {
         super(flags, null);
     }
     
-    public MonitNodeImpl(Map flags, Entity parent) {
+    public MonitNodeImpl(Map<?,?> flags, Entity parent) {
         super(flags, parent);
     }
 
     @Override
-    public Class getDriverInterface() {
+    public Class<? extends MonitDriver> getDriverInterface() {
         return MonitDriver.class;
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/63e20f7e/software/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/monit/MonitSshDriver.java
----------------------------------------------------------------------
diff --git a/software/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/monit/MonitSshDriver.java
b/software/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/monit/MonitSshDriver.java
index b9e55af..0032515 100644
--- a/software/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/monit/MonitSshDriver.java
+++ b/software/monitoring/src/main/java/org/apache/brooklyn/entity/monitoring/monit/MonitSshDriver.java
@@ -23,20 +23,19 @@ import static java.lang.String.format;
 import java.util.List;
 import java.util.Map;
 
-import brooklyn.entity.basic.AbstractSoftwareProcessSshDriver;
-import brooklyn.entity.basic.Entities;
-import brooklyn.entity.basic.lifecycle.ScriptHelper;
-
 import org.apache.brooklyn.api.location.OsDetails;
 import org.apache.brooklyn.location.basic.SshMachineLocation;
-
-import brooklyn.util.collections.MutableMap;
-import brooklyn.util.os.Os;
-import brooklyn.util.ssh.BashCommands;
+import org.apache.brooklyn.util.collections.MutableMap;
+import org.apache.brooklyn.util.os.Os;
+import org.apache.brooklyn.util.ssh.BashCommands;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 
+import brooklyn.entity.basic.AbstractSoftwareProcessSshDriver;
+import brooklyn.entity.basic.Entities;
+import brooklyn.entity.basic.lifecycle.ScriptHelper;
+
 public class MonitSshDriver extends AbstractSoftwareProcessSshDriver implements MonitDriver
{
     
     private String remoteControlFilePath;
@@ -98,7 +97,7 @@ public class MonitSshDriver extends AbstractSoftwareProcessSshDriver implements
     
     @Override
     public boolean isRunning() {
-        Map flags = ImmutableMap.of("usePidFile", getMonitPidFile());
+        Map<String,?> flags = ImmutableMap.of("usePidFile", getMonitPidFile());
         return newScript(flags, CHECK_RUNNING).execute() == 0;
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/63e20f7e/software/monitoring/src/test/java/org/apache/brooklyn/entity/monitoring/monit/MonitIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/monitoring/src/test/java/org/apache/brooklyn/entity/monitoring/monit/MonitIntegrationTest.java
b/software/monitoring/src/test/java/org/apache/brooklyn/entity/monitoring/monit/MonitIntegrationTest.java
index 48bfafa..2cd9e49 100644
--- a/software/monitoring/src/test/java/org/apache/brooklyn/entity/monitoring/monit/MonitIntegrationTest.java
+++ b/software/monitoring/src/test/java/org/apache/brooklyn/entity/monitoring/monit/MonitIntegrationTest.java
@@ -18,7 +18,6 @@
  */
 package org.apache.brooklyn.entity.monitoring.monit;
 
-import static brooklyn.util.JavaGroovyEquivalents.elvis;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertNotEquals;
 
@@ -30,6 +29,9 @@ import java.util.concurrent.Callable;
 
 import org.apache.brooklyn.api.entity.proxying.EntitySpec;
 import org.apache.brooklyn.api.location.MachineDetails;
+import org.apache.brooklyn.entity.database.mysql.MySqlNode;
+import org.apache.brooklyn.location.basic.LocalhostMachineProvisioningLocation;
+import org.apache.brooklyn.test.Asserts;
 import org.apache.brooklyn.test.EntityTestUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -37,22 +39,17 @@ import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
+import com.google.common.base.Function;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.io.Files;
+
 import brooklyn.entity.BrooklynAppLiveTestSupport;
 import brooklyn.entity.basic.Entities;
 import brooklyn.entity.basic.SameServerEntity;
 import brooklyn.entity.basic.SoftwareProcess;
-import org.apache.brooklyn.entity.database.mysql.MySqlNode;
 import brooklyn.event.basic.DependentConfiguration;
 
-import org.apache.brooklyn.location.basic.LocalhostMachineProvisioningLocation;
-
-import brooklyn.test.Asserts;
-
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.io.Files;
-
 public class MonitIntegrationTest extends BrooklynAppLiveTestSupport {
 
     private static final Logger LOG = LoggerFactory.getLogger(MonitIntegrationTest.class);
@@ -113,7 +110,7 @@ public class MonitIntegrationTest extends BrooklynAppLiveTestSupport {
             public void run() {
                 String targetStatus = monitNode.getAttribute(MonitNode.MONIT_TARGET_PROCESS_STATUS);
                 LOG.debug("MonitNode target status: {}", targetStatus);
-                assertNotEquals(elvis(targetStatus, ""), "Running");
+                assertNotEquals(targetStatus, "Running");
             }
         });
         mySqlNode.restart();
@@ -176,7 +173,7 @@ public class MonitIntegrationTest extends BrooklynAppLiveTestSupport {
             public void run() {
                 String targetStatus = monitNode.getAttribute(MonitNode.MONIT_TARGET_PROCESS_STATUS);
                 LOG.debug("MonitNode target status: {}", targetStatus);
-                assertEquals(elvis(targetStatus, ""), "Running");
+                assertEquals(targetStatus, "Running");
                 try {
                     initialPid[0] = Files.readFirstLine(new File(mySqlNode.getAttribute(SoftwareProcess.PID_FILE)),
Charset.defaultCharset());
                     LOG.debug("Initial PID: {}", initialPid[0]);


Mime
View raw message