Search in sources :

Example 21 with SoftFound

use of org.fagu.fmv.soft.find.SoftFound in project fmv by f-agu.

the class MediaInfoProviderTestCase method assertInfo.

/**
 * @param parser
 * @param expectedVersion
 * @throws IOException
 */
private void assertInfo(Parser parser, Version expectedVersion) throws IOException {
    SoftFound softFound = parser.closeAndParse("", 0);
    VersionSoftInfo softInfo = (VersionSoftInfo) softFound.getSoftInfo();
    assertEquals(expectedVersion, softInfo.getVersion().orElse(null));
}
Also used : VersionSoftInfo(org.fagu.fmv.soft.find.info.VersionSoftInfo) SoftFound(org.fagu.fmv.soft.find.SoftFound)

Example 22 with SoftFound

use of org.fagu.fmv.soft.find.SoftFound in project fmv by f-agu.

the class FFInfoTestCase method assertFull.

/**
 * @param parser
 * @param version
 * @param builtDate
 * @param builtVersion
 * @throws IOException
 * @throws ParseException
 */
private void assertFull(Parser parser, Version version, Date builtDate, Integer builtVersion) throws IOException, ParseException {
    SoftFound softFound = parser.closeAndParse("", 0);
    FFInfo ffInfo = (FFInfo) softFound.getSoftInfo();
    if (version == null) {
        assertNull(ffInfo.getVersion());
    } else {
        assertTrue(Objects.equals(version, ffInfo.getVersion()));
    }
    if (builtVersion == null) {
        assertNull(ffInfo.getBuiltVersion());
    } else {
        assertTrue(Objects.equals(builtVersion, ffInfo.getBuiltVersion()));
    }
    if (builtDate == null) {
        assertNull(ffInfo.getBuiltDate());
    } else {
        assertNotNull(ffInfo.getBuiltDate());
        assertEquals(builtDate.getTime() / 1000, ffInfo.getBuiltDate().getTime() / 1000);
    }
}
Also used : SoftFound(org.fagu.fmv.soft.find.SoftFound)

Aggregations

SoftFound (org.fagu.fmv.soft.find.SoftFound)22 Test (org.junit.Test)8 VersionSoftInfo (org.fagu.fmv.soft.find.info.VersionSoftInfo)5 Soft (org.fagu.fmv.soft.Soft)4 IOException (java.io.IOException)3 Date (java.util.Date)3 Founds (org.fagu.fmv.soft.find.Founds)3 VersionDateSoftInfo (org.fagu.fmv.soft.find.info.VersionDateSoftInfo)3 Ignore (org.junit.Ignore)3 HashMap (java.util.HashMap)2 StringJoiner (java.util.StringJoiner)2 Parser (org.fagu.fmv.soft.find.ExecSoftFoundFactory.Parser)2 SoftProvider (org.fagu.fmv.soft.find.SoftProvider)2 Version (org.fagu.version.Version)2 FileNotFoundException (java.io.FileNotFoundException)1 Path (java.nio.file.Path)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Arrays (java.util.Arrays)1 LinkedHashSet (java.util.LinkedHashSet)1 Map (java.util.Map)1