Search in sources :

Example 1 with LogForwardingService

use of org.ow2.proactive.scheduler.common.util.logforwarder.LogForwardingService in project scheduling by ow2-proactive.

the class RunningTaskRecoveryWithRecoveredNodeTestBase method startDedicatedScheduler.

@Before
public void startDedicatedScheduler() throws Exception {
    RMFactory.setOsJavaProperty();
    schedulerHelper = new SchedulerTHelper(false, new File(getSchedulerStartConfigurationURL().toURI()).getAbsolutePath(), new File(RM_CONFIGURATION_START.toURI()).getAbsolutePath(), null);
    logForwardingService = new LogForwardingService(SocketBasedForwardingProvider.class.getName());
    logForwardingService.initialize();
}
Also used : SchedulerTHelper(functionaltests.utils.SchedulerTHelper) LogForwardingService(org.ow2.proactive.scheduler.common.util.logforwarder.LogForwardingService) File(java.io.File) Before(org.junit.Before)

Example 2 with LogForwardingService

use of org.ow2.proactive.scheduler.common.util.logforwarder.LogForwardingService in project scheduling by ow2-proactive.

the class TestListenJobLogs method init.

@Before
public void init() throws Exception {
    logForwardingService = new LogForwardingService(SocketBasedForwardingProvider.class.getName());
    logForwardingService.initialize();
}
Also used : LogForwardingService(org.ow2.proactive.scheduler.common.util.logforwarder.LogForwardingService)

Example 3 with LogForwardingService

use of org.ow2.proactive.scheduler.common.util.logforwarder.LogForwardingService in project scheduling by ow2-proactive.

the class TestLoggers method logBasedOnProActive.

@Test
public void logBasedOnProActive() throws Throwable {
    LogForwardingService lfsPA = new LogForwardingService("org.ow2.proactive.scheduler.common.util.logforwarder.providers.ProActiveBasedForwardingProvider");
    lfsPA.initialize();
    JobId id1 = schedulerHelper.submitJob(new File(jobDescriptor.toURI()).getAbsolutePath());
    final AppenderTester test1 = new AppenderTester();
    lfsPA.addAppender(Log4JTaskLogs.JOB_LOGGER_PREFIX + id1, test1);
    schedulerHelper.getSchedulerInterface().listenJobLogs(id1, lfsPA.getAppenderProvider());
    schedulerHelper.waitForEventJobFinished(id1);
    await().until(logEventsReceived(test1));
    lfsPA.terminate();
}
Also used : LogForwardingService(org.ow2.proactive.scheduler.common.util.logforwarder.LogForwardingService) File(java.io.File) JobId(org.ow2.proactive.scheduler.common.job.JobId) Test(org.junit.Test)

Example 4 with LogForwardingService

use of org.ow2.proactive.scheduler.common.util.logforwarder.LogForwardingService in project scheduling by ow2-proactive.

the class TestLoggers method logBasedOnSocket.

@Test
public void logBasedOnSocket() throws Throwable {
    LogForwardingService lfsSocket = new LogForwardingService("org.ow2.proactive.scheduler.common.util.logforwarder.providers.SocketBasedForwardingProvider");
    lfsSocket.initialize();
    JobId id2 = schedulerHelper.submitJob(new File(jobDescriptor.toURI()).getAbsolutePath());
    AppenderTester test2 = new AppenderTester();
    lfsSocket.addAppender(Log4JTaskLogs.JOB_LOGGER_PREFIX + id2, test2);
    schedulerHelper.getSchedulerInterface().listenJobLogs(id2, lfsSocket.getAppenderProvider());
    schedulerHelper.waitForEventJobFinished(id2);
    await().until(logEventsReceived(test2));
    lfsSocket.terminate();
}
Also used : LogForwardingService(org.ow2.proactive.scheduler.common.util.logforwarder.LogForwardingService) File(java.io.File) JobId(org.ow2.proactive.scheduler.common.job.JobId) Test(org.junit.Test)

Aggregations

LogForwardingService (org.ow2.proactive.scheduler.common.util.logforwarder.LogForwardingService)4 File (java.io.File)3 Test (org.junit.Test)2 JobId (org.ow2.proactive.scheduler.common.job.JobId)2 SchedulerTHelper (functionaltests.utils.SchedulerTHelper)1 Before (org.junit.Before)1