Search in sources :

Example 6 with JavaVersion

use of org.sonar.plugins.java.api.JavaVersion in project sonar-java by SonarSource.

the class JavaVersionImplTest method java_8.

@Test
public void java_8() throws Exception {
    JavaVersion version = new JavaVersionImpl(8);
    assertThat(version.isJava7Compatible()).isTrue();
    assertThat(version.isJava8Compatible()).isTrue();
    assertThat(version.asInt()).isEqualTo(8);
}
Also used : JavaVersion(org.sonar.plugins.java.api.JavaVersion) Test(org.junit.Test)

Example 7 with JavaVersion

use of org.sonar.plugins.java.api.JavaVersion in project sonar-java by SonarSource.

the class JavaVersionImplTest method java_6.

@Test
public void java_6() throws Exception {
    JavaVersion version = new JavaVersionImpl(6);
    assertThat(version.isJava7Compatible()).isFalse();
    assertThat(version.isJava8Compatible()).isFalse();
    assertThat(version.asInt()).isEqualTo(6);
}
Also used : JavaVersion(org.sonar.plugins.java.api.JavaVersion) Test(org.junit.Test)

Example 8 with JavaVersion

use of org.sonar.plugins.java.api.JavaVersion in project sonar-java by SonarSource.

the class JavaVersionImplTest method java_7.

@Test
public void java_7() throws Exception {
    JavaVersion version = new JavaVersionImpl(7);
    assertThat(version.isJava7Compatible()).isTrue();
    assertThat(version.isJava8Compatible()).isFalse();
    assertThat(version.asInt()).isEqualTo(7);
}
Also used : JavaVersion(org.sonar.plugins.java.api.JavaVersion) Test(org.junit.Test)

Aggregations

JavaVersion (org.sonar.plugins.java.api.JavaVersion)8 Test (org.junit.Test)7