View Javadoc

    1   package org.slf4j.impl;
    2
    3   import static org.junit.Assert.*;
    4
    5   import org.junit.Ignore;
    6   import org.junit.Test;
    7
    8   public class UtilVersionTest {
    9
    10  	@Test
    11  	public void test() {
    12  		System.out.println(System.getProperty("java.version"));
    13  		assertEquals(6, VersionUtil.getJavaMajorVersion("1.6"));
    14  		assertEquals(7, VersionUtil.getJavaMajorVersion("1.7.0_21-b11"));
    15  		assertEquals(8, VersionUtil.getJavaMajorVersion("1.8.0_25"));
    16  	}
    17
    18  	@Ignore
    19  	@Test  // requires Java 9 to pass
    20  	public void testJava9() {
    21  		assertEquals(9, VersionUtil.getJavaMajorVersion("9ea"));
    22  	}
    23
    24  }