forked from scala/scala-collection-compat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set a different jdk went running forked test (fix scala#77)
- Loading branch information
1 parent
a4f7b08
commit 0375d56
Showing
4 changed files
with
48 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
compat/src/test/scala/test/scala/collection/JdkVersionTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package test.scala.collection | ||
|
||
import org.junit.Assert._ | ||
import org.junit.Test | ||
|
||
class JdkVersionTest { | ||
|
||
@Test | ||
def testJavaVersion: Unit = { | ||
val isOnCi = sys.env.get("CI").isDefined | ||
|
||
if (isOnCi) { | ||
val travisJdkVersion = sys.env("TRAVIS_JDK_VERSION") | ||
val jdkVersion = sys.props("java.specification.version") | ||
|
||
if (travisJdkVersion == "openjdk6") { | ||
assertEquals(jdkVersion, "1.6") | ||
} else if (travisJdkVersion == "oraclejdk8") { | ||
assertEquals(jdkVersion, "1.8") | ||
} else { | ||
throw new Exception(s"Unknown CI jdk version: $travisJdkVersion") | ||
} | ||
} | ||
} | ||
} |