@Test public void testNexusLogOnly() { TaskLogger taskLogger = TaskLoggerFactory.create(new NexusLogOnly(), mock(Logger.class), mock(TaskLogInfo.class)); assertThat(taskLogger, instanceOf(ProgressTaskLogger.class)); }
public static TaskLogger create(final Object taskObject, final Logger log, final TaskLogInfo taskLogInfo) { TaskLogging taskLogging = taskObject.getClass().getAnnotation(TaskLogging.class); if (taskLogging == null) { taskLogging = TaskLoggingDefault.class.getAnnotation(TaskLogging.class); } switch (taskLogging.value()) { case NEXUS_LOG_ONLY: return new ProgressTaskLogger(log); case TASK_LOG_ONLY: return new TaskLogOnlyTaskLogger(log, taskLogInfo); case TASK_LOG_ONLY_WITH_PROGRESS: return new TaskLogWithProgressLogger(log, taskLogInfo); case BOTH: default: return new SeparateTaskLogTaskLogger(log, taskLogInfo); } }
TaskLoggerFactory { public static TaskLogger create(final Object taskObject, final Logger log, final TaskLogInfo taskLogInfo) { TaskLogging taskLogging = taskObject.getClass().getAnnotation(TaskLogging.class); if (taskLogging == null) { taskLogging = TaskLoggingDefault.class.getAnnotation(TaskLogging.class); } switch (taskLogging.value()) { case NEXUS_LOG_ONLY: return new ProgressTaskLogger(log); case TASK_LOG_ONLY: return new TaskLogOnlyTaskLogger(log, taskLogInfo); case TASK_LOG_ONLY_WITH_PROGRESS: return new TaskLogWithProgressLogger(log, taskLogInfo); case BOTH: default: return new SeparateTaskLogTaskLogger(log, taskLogInfo); } } }
TaskLoggerFactory { public static TaskLogger create(final Object taskObject, final Logger log, final TaskLogInfo taskLogInfo) { TaskLogging taskLogging = taskObject.getClass().getAnnotation(TaskLogging.class); if (taskLogging == null) { taskLogging = TaskLoggingDefault.class.getAnnotation(TaskLogging.class); } switch (taskLogging.value()) { case NEXUS_LOG_ONLY: return new ProgressTaskLogger(log); case TASK_LOG_ONLY: return new TaskLogOnlyTaskLogger(log, taskLogInfo); case TASK_LOG_ONLY_WITH_PROGRESS: return new TaskLogWithProgressLogger(log, taskLogInfo); case BOTH: default: return new SeparateTaskLogTaskLogger(log, taskLogInfo); } } private  TaskLoggerFactory(); }
TaskLoggerFactory { public static TaskLogger create(final Object taskObject, final Logger log, final TaskLogInfo taskLogInfo) { TaskLogging taskLogging = taskObject.getClass().getAnnotation(TaskLogging.class); if (taskLogging == null) { taskLogging = TaskLoggingDefault.class.getAnnotation(TaskLogging.class); } switch (taskLogging.value()) { case NEXUS_LOG_ONLY: return new ProgressTaskLogger(log); case TASK_LOG_ONLY: return new TaskLogOnlyTaskLogger(log, taskLogInfo); case TASK_LOG_ONLY_WITH_PROGRESS: return new TaskLogWithProgressLogger(log, taskLogInfo); case BOTH: default: return new SeparateTaskLogTaskLogger(log, taskLogInfo); } } private  TaskLoggerFactory(); static TaskLogger create(final Object taskObject, final Logger log, final TaskLogInfo taskLogInfo); }
TaskLoggerFactory { public static TaskLogger create(final Object taskObject, final Logger log, final TaskLogInfo taskLogInfo) { TaskLogging taskLogging = taskObject.getClass().getAnnotation(TaskLogging.class); if (taskLogging == null) { taskLogging = TaskLoggingDefault.class.getAnnotation(TaskLogging.class); } switch (taskLogging.value()) { case NEXUS_LOG_ONLY: return new ProgressTaskLogger(log); case TASK_LOG_ONLY: return new TaskLogOnlyTaskLogger(log, taskLogInfo); case TASK_LOG_ONLY_WITH_PROGRESS: return new TaskLogWithProgressLogger(log, taskLogInfo); case BOTH: default: return new SeparateTaskLogTaskLogger(log, taskLogInfo); } } private  TaskLoggerFactory(); static TaskLogger create(final Object taskObject, final Logger log, final TaskLogInfo taskLogInfo);  }