Search in sources :

Example 6 with UncheckedException

use of jodd.exception.UncheckedException in project jodd by oblac.

the class DbBaseTest method init.

protected void init() {
    LoggerFactory.setLoggerFactory(new NOPLoggerFactory() {

        @Override
        public Logger getLogger(String name) {
            return new NOPLogger("") {

                @Override
                public boolean isWarnEnabled() {
                    return true;
                }

                @Override
                public void warn(String message) {
                    throw new UncheckedException("NO WARNINGS ALLOWED: " + message);
                }

                @Override
                public void warn(String message, Throwable throwable) {
                    throw new UncheckedException("NO WARNINGS ALLOWED: " + message);
                }
            };
        }
    });
    DbOomManager.resetAll();
    dboom = DbOomManager.getInstance();
    connectionPool = new CoreConnectionPool();
}
Also used : UncheckedException(jodd.exception.UncheckedException) NOPLoggerFactory(jodd.log.impl.NOPLoggerFactory) NOPLogger(jodd.log.impl.NOPLogger) NOPLogger(jodd.log.impl.NOPLogger) Logger(jodd.log.Logger) CoreConnectionPool(jodd.db.pool.CoreConnectionPool)

Example 7 with UncheckedException

use of jodd.exception.UncheckedException in project jodd by oblac.

the class MadvocSuiteBase method startTomcat.

/**
	 * Starts Tomcat.
	 */
protected static void startTomcat(String webXmlFileName) {
    if (server != null) {
        return;
    }
    server = new TomcatTestServer(webXmlFileName);
    try {
        server.start();
        System.out.println("Tomcat test server started");
    } catch (Exception e) {
        throw new UncheckedException(e);
    }
}
Also used : UncheckedException(jodd.exception.UncheckedException) UncheckedException(jodd.exception.UncheckedException)

Aggregations

UncheckedException (jodd.exception.UncheckedException)7 Field (java.lang.reflect.Field)1 CoreConnectionPool (jodd.db.pool.CoreConnectionPool)1 WorkSession (jodd.jtx.data.WorkSession)1 Logger (jodd.log.Logger)1 NOPLogger (jodd.log.impl.NOPLogger)1 NOPLoggerFactory (jodd.log.impl.NOPLoggerFactory)1 Test (org.junit.Test)1