package de.cronn.proxy.ssh;

import static org.junit.Assert.*;

import org.junit.Test;

import com.jcraft.jsch.Logger;

public class JSchSlf4JLoggerTest {

	@Test
	public void testIsEnabled() throws Exception {
		JSchSlf4JLogger logger = new JSchSlf4JLogger();

		assertFalse(logger.isEnabled(Logger.DEBUG));
		assertFalse(logger.isEnabled(Logger.INFO));
		assertTrue(logger.isEnabled(Logger.WARN));
		assertTrue(logger.isEnabled(Logger.ERROR));
		assertTrue(logger.isEnabled(Logger.FATAL));
	}

	@Test
	public void testLog() throws Exception {
		JSchSlf4JLogger logger = new JSchSlf4JLogger();

		logger.log(Logger.DEBUG, "some debug message");
		logger.log(Logger.INFO, "some info message");
		logger.log(Logger.WARN, "some warning message");
		logger.log(Logger.ERROR, "some error message");
		logger.log(Logger.FATAL, "some fatal message");
	}

}
@@ -484,16 +484,201 @@
 FATAL));
+%0A%0A%09%09try %7B%0A%09%09%09logger.isEnabled(100);%0A%09%09%09fail(%22IllegalArgumentException expected%22);%0A%09%09%7D catch (IllegalArgumentException e) %7B%0A%09%09%09assertEquals(%22Unknown log level: 100%22, e.getMessage());%0A%09%09%7D
 %0A%09%7D%0A%0A%09@T
@@ -1023,13 +1023,209 @@
 sage%22);%0A
+%0A%09%09try %7B%0A%09%09%09logger.log(100, %22some message%22);%0A%09%09%09fail(%22IllegalArgumentException expected%22);%0A%09%09%7D catch (IllegalArgumentException e) %7B%0A%09%09%09assertEquals(%22Unknown log level: 100%22, e.getMessage());%0A%09%09%7D%0A%0A
 %09%7D%0A%0A%7D

improve JSchSlf4JLoggerTest