Skip to content

Commit

Permalink
omgoing work
Browse files Browse the repository at this point in the history
  • Loading branch information
ceki committed May 10, 2013
1 parent 0b238a4 commit 3683b82
Showing 1 changed file with 7 additions and 5 deletions.
Expand Up @@ -32,6 +32,7 @@
import javax.net.SocketFactory;

import ch.qos.logback.core.status.InfoStatus;
import ch.qos.logback.core.status.StatusChecker;
import ch.qos.logback.core.util.Duration;
import ch.qos.logback.core.util.StatusPrinter;
import org.junit.After;
Expand Down Expand Up @@ -65,6 +66,7 @@ public class SocketReceiverTest {
private Logger logger;
int port;

StatusChecker statusChecker = new StatusChecker(receiversLoggerContext);
private InstrumentedSocketReceiver receiver = new InstrumentedSocketReceiver();

@Before
Expand Down Expand Up @@ -114,10 +116,10 @@ public void testStartUnknownHost() throws Exception {
receiver.setPort(port);
receiver.setRemoteHost(TEST_HOST_NAME);
receiver.start();
assertFalse(receiver.isStarted());
int count = receiversLoggerContext.getStatusManager().getCount();
Status status = receiversLoggerContext.getStatusManager().getCopyOfStatusList().get(count - 1);
assertTrue(status.getMessage().contains("unknown host"));
waitForActiveCountToEqual((ThreadPoolExecutor) receiversLoggerContext.getExecutorService(), 1);
// invalid host name does not impact start status
assertTrue(receiver.isStarted());
statusChecker.assertContainsMatch(Status.ERROR, "unknown host");
}

@Test()
Expand Down Expand Up @@ -160,7 +162,7 @@ void addInfo(String msg) {
receiversLoggerContext.getStatusManager().add(new InfoStatus(msg, this));
}

@Test(timeout = 500 * 1000)
@Test(timeout = 5000)
public void testDispatchEventForEnabledLevel() throws Exception {
receiver.setRemoteHost(InetAddress.getLocalHost().getHostName());
receiver.setReconnectionDelay(new Duration(10));
Expand Down

0 comments on commit 3683b82

Please sign in to comment.