use of org.fagu.version.Version in project fmv by f-agu.
the class PdfInfoSoftProviderTestCase method testParseOnLinux_popplers.
/**
* @throws IOException
*/
@Test
public void testParseOnLinux_popplers() throws IOException {
Parser parser = newParser();
parser.readLine("pdfinfo version 0.12.4");
parser.readLine("Copyright 2005-2009 The Poppler Developers - http://poppler.freedesktop.org");
parser.readLine("Copyright 1996-2004 Glyph & Cog, LLC");
assertInfo(parser, new Version(0, 12, 4));
}
use of org.fagu.version.Version in project fmv by f-agu.
the class VersionSoftPolicy method byProperties.
/**
* @param versionSoftInfo
* @return
*/
private SoftFound byProperties(VersionSoftInfo versionSoftInfo) {
Optional<String> propertyMinVersion = getProperty(versionSoftInfo, "minversion");
if (propertyMinVersion.isPresent()) {
Version minVersion = Version.parse(propertyMinVersion.get());
SoftPolicy onAllPlatforms = new VersionSoftPolicy().onAllPlatforms(minVersion(minVersion));
return ((VersionSoftPolicy) onAllPlatforms).byDefined(versionSoftInfo);
}
return null;
}
use of org.fagu.version.Version in project fmv by f-agu.
the class JavaSoftProviderTestCase method testParse18OnLinux.
/**
* @throws IOException
*/
@Test
public void testParse18OnLinux() throws IOException {
Parser parser = newParser();
parser.readLine("openjdk version \"1.8.0_45\"");
parser.readLine("OpenJDK Runtime Environment (build 1.8.0_45-b13)");
parser.readLine("OpenJDK 64-Bit Server VM (build 25.45-b02, mixed mode)");
assertInfo(parser, new Version(1, 8, 0, 45));
}
use of org.fagu.version.Version in project fmv by f-agu.
the class PdfSoftProvider method getDefaultSoftPolicy.
// ***********************************************************************
/**
* @return
*/
private static SoftPolicy getDefaultSoftPolicy() {
Version v012 = new Version(0, 12);
BiPredicate<SoftInfo, Provider> isProvider = (s, p) -> s instanceof XPdfVersionSoftInfo && ((XPdfVersionSoftInfo) s).getProvider() == p;
return new VersionSoftPolicy().on("xpdf", s -> isProvider.test(s, Provider.XPDF), minVersion(Version.V3)).on("poppler", s -> isProvider.test(s, Provider.POPPLER), minVersion(v012)).onAllPlatforms(minVersion(v012));
}
use of org.fagu.version.Version in project fmv by f-agu.
the class FFSoftProvider method addLibVersions.
/**
* @param map
* @param matcher
*/
static void addLibVersions(Map<String, Version> map, Matcher matcher) {
String sver = matcher.group(2).replaceAll(" ", "");
try {
Version version = VersionParserManager.parse(sver);
map.put(matcher.group(1), version);
} catch (VersionParseException e) {
// ignore
}
}
Aggregations