private void assertParse(String verStr, int legacyMajor, int major, int revision, int update) { Version ver = new Version(verStr); assertThat("Version [" + verStr + "].legacyMajor", ver.getLegacyMajor(), is(legacyMajor)); assertThat("Version [" + verStr + "].major", ver.getMajor(), is(major)); assertThat("Version [" + verStr + "].revision", ver.getRevision(), is(revision)); assertThat("Version [" + verStr + "].update", ver.getUpdate(), is(update)); assertThat("Version [" + verStr + "].toString", ver.toString(), is(verStr)); }
private void testJdkParsing( final int major, final int minor, final int patch, final int update, final int build, final String input) { final Version version = Version.parseJavaRuntimeVersion(input); Assert.assertEquals(major, version.getMajor()); Assert.assertEquals(minor, version.getMinor()); Assert.assertEquals(patch, version.getPatch()); Assert.assertEquals(update, version.getUpdate()); Assert.assertEquals(build, version.getBuild()); }