Source code

    001package org.slf4j.impl;
    002
    003import static org.junit.Assert.*;
    004
    005import org.junit.Ignore;
    006import org.junit.Test;
    007
    008public class UtilVersionTest {
    009
    010        @Test
    011        public void test() {
    012                System.out.println(System.getProperty("java.version"));
    013                assertEquals(6, VersionUtil.getJavaMajorVersion("1.6"));
    014                assertEquals(7, VersionUtil.getJavaMajorVersion("1.7.0_21-b11"));
    015                assertEquals(8, VersionUtil.getJavaMajorVersion("1.8.0_25"));
    016        }
    017
    018        @Ignore
    019        @Test  // requires Java 9 to pass
    020        public void testJava9() {
    021                assertEquals(9, VersionUtil.getJavaMajorVersion("9ea"));
    022        }
    023
    024}