Search in sources :

Example 11 with Version

use of org.fagu.version.Version in project fmv by f-agu.

the class MediaInfoProviderTestCase method testParse.

@Test
public void testParse() throws IOException {
    Parser parser = newParser();
    parser.readLine("MediaInfo Command line,");
    parser.readLine("MediaInfoLib - v18.03.1");
    assertInfo(parser, new Version(18, 3, 1));
}
Also used : Version(org.fagu.version.Version) Parser(org.fagu.fmv.soft.find.ExecSoftFoundFactory.Parser) Test(org.junit.Test)

Example 12 with Version

use of org.fagu.version.Version in project fmv by f-agu.

the class PdfInfoSoftProviderTestCase method testParseOnLinux_original.

/**
 * @throws IOException
 */
@Test
public void testParseOnLinux_original() throws IOException {
    Parser parser = newParser();
    parser.readLine("pdfinfo version 3.04");
    parser.readLine("Copyright 1996-2014 Glyph & Cog, LLC");
    assertInfo(parser, new Version(3, 4));
}
Also used : Version(org.fagu.version.Version) Parser(org.fagu.fmv.soft.find.ExecSoftFoundFactory.Parser) Test(org.junit.Test)

Example 13 with Version

use of org.fagu.version.Version in project fmv by f-agu.

the class PdfInfoSoftProviderTestCase method testParseOnWindows_original.

/**
 * @throws IOException
 */
@Test
public void testParseOnWindows_original() throws IOException {
    Parser parser = newParser();
    parser.readLine("pdfinfo version 3.04");
    parser.readLine("Copyright 1996-2014 Glyph & Cog, LLC");
    assertInfo(parser, new Version(3, 4));
}
Also used : Version(org.fagu.version.Version) Parser(org.fagu.fmv.soft.find.ExecSoftFoundFactory.Parser) Test(org.junit.Test)

Example 14 with Version

use of org.fagu.version.Version in project fmv by f-agu.

the class SoftTestCase method testGS.

@Test
@Ignore
public void testGS() throws Exception {
    GSSoftProvider gsSoftProvider = new GSSoftProvider();
    Soft soft = gsSoftProvider.searchConfigurable(ss -> {
        ss.withPolicy(new VersionSoftPolicy().onAllPlatforms(maxVersion(new Version(8))));
    });
    soft.getFounds().forEach(sf -> {
        System.out.println(sf.getFoundReason() + "  " + sf.getFile() + "  " + sf.getReason());
    });
    SoftLogger softLogger = new SoftLogger(Collections.singletonList(soft));
    softLogger.log(System.out::println);
// System.out.println(soft);
}
Also used : VersionSoftPolicy(org.fagu.fmv.soft.find.policy.VersionSoftPolicy) GSSoftProvider(org.fagu.fmv.soft.gs.GSSoftProvider) VersionSoftPolicy.maxVersion(org.fagu.fmv.soft.find.policy.VersionSoftPolicy.maxVersion) Version(org.fagu.version.Version) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 15 with Version

use of org.fagu.version.Version in project fmv by f-agu.

the class AutoRotate method isAutoRotateObsolete.

/**
 * @param soft
 * @return
 */
public static boolean isAutoRotateObsolete(Soft soft) {
    SoftFound softFound = soft.getFirstFound();
    FFInfo ffInfo = (FFInfo) softFound.getSoftInfo();
    // version
    Version version = ffInfo.getVersion();
    if (version != null) {
        return version.isUpperOrEqualsThan(new Version(2, 7));
    }
    // build number
    Integer builtVersion = ffInfo.getBuiltVersion();
    if (builtVersion != null) {
        return builtVersion.intValue() > 73010;
    }
    // build date
    Date builtDate = ffInfo.getBuiltDate();
    if (builtDate != null) {
        @SuppressWarnings("deprecation") Date minDate = new Date(2015 - 1900, 6 - 1, 12);
        return minDate.before(builtDate);
    }
    return false;
}
Also used : Version(org.fagu.version.Version) SoftFound(org.fagu.fmv.soft.find.SoftFound) FFInfo(org.fagu.fmv.ffmpeg.soft.FFInfo) Date(java.util.Date)

Aggregations

Version (org.fagu.version.Version)24 Test (org.junit.Test)16 Parser (org.fagu.fmv.soft.find.ExecSoftFoundFactory.Parser)15 Date (java.util.Date)3 SoftFound (org.fagu.fmv.soft.find.SoftFound)3 ArrayList (java.util.ArrayList)2 Matcher (java.util.regex.Matcher)2 SoftExecutor (org.fagu.fmv.soft.SoftExecutor)2 SoftInfo (org.fagu.fmv.soft.find.SoftInfo)2 SoftPolicy (org.fagu.fmv.soft.find.SoftPolicy)2 VersionSoftPolicy (org.fagu.fmv.soft.find.policy.VersionSoftPolicy)2 VersionSoftPolicy.minVersion (org.fagu.fmv.soft.find.policy.VersionSoftPolicy.minVersion)2 File (java.io.File)1 IOException (java.io.IOException)1 StandardCharsets (java.nio.charset.StandardCharsets)1 LocalDate (java.time.LocalDate)1 Arrays (java.util.Arrays)1 Calendar (java.util.Calendar)1 Collections (java.util.Collections)1 HashMap (java.util.HashMap)1