Change toString of RunnableCallFlow
authorOlivier Capillon <olivier.capillon@gmail.com>
Sun, 7 Nov 2010 19:19:40 +0000 (19:19 +0000)
committerOlivier Capillon <olivier.capillon@gmail.com>
Sun, 7 Nov 2010 19:19:40 +0000 (19:19 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@3854 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/generator/RunnableCallFlow.java
runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/impl/TestManagerServiceImpl.java

index a68c812f7d1a3c79ee8a10df75a80fb38cc89036..409c7168f63849559a992ddaa643278f4c8c28e1 100644 (file)
@@ -165,6 +165,11 @@ public class RunnableCallFlow implements ExecutionFlow, ApplicationContextAware
                }\r
        }\r
 \r
+       @Override\r
+       public String toString() {\r
+               return new StringBuffer("RunnableCallFlow ").append(name).toString();\r
+       }       \r
+       \r
        public ExecutionSpec getExecutionSpec() {\r
                return executionSpec;\r
        }\r
index acaa7b5a1636db6dae5034b6ef25c1c7f177917a..e8feff02007dd037297cf80a4acf6016f38ed658 100644 (file)
@@ -43,6 +43,8 @@ public class TestManagerServiceImpl implements TestManagerService {
        private final SlcExecutionDao slcExecutionDao;\r
        private final TreeTestResultCollectionDao treeTestResultCollectionDao;\r
 \r
+       private String defaultCollectionId = "default";\r
+       \r
        public TestManagerServiceImpl(TreeTestResultDao treeTestResultDao,\r
                        TestRunDescriptorDao testRunDescriptorDao,\r
                        SlcExecutionDao slcExecutionDao,\r
@@ -68,9 +70,10 @@ public class TestManagerServiceImpl implements TestManagerService {
                                                .getSlcExecution(testRunDescriptor\r
                                                                .getSlcExecutionUuid());\r
                                if (slcExecution != null) {\r
-                                       String collectionId = slcExecution.getUser() != null ? slcExecution\r
-                                                       .getUser()\r
-                                                       : "default";\r
+                                       // Use Host as collection ID if host is available\r
+                                       String collectionId = slcExecution.getHost() != null ? slcExecution\r
+                                                       .getHost()\r
+                                                       : defaultCollectionId;\r
                                        addResultToCollection(collectionId, testRunDescriptor\r
                                                        .getTestResultUuid());\r
                                }\r
@@ -78,7 +81,7 @@ public class TestManagerServiceImpl implements TestManagerService {
                                if (log.isTraceEnabled())\r
                                        log.trace("ResultUUID="\r
                                                        + testRunDescriptor.getTestResultUuid());\r
-                               addResultToCollection("default", testRunDescriptor\r
+                               addResultToCollection(defaultCollectionId, testRunDescriptor\r
                                                .getTestResultUuid());\r
                        }\r
                }\r
@@ -156,4 +159,8 @@ public class TestManagerServiceImpl implements TestManagerService {
 \r
        }\r
 \r
+       public void setDefaultCollectionId(String defaultCollectionId) {\r
+               this.defaultCollectionId = defaultCollectionId;\r
+       }\r
+\r
 }\r