diff options
Diffstat (limited to 'controlloop/common/actors')
2 files changed, 14 insertions, 8 deletions
diff --git a/controlloop/common/actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/Test.java b/controlloop/common/actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/Test.java index f6eba49af..e526abd41 100644 --- a/controlloop/common/actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/Test.java +++ b/controlloop/common/actors/actor.test/src/test/java/org/onap/policy/controlloop/actor/test/Test.java @@ -24,23 +24,26 @@ import static org.junit.Assert.*; import org.onap.policy.controlloop.actorServiceProvider.ActorService; import org.onap.policy.controlloop.actorServiceProvider.spi.Actor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class Test { - + private static final Logger logger = LoggerFactory.getLogger(Test.class); + @org.junit.Test public void test() { - System.out.println("Dumping actors"); + logger.debug("Dumping actors"); ActorService actorService = ActorService.getInstance(); assertNotNull(actorService); int num = 0; for (Actor actor : actorService.actors()) { - System.out.println(actor.actor()); + logger.debug(actor.actor()); for (String recipe : actor.recipes()) { - System.out.println("\t" + recipe + " " + actor.recipeTargets(recipe) + " " + actor.recipePayloads(recipe)); + logger.debug("\t {} {} {}", recipe, actor.recipeTargets(recipe), actor.recipePayloads(recipe)); } num++; } - System.out.println("Found " + num + " actors"); + logger.debug("Found {} actors", num); } } diff --git a/controlloop/common/actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorServiceProvider/ActorService.java b/controlloop/common/actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorServiceProvider/ActorService.java index 2632d0752..330b1f97c 100644 --- a/controlloop/common/actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorServiceProvider/ActorService.java +++ b/controlloop/common/actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorServiceProvider/ActorService.java @@ -24,10 +24,13 @@ import java.util.Iterator; import java.util.ServiceLoader; import org.onap.policy.controlloop.actorServiceProvider.spi.Actor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.google.common.collect.ImmutableList; public class ActorService { - + + private static final Logger logger = LoggerFactory.getLogger(ActorService.class); private static ActorService service; private ServiceLoader<Actor> loader; @@ -45,9 +48,9 @@ public class ActorService { public ImmutableList<Actor> actors() { Iterator<Actor> iter = loader.iterator(); - System.out.println("returning actors"); + logger.debug("returning actors"); while (iter.hasNext()) { - System.out.println("Got " + iter.next().actor()); + logger.debug("Got {}", iter.next().actor()); } return ImmutableList.copyOf(loader.iterator()); |