-
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 #185 from daveneiman/tika_bug
Fixes in Tika and JHOVE
- Loading branch information
Showing
15 changed files
with
1,999 additions
and
18 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
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
77 changes: 77 additions & 0 deletions
77
src/test/java/edu/harvard/hul/ois/fits/junit/service/AdobeIllustratorXmlUnitServiceTest.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,77 @@ | ||
/* | ||
* 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.service; | ||
|
||
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.Ignore; | ||
import org.junit.Test; | ||
|
||
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. | ||
* NOTE: This is an integration test that requires a running web application with the | ||
* FITS Service running. | ||
* | ||
* @author dan179 | ||
*/ | ||
@Ignore | ||
public class AdobeIllustratorXmlUnitServiceTest extends AbstractXmlUnitTest { | ||
|
||
@BeforeClass | ||
public static void initializeHttpClient() throws Exception { | ||
AbstractXmlUnitTest.beforeServiceTest(); | ||
} | ||
|
||
@AfterClass | ||
public static void afterClass() throws Exception { | ||
AbstractXmlUnitTest.afterServiceTest(); | ||
} | ||
|
||
@Test | ||
public void testAdobeIllustratorFile() throws Exception { | ||
|
||
String inputFilename = "MMS-82A.08.12.02.ai"; | ||
File input = new File("testfiles/" + inputFilename); | ||
|
||
FitsOutput fitsOut = super.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); | ||
} | ||
|
||
} |
Oops, something went wrong.