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:
Michael Bayne
2017-04-25 08:43:19 -07:00
parent 4855057b2a
commit 02975c107e
@@ -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);
}
}