Version { static String[] parseVersionString(String version) { String splitRegex = "\\."; String[] split = version.split(splitRegex); if (split.length == 0) { throw new LicenseVersionException(LicenseVersionException.VERSION_STRING_IS_EMPTY_AND_CANNOT_BE_PARSED); } String major = split[0]; String minor = "0"; if (split.length > 1) { minor = split[1].substring(0); } if (!isVersionNumeric(major)) { throw new LicenseVersionException(LicenseVersionException.MAJOR_VERSION_IS_NOT_NUMERIC); } if (!isVersionNumeric(minor)) { throw new LicenseVersionException(LicenseVersionException.MINOR_VERSION_IS_NOT_NUMERIC); } return new String[] {major, minor}; } @Deprecated  Version();   Version(VersionInfo info, boolean expired); static Version getInstance(); static boolean isAGPLVersion(); static boolean isExpired(); String getProduct(); String getRelease(); String getVersion(); String getKey(); VersionInfo getInfo();  }
@Test public void parseVersionIncorrectMajorTest() { junitExpectedException.expect(LicenseVersionException.class); junitExpectedException.expectMessage(LicenseVersionException.MAJOR_VERSION_IS_NOT_NUMERIC); String[] parseResults = Version.parseVersionString("a.9.11"); }
@Test public void parseVersionIncorrectMinorTest() { junitExpectedException.expect(LicenseVersionException.class); junitExpectedException.expectMessage(LicenseVersionException.MINOR_VERSION_IS_NOT_NUMERIC); Version.parseVersionString("1.a.11"); }