X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fconfig-persister-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fpersist%2Fimpl%2Fosgi%2FTestingExceptionHandler.java;h=c8140973eb9d7ee0c890cbba77ffaa6b8c689327;hb=e316a0ef36279a72767703d190f38a39d7d49395;hp=6fb231d847f2c5ae8c2022a7951460e19199ff70;hpb=d5759c52d69ba8725d9bbdc18e81848f319861d1;p=controller.git diff --git a/opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/osgi/TestingExceptionHandler.java b/opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/osgi/TestingExceptionHandler.java index 6fb231d847..c8140973eb 100644 --- a/opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/osgi/TestingExceptionHandler.java +++ b/opendaylight/netconf/config-persister-impl/src/test/java/org/opendaylight/controller/netconf/persist/impl/osgi/TestingExceptionHandler.java @@ -7,20 +7,25 @@ */ package org.opendaylight.controller.netconf.persist.impl.osgi; -import org.junit.matchers.JUnitMatchers; - +import static org.hamcrest.CoreMatchers.containsString; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + final class TestingExceptionHandler implements Thread.UncaughtExceptionHandler { + private static final Logger logger = LoggerFactory.getLogger(ConfigPersisterTest.class); + private Throwable t; @Override public void uncaughtException(Thread t, Throwable e) { + logger.debug("Uncaught exception in thread {}", t, e); this.t = e; } @@ -44,7 +49,7 @@ final class TestingExceptionHandler implements Thread.UncaughtExceptionHandler { private void assertException(Throwable t, Class exType, String exMessageToContain) { assertEquals("Expected exception of type " + exType + " but was " + t, exType, t.getClass()); if(exMessageToContain!=null) { - assertThat(t.getMessage(), JUnitMatchers.containsString(exMessageToContain)); + assertThat(t.getMessage(), containsString(exMessageToContain)); } }