mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Nicolas Capponi
02.39.2013 19df65dd04f8f3bd8f76bdf3e061a6d242ed3c69
opendj3/opendj-ldap-sdk/src/test/java/org/forgerock/opendj/ldap/SdkTestCase.java
@@ -28,9 +28,14 @@
import static org.fest.assertions.Fail.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.forgerock.testng.ForgeRockTestCase;
import org.testng.annotations.Test;
import com.forgerock.opendj.util.StaticUtils;
/**
 * An abstract class that all types unit tests should extend. A type represents
 * the classes found directly under the package org.forgerock.opendj.ldap.
@@ -46,4 +51,19 @@
    void failWasExpected(Class<? extends Throwable> exceptionClass) {
        fail("should throw an exception " + exceptionClass.getSimpleName());
    }
    /**
     * Dynamically change log level using java.util.logging framework.
     * <p>
     * slf4j ERROR maps to java.util.logging SEVERE
     * slf4j INFO maps to java.util.logging INFO
     * slf4j DEBUG maps to java.util.logging FINE
     * slf4j TRACE maps to java.util.logging FINEST
     *
     * @param level logging level to use
     */
    void setDefaultLogLevel(Level level) {
        Logger.getLogger(StaticUtils.DEFAULT_LOG.getName()).setLevel(level);
    }
}