Search in sources :

Example 6 with Version

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

the class IMInfoTestCase method testParseOnWindows.

/**
 * @throws IOException
 */
@Test
public void testParseOnWindows() throws IOException {
    Parser parser = newParser();
    parser.readLine("Version: ImageMagick 6.8.7-1 2013-10-17 Q16 http://www.imagemagick.org");
    parser.readLine("Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC");
    parser.readLine("Features: DPC OpenMP");
    parser.readLine("Delegates: bzlib freetype jbig jng jp2 jpeg lcms lqr png ps png tiff webp x xml zlib");
    assertInfo(parser, new Version(6, 8, 7, 1), d(2013, 10, 17), "6.8.7.1");
}
Also used : Version(org.fagu.version.Version) Parser(org.fagu.fmv.soft.find.ExecSoftFoundFactory.Parser) Test(org.junit.Test)

Example 7 with Version

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

the class IMSoftProvider method createSoftExecutor.

/**
 * @see org.fagu.fmv.soft.find.SoftProvider#createSoftExecutor(org.fagu.fmv.soft.Soft, java.io.File, java.util.List)
 */
@Override
public SoftExecutor createSoftExecutor(Soft soft, File execFile, List<String> parameters) {
    if (SOFT_MAGICK_NAME.equalsIgnoreCase(FilenameUtils.getBaseName(soft.getFile().getName()))) {
        SoftInfo softInfo = soft.getFirstInfo();
        if (softInfo instanceof VersionSoftInfo) {
            VersionSoftInfo versionSoftInfo = (VersionSoftInfo) softInfo;
            Optional<Version> version = versionSoftInfo.getVersion();
            if (version.isPresent() && version.get().isUpperOrEqualsThan(V7)) {
                List<String> newParams = new ArrayList<>(parameters);
                newParams.add(0, getName());
                return new SoftExecutor(this, execFile, newParams);
            }
        }
    }
    return super.createSoftExecutor(soft, execFile, parameters);
}
Also used : VersionSoftInfo(org.fagu.fmv.soft.find.info.VersionSoftInfo) SoftInfo(org.fagu.fmv.soft.find.SoftInfo) VersionSoftInfo(org.fagu.fmv.soft.find.info.VersionSoftInfo) VersionSoftPolicy.minVersion(org.fagu.fmv.soft.find.policy.VersionSoftPolicy.minVersion) Version(org.fagu.version.Version) ArrayList(java.util.ArrayList) SoftExecutor(org.fagu.fmv.soft.SoftExecutor)

Example 8 with Version

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

the class GSSoftProviderTestCase method testParseOnWindows.

/**
 * @throws IOException
 */
@Test
public void testParseOnWindows() throws IOException {
    Parser parser = newParser();
    parser.readLine("GPL Ghostscript 9.16 (2015-03-30)");
    parser.readLine("Copyright (C) 2015 Artifex Software, Inc.  All rights reserved.");
    assertInfo(parser, new Version(9, 16), d(2015, 03, 30));
}
Also used : Version(org.fagu.version.Version) Parser(org.fagu.fmv.soft.find.ExecSoftFoundFactory.Parser) Test(org.junit.Test)

Example 9 with Version

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

the class GSSoftProviderTestCase method testParseOnMac.

/**
 * @throws IOException
 */
@Test
public void testParseOnMac() throws IOException {
    Parser parser = newParser();
    parser.readLine("GPL Ghostscript 9.18 (2015-10-05)");
    parser.readLine("Copyright (C) 2015 Artifex Software, Inc.  All rights reserved.");
    assertInfo(parser, new Version(9, 18), d(2015, 10, 05));
}
Also used : Version(org.fagu.version.Version) Parser(org.fagu.fmv.soft.find.ExecSoftFoundFactory.Parser) Test(org.junit.Test)

Example 10 with Version

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

the class JavaSoftProviderTestCase method testParse18OnWindows.

/**
 * @throws IOException
 */
@Test
public void testParse18OnWindows() throws IOException {
    Parser parser = newParser();
    parser.readLine("java version \"1.8.0_20\"");
    parser.readLine("Java(TM) SE Runtime Environment (build 1.8.0_20-b26)");
    parser.readLine("Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)");
    assertInfo(parser, new Version(1, 8, 0, 20));
}
Also used : Version(org.fagu.version.Version) Parser(org.fagu.fmv.soft.find.ExecSoftFoundFactory.Parser) Test(org.junit.Test)

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