#502 Introduced logging in new example

This commit is contained in:
daniel-bryla
2016-11-04 12:19:32 +01:00
parent 0a427710bb
commit b37190a214
5 changed files with 64 additions and 50 deletions

View File

@ -16,10 +16,12 @@
*/
package com.iluwatar.event.asynchronous;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.junit.Assert.assertTrue;
/**
*
@ -29,6 +31,8 @@ import org.junit.Test;
public class EventAsynchronousTest {
App app;
private static final Logger LOGGER = LoggerFactory.getLogger(EventAsynchronousTest.class);
@Before
public void setUp() {
app = new App();
@ -46,7 +50,7 @@ public class EventAsynchronousTest {
eventManager.cancel(aEventId);
assertTrue(eventManager.getEventPool().size() == 0);
} catch (MaxNumOfEventsAllowedException | LongRunningEventException | EventDoesNotExistException e) {
System.out.println(e.getMessage());
LOGGER.error(e.getMessage());
}
}
@ -63,7 +67,7 @@ public class EventAsynchronousTest {
assertTrue(eventManager.getEventPool().size() == 0);
} catch (MaxNumOfEventsAllowedException | LongRunningEventException | EventDoesNotExistException
| InvalidOperationException e) {
System.out.println(e.getMessage());
LOGGER.error(e.getMessage());
}
}
@ -76,7 +80,7 @@ public class EventAsynchronousTest {
sEventId = eventManager.create(60);
eventManager.start(sEventId);
} catch (MaxNumOfEventsAllowedException | LongRunningEventException | EventDoesNotExistException e) {
System.out.println(e.getMessage());
LOGGER.error(e.getMessage());
}
}
@ -101,7 +105,7 @@ public class EventAsynchronousTest {
} catch (MaxNumOfEventsAllowedException | LongRunningEventException | EventDoesNotExistException
| InvalidOperationException e) {
System.out.println(e.getMessage());
LOGGER.error(e.getMessage());
}
}
@ -129,7 +133,7 @@ public class EventAsynchronousTest {
assertTrue(eventManager.getEventPool().size() == 0);
} catch (MaxNumOfEventsAllowedException | LongRunningEventException | EventDoesNotExistException e) {
System.out.println(e.getMessage());
LOGGER.error(e.getMessage());
}
}
}