Replace SysPropsTest with VersionUtilTest.
As pointed out by soapyfrog, depending on info from the JVM running the test is fragile and not a good idea. Fixes #84.
This commit is contained in:
+7
-7
@@ -3,27 +3,27 @@
|
||||
// Copyright (C) 2004-2016 Getdown authors
|
||||
// https://github.com/threerings/getdown/blob/master/LICENSE
|
||||
|
||||
package com.threerings.getdown.data;
|
||||
package com.threerings.getdown.util;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class SysPropsTest
|
||||
{
|
||||
public class VersionUtilTest {
|
||||
|
||||
@Test
|
||||
public void shouldParseJavaVersion ()
|
||||
{
|
||||
long version = SysProps.parseJavaVersion(
|
||||
"java.version", "(\\d+)\\.(\\d+)\\.(\\d+)(_\\d+)?");
|
||||
long version = VersionUtil.parseJavaVersion(
|
||||
"(\\d+)\\.(\\d+)\\.(\\d+)(_\\d+)?", "1.8.0_152");
|
||||
assertTrue(version > 1060000);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldParseJavaRuntimeVersion ()
|
||||
{
|
||||
long version = SysProps.parseJavaVersion(
|
||||
"java.runtime.version", "(\\d+)\\.(\\d+)\\.(\\d+)(_\\d+)?(-b\\d+)?");
|
||||
long version = VersionUtil.parseJavaVersion(
|
||||
"(\\d+)\\.(\\d+)\\.(\\d+)(_\\d+)?(-b\\d+)?", "1.8.0_131-b11");
|
||||
assertTrue(version > 106000000);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user