package com.epam.ta.reportportal.entity.enums;

import org.junit.Assert;
import org.junit.Test;

/**
 * @author <a href="mailto:ivan_budayeu@epam.com">Ivan Budayeu</a>
 */
public class LogLevelTest {

	public static final int FATAL_INT = 55000;
	public static final int ERROR_INT = 45000;
	public static final int WARN_INT = 35000;
	public static final int INFO_INT = 25000;
	public static final int DEBUG_INT = 15000;
	public static final int TRACE_INT = 7500;

	@Test
	public void testFatal() {

		Assert.assertEquals(FATAL_INT, LogLevel.toCustomLogLevel(String.valueOf(FATAL_INT)));
		Assert.assertEquals(LogLevel.FATAL_INT, LogLevel.toCustomLogLevel("FATAL"));
		Assert.assertEquals(LogLevel.FATAL, LogLevel.toLevel(FATAL_INT));
	}

	@Test
	public void testError() {

		Assert.assertEquals(ERROR_INT, LogLevel.toCustomLogLevel(String.valueOf(ERROR_INT)));
		Assert.assertEquals(LogLevel.ERROR_INT, LogLevel.toCustomLogLevel("ERROR"));
		Assert.assertEquals(LogLevel.ERROR, LogLevel.toLevel(ERROR_INT));
	}

	@Test
	public void testWarn() {

		Assert.assertEquals(WARN_INT, LogLevel.toCustomLogLevel(String.valueOf(WARN_INT)));
		Assert.assertEquals(LogLevel.WARN_INT, LogLevel.toCustomLogLevel("WARN"));
		Assert.assertEquals(LogLevel.WARN, LogLevel.toLevel(WARN_INT));
	}

	@Test
	public void testInfo() {

		Assert.assertEquals(INFO_INT, LogLevel.toCustomLogLevel(String.valueOf(INFO_INT)));
		Assert.assertEquals(LogLevel.INFO_INT, LogLevel.toCustomLogLevel("INFO"));
		Assert.assertEquals(LogLevel.INFO, LogLevel.toLevel(INFO_INT));
	}

	@Test
	public void testDebug() {

		Assert.assertEquals(DEBUG_INT, LogLevel.toCustomLogLevel(String.valueOf(DEBUG_INT)));
		Assert.assertEquals(LogLevel.DEBUG_INT, LogLevel.toCustomLogLevel("DEBUG"));
		Assert.assertEquals(LogLevel.DEBUG, LogLevel.toLevel(DEBUG_INT));
	}

	@Test
	public void testTrace() {

		Assert.assertEquals(TRACE_INT, LogLevel.toCustomLogLevel(String.valueOf(TRACE_INT)));
		Assert.assertEquals(LogLevel.TRACE_INT, LogLevel.toCustomLogLevel("TRACE"));
		Assert.assertEquals(LogLevel.TRACE, LogLevel.toLevel(TRACE_INT));
	}
}
@@ -1,8 +1,605 @@
+/*%0A * Copyright (C) 2018 EPAM Systems%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0A
 package 

add missed copyright