You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by pa...@apache.org on 2011/09/06 22:20:00 UTC
svn commit: r1165823 - in /incubator/airavata/trunk/modules/gfac-core/src:
main/java/org/apache/airavata/core/gfac/notification/impl/
main/java/org/apache/airavata/core/gfac/scheduler/impl/
test/java/org/apache/airavata/core/gfac/services/impl/
Author: patanachai
Date: Tue Sep 6 20:20:00 2011
New Revision: 1165823
URL: http://svn.apache.org/viewvc?rev=1165823&view=rev
Log:
Make test case to use loggingNotification insteadOf DummyNotification
Modified:
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/notification/impl/LoggingNotification.java
incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java
incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImplTest.java
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/notification/impl/LoggingNotification.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/notification/impl/LoggingNotification.java?rev=1165823&r1=1165822&r2=1165823&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/notification/impl/LoggingNotification.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/notification/impl/LoggingNotification.java Tue Sep 6 20:20:00 2011
@@ -32,11 +32,11 @@ public class LoggingNotification impleme
protected final Logger log = LoggerFactory.getLogger(LoggingNotification.class);
public void startSchedule(Object notifier, InvocationContext context, Scheduler scheduler) {
- printOut(notifier, context, null);
+ printOut(notifier, context, "Start scheduling");
}
public void finishSchedule(Object notifier, InvocationContext context, Scheduler scheduler, Provider provider) {
- printOut(notifier, context, null);
+ printOut(notifier, context, "Finish scheduling");
}
public void input(Object notifier, InvocationContext context, String... data) {
@@ -47,7 +47,7 @@ public class LoggingNotification impleme
}
public void startExecution(Object notifier, InvocationContext context) {
- printOut(notifier, context, null);
+ printOut(notifier, context, "Start execution");
}
public void applicationInfo(Object notifier, InvocationContext context, String... data) {
@@ -55,7 +55,7 @@ public class LoggingNotification impleme
}
public void finishExecution(Object notifier, InvocationContext context) {
- printOut(notifier, context, null);
+ printOut(notifier, context, "Finish execution");
}
public void statusChanged(Object notifier, InvocationContext context, String... data) {
Modified: incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java?rev=1165823&r1=1165822&r2=1165823&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/core/gfac/scheduler/impl/SchedulerImpl.java Tue Sep 6 20:20:00 2011
@@ -37,8 +37,12 @@ import org.apache.airavata.core.gfac.typ
import org.apache.airavata.core.gfac.type.HostDescription;
import org.apache.airavata.core.gfac.type.ServiceDescription;
import org.apache.airavata.core.gfac.utils.GfacUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class SchedulerImpl implements Scheduler {
+
+ private static Logger log = LoggerFactory.getLogger(SchedulerImpl.class);
public Provider schedule(InvocationContext context) throws GfacException {
@@ -108,8 +112,7 @@ public class SchedulerImpl implements Sc
private HostDescription scheduleToHost(Registry regService,
String serviceName) {
- System.out
- .println("Searching registry for some deployed application hosts\n");
+ log.info("Searching registry for some deployed application hosts");
List<HostDescription> hosts = regService
.getServiceLocation(serviceName);
if (hosts != null && hosts.size() > 0) {
@@ -117,11 +120,11 @@ public class SchedulerImpl implements Sc
for (Iterator iterator = hosts.iterator(); iterator.hasNext();) {
result = (HostDescription) iterator.next();
- System.out.println("Found service on: " + result.getName());
+ log.info("Found service on: " + result.getName());
}
return result;
} else {
- System.out.println("Applcation " + serviceName
+ log.warn("Applcation " + serviceName
+ " not found in registry");
return null;
}
Modified: incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImplTest.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImplTest.java?rev=1165823&r1=1165822&r2=1165823&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImplTest.java (original)
+++ incubator/airavata/trunk/modules/gfac-core/src/test/java/org/apache/airavata/core/gfac/services/impl/PropertiesBasedServiceImplTest.java Tue Sep 6 20:20:00 2011
@@ -31,7 +31,7 @@ import org.apache.airavata.core.gfac.api
import org.apache.airavata.core.gfac.context.InvocationContext;
import org.apache.airavata.core.gfac.context.impl.ExecutionContextImpl;
import org.apache.airavata.core.gfac.context.impl.ParameterContextImpl;
-import org.apache.airavata.core.gfac.notification.impl.DummyNotification;
+import org.apache.airavata.core.gfac.notification.impl.LoggingNotification;
import org.apache.airavata.core.gfac.type.DataType;
import org.apache.airavata.core.gfac.type.HostDescription;
import org.apache.airavata.core.gfac.type.Parameter;
@@ -112,7 +112,7 @@ public class PropertiesBasedServiceImplT
ct.setExecutionContext(new ExecutionContextImpl());
ct.getExecutionContext().setNotificationService(
- new DummyNotification());
+ new LoggingNotification());
ct.setServiceName("SimpleEcho");