brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [3/9] git commit: Fix DynamicToyMySqlEntity (setting serviceUp)
Date Thu, 30 Oct 2014 21:44:43 GMT
Fix DynamicToyMySqlEntity (setting serviceUp)

- integration tests were failing because serviceUp was never being set.
- Now set it on start/stop.
- Would be even better to have a Feed that checks pid periodically.


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

Branch: refs/heads/master
Commit: 8b5dec69c8824ee8d321d132518bcee429cde641
Parents: 75e7628
Author: Aled Sage <aled.sage@gmail.com>
Authored: Thu Oct 30 11:16:08 2014 +0000
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Thu Oct 30 21:25:06 2014 +0000

----------------------------------------------------------------------
 .../entity/software/mysql/DynamicToyMySqlEntityBuilder.java | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/8b5dec69/software/base/src/test/java/brooklyn/entity/software/mysql/DynamicToyMySqlEntityBuilder.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/brooklyn/entity/software/mysql/DynamicToyMySqlEntityBuilder.java
b/software/base/src/test/java/brooklyn/entity/software/mysql/DynamicToyMySqlEntityBuilder.java
index 44e598f..a40182d 100644
--- a/software/base/src/test/java/brooklyn/entity/software/mysql/DynamicToyMySqlEntityBuilder.java
+++ b/software/base/src/test/java/brooklyn/entity/software/mysql/DynamicToyMySqlEntityBuilder.java
@@ -149,10 +149,19 @@ public class DynamicToyMySqlEntityBuilder {
                 // and set the PID
                 entity().setAttribute(Attributes.PID, 
                         Integer.parseInt(DynamicTasks.queue(SshEffectorTasks.ssh("cat "+dir(entity)+"/*/data/*.pid")).block().getStdout().trim()));
+                
+                // TODO Without this, tests fail because nothing else sets serviceUp!
+                // Really should set this with a Feed that checks pid periodically.
+                // Should this instead be using SERVICE_NOT_UP_INDICATORS?
+                entity().setAttribute(Attributes.SERVICE_UP, true);
             }
 
             @Override
             protected String stopProcessesAtMachine() {
+                // TODO Where is best place to set? 
+                // Really should set this with a Feed that checks pid periodically.
+                entity().setAttribute(Attributes.SERVICE_UP, false);
+                
                 Integer pid = entity().getAttribute(Attributes.PID);
                 if (pid==null) {
                     log.info("mysql not running");


Mime
View raw message