-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #153 from daveneiman/assorted_release_fixes
Tweak DROID and NLNZ ME transformations.
- Loading branch information
Showing
19 changed files
with
2,540 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
testfiles/output/MMS-82A.08.12.02.ai_XmlUnitExpectedOutput.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<fits xmlns="http://hul.harvard.edu/ois/xml/ns/fits/fits_output" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hul.harvard.edu/ois/xml/ns/fits/fits_output http://hul.harvard.edu/ois/xml/xsd/fits/fits_output.xsd" version="1.2.0" timestamp="8/9/17 3:16 PM"> | ||
<identification> | ||
<identity format="Adobe Illustrator" mimetype="application/postscript" toolname="FITS" toolversion="1.2.0"> | ||
<tool toolname="Droid" toolversion="6.3" /> | ||
<tool toolname="Exiftool" toolversion="10.00" /> | ||
<version toolname="Droid" toolversion="6.3">9.0</version> | ||
<externalIdentifier toolname="Droid" toolversion="6.3" type="puid">fmt/558</externalIdentifier> | ||
</identity> | ||
</identification> | ||
<fileinfo> | ||
<size toolname="Jhove" toolversion="1.16">561633</size> | ||
<creatingApplicationName toolname="Jhove" toolversion="1.16">Adobe PDF library 4.800/Adobe Illustrator 9.0</creatingApplicationName> | ||
<created toolname="Exiftool" toolversion="10.00" status="SINGLE_RESULT">2002:08:10 18:43:47</created> | ||
<filepath toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">/Users/dan179/git/git-daveneiman/fits/testfiles/MMS-82A.08.12.02.ai</filepath> | ||
<filename toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">MMS-82A.08.12.02.ai</filename> | ||
<md5checksum toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">b09e1524642c0166da3566d4c7e03871</md5checksum> | ||
<fslastmodified toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">1502306011000</fslastmodified> | ||
</fileinfo> | ||
<filestatus /> | ||
<metadata> | ||
<image> | ||
<imageWidth toolname="Exiftool" toolversion="10.00" status="SINGLE_RESULT">315</imageWidth> | ||
<imageHeight toolname="Exiftool" toolversion="10.00" status="SINGLE_RESULT">704</imageHeight> | ||
</image> | ||
</metadata> | ||
<statistics fitsExecutionTime="1716"> | ||
<tool toolname="MediaInfo" toolversion="0.7.75" status="did not run" /> | ||
<tool toolname="OIS Audio Information" toolversion="0.1" status="did not run" /> | ||
<tool toolname="ADL Tool" toolversion="0.1" status="did not run" /> | ||
<tool toolname="VTT Tool" toolversion="0.1" status="did not run" /> | ||
<tool toolname="Droid" toolversion="6.3" executionTime="146" /> | ||
<tool toolname="Jhove" toolversion="1.16" executionTime="665" /> | ||
<tool toolname="file utility" toolversion="5.04" executionTime="557" /> | ||
<tool toolname="Exiftool" toolversion="10.00" executionTime="624" /> | ||
<tool toolname="NLNZ Metadata Extractor" toolversion="3.6GA" status="did not run" /> | ||
<tool toolname="OIS File Information" toolversion="0.2" executionTime="141" /> | ||
<tool toolname="OIS XML Metadata" toolversion="0.2" status="did not run" /> | ||
<tool toolname="ffident" toolversion="0.2" executionTime="487" /> | ||
<tool toolname="Tika" toolversion="1.10" executionTime="1664" /> | ||
</statistics> | ||
</fits> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
tests/edu/harvard/hul/ois/fits/junit/AdobeIllustratorXmlTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright 2016 Harvard University Library | ||
* | ||
* This file is part of FITS (File Information Tool Set). | ||
* | ||
* FITS is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* FITS is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with FITS. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package edu.harvard.hul.ois.fits.junit; | ||
|
||
import java.io.File; | ||
|
||
import org.junit.AfterClass; | ||
import org.junit.BeforeClass; | ||
import org.junit.Test; | ||
|
||
import edu.harvard.hul.ois.fits.Fits; | ||
import edu.harvard.hul.ois.fits.FitsOutput; | ||
import edu.harvard.hul.ois.fits.tests.AbstractXmlUnitTest; | ||
|
||
/** | ||
* These generated FITS output with tool output on the given Adobe Illustrator files. | ||
* These tests should be run with <display-tool-output>false</display-tool-output> in fits.xml. | ||
* | ||
* @author dan179 | ||
*/ | ||
public class AdobeIllustratorXmlTest extends AbstractXmlUnitTest { | ||
|
||
/* | ||
* Only one Fits instance is needed to run all tests. | ||
* This also speeds up the tests. | ||
*/ | ||
private static Fits fits; | ||
|
||
@BeforeClass | ||
public static void beforeClass() throws Exception { | ||
// Set up FITS for entire class. | ||
File fitsConfigFile = new File("testfiles/properties/fits-full-with-tool-output.xml"); | ||
fits = new Fits(null, fitsConfigFile); | ||
} | ||
|
||
@AfterClass | ||
public static void afterClass() { | ||
fits = null; | ||
} | ||
|
||
@Test | ||
public void testtestAdobeIllustratorFile() throws Exception { | ||
|
||
String inputFilename = "MMS-82A.08.12.02.ai"; | ||
File input = new File("testfiles/" + inputFilename); | ||
FitsOutput fitsOut = fits.examine(input); | ||
fitsOut.addStandardCombinedFormat(); | ||
fitsOut.saveToDisk("test-generated-output/" + inputFilename + "_Output.xml"); | ||
} | ||
|
||
} |
79 changes: 79 additions & 0 deletions
79
tests/edu/harvard/hul/ois/fits/junit/AdobeIllustratorXmlUnitTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
* Copyright 2016 Harvard University Library | ||
* | ||
* This file is part of FITS (File Information Tool Set). | ||
* | ||
* FITS is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* FITS is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with FITS. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package edu.harvard.hul.ois.fits.junit; | ||
|
||
import java.io.File; | ||
import java.util.Scanner; | ||
|
||
import org.jdom.output.Format; | ||
import org.jdom.output.XMLOutputter; | ||
import org.junit.AfterClass; | ||
import org.junit.BeforeClass; | ||
import org.junit.Test; | ||
|
||
import edu.harvard.hul.ois.fits.Fits; | ||
import edu.harvard.hul.ois.fits.FitsOutput; | ||
import edu.harvard.hul.ois.fits.tests.AbstractXmlUnitTest; | ||
|
||
/** | ||
* These tests compare actual FITS output with expected output on Adobe Illustrator files. | ||
* | ||
* @author dan179 | ||
*/ | ||
public class AdobeIllustratorXmlUnitTest extends AbstractXmlUnitTest { | ||
|
||
/* | ||
* Only one Fits instance is needed to run all tests. | ||
* This also speeds up the tests. | ||
*/ | ||
private static Fits fits; | ||
|
||
@BeforeClass | ||
public static void beforeClass() throws Exception { | ||
// Set up FITS for entire class. | ||
fits = new Fits(); | ||
} | ||
|
||
@AfterClass | ||
public static void afterClass() { | ||
fits = null; | ||
} | ||
|
||
@Test | ||
public void testAdobeIllustratorFile() throws Exception { | ||
|
||
String inputFilename = "MMS-82A.08.12.02.ai"; | ||
File input = new File("testfiles/" + inputFilename); | ||
FitsOutput fitsOut = fits.examine(input); | ||
fitsOut.saveToDisk("test-generated-output/" + inputFilename + ACTUAL_OUTPUT_FILE_SUFFIX); | ||
|
||
XMLOutputter serializer = new XMLOutputter(Format.getPrettyFormat()); | ||
String actualXmlStr = serializer.outputString(fitsOut.getFitsXml()); | ||
|
||
// Read in the expected XML file | ||
Scanner scan = new Scanner(new File( | ||
"testfiles/output/" + inputFilename + EXPECTED_OUTPUT_FILE_SUFFIX)); | ||
String expectedXmlStr = scan. | ||
useDelimiter("\\Z").next(); | ||
scan.close(); | ||
|
||
testActualAgainstExpected(actualXmlStr, expectedXmlStr, inputFilename); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters