Skip to content

Commit

Permalink
Merge pull request #1 from harvard-lts/dev
Browse files Browse the repository at this point in the history
merge with harvard 1.5.0 release
  • Loading branch information
pautri authored Jul 15, 2020
2 parents b7f5b55 + e8a2adc commit 95ca8cb
Show file tree
Hide file tree
Showing 19 changed files with 523 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
/javadoc/
/target/
/version.properties
/temp/
6 changes: 3 additions & 3 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.compiler.source=1.8
2 changes: 1 addition & 1 deletion .settings/org.eclipse.wst.common.project.facet.core.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="jst.utility" version="1.0"/>
<installed facet="java" version="1.7"/>
<installed facet="java" version="1.8"/>
</faceted-project>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FITS

System Requirements
-------------------
FITS is a Java program and requires Java version 1.7 or higher. To find out your Java version type java -version in a command-line window.
FITS is a Java program and requires Java version 1.8 or higher. To find out your Java version type java -version in a command-line window.

Building FITS
-------------
Expand Down
Binary file not shown.
9 changes: 0 additions & 9 deletions lib-local/com/twmacinta/fast-md5/1.0.0/fast-md5-1.0.0.pom

This file was deleted.

12 changes: 0 additions & 12 deletions lib-local/com/twmacinta/fast-md5/maven-metadata-local.xml

This file was deleted.

20 changes: 10 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>edu.harvard.huit.lts</groupId>
<artifactId>fits</artifactId>
<version>1.5.0-SNAPSHOT</version>
<version>1.5.0</version>
<packaging>jar</packaging>

<name>FITS</name>
Expand All @@ -13,8 +13,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.7</java.version>
<java.target>1.7</java.target>
<java.version>1.8</java.version>
<java.target>1.8</java.target>
<bcmail.version>132</bcmail.version>
<log4j.version>1.2.17</log4j.version>
<slf4j.version>1.7.22</slf4j.version>
Expand All @@ -32,11 +32,11 @@
<commons-cli.version>1.2</commons-cli.version>
<commons-configuration.version>1.8</commons-configuration.version>
<droid.version>6.4</droid.version>
<ots-schemas.version>1.0.51</ots-schemas.version>
<ots-schemas.version>1.0.53</ots-schemas.version>
<jhove.version>1.20.1</jhove.version>
<jna.version>4.1.0</jna.version>
<hclaps.version>2.1</hclaps.version>
<fast-md5.version>1.0.0</fast-md5.version>
<fast-md5.version>2.7.1</fast-md5.version>
<aes31.version>31.3</aes31.version>
<gson.version>2.4</gson.version>
<nzmetool.version>3.6GA</nzmetool.version>
Expand Down Expand Up @@ -249,6 +249,11 @@
<artifactId>Saxon-HE</artifactId>
<version>${saxon.version}</version>
</dependency>
<dependency>
<groupId>com.twmacinta</groupId>
<artifactId>fast-md5</artifactId>
<version>${fast-md5.version}</version>
</dependency>

<!-- Local dependencies -->
<dependency>
Expand All @@ -261,11 +266,6 @@
<artifactId>aes</artifactId>
<version>${aes31.version}</version>
</dependency>
<dependency>
<groupId>com.twmacinta</groupId>
<artifactId>fast-md5</artifactId>
<version>${fast-md5.version}</version>
</dependency>
<dependency>
<groupId>edu.harvard.hcl</groupId>
<artifactId>hclaps</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import edu.harvard.hul.ois.fits.tools.ToolOutput;

/**
* This uses the audio file parsing library hclaps.jar provided by Dave Ackerman
* This uses the audio file parsing library therockquarry.jar provided by Dave Ackerman
* @author spencer
*
*/
Expand Down Expand Up @@ -73,7 +73,7 @@ private Document createXml(File file) throws FitsToolException {
String adlCreatorVersion = null;

try {
//creating an ADL objecte should be enough to validate it as ADL
//creating an ADL object should be enough to validate it as ADL
new ADL(file);

Scanner scanner = new Scanner(new FileReader(file));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,17 @@
import edu.harvard.hul.ois.fits.tools.ToolBase;
import edu.harvard.hul.ois.fits.tools.ToolOutput;

/** The FileInfo tool uses Java system calls to get basic information about
* a file, as well as calculating an MD5 digest.
/**
* The FileInfo tool uses Java system calls to get basic information about
* a file, as well as calculating an MD5 digest.
*
* @see <a href="http://www.twmacinta.com/myjava/fast_md5.php">Fast MD5 Implementation in Java</a>
*/
public class FileInfo extends ToolBase {

private final static String TOOL_NAME = "OIS File Information";
private final static String TOOL_VERSION = "0.2";
private final static String TOOL_DATE = "12/13/2013";
private final static String TOOL_VERSION = "1.0";
private final static String TOOL_DATE = "8/14/2019";

private static Logger logger = Logger.getLogger(FileInfo.class);

Expand Down
62 changes: 62 additions & 0 deletions src/test/java/edu/harvard/hul/ois/fits/junit/ADLTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Copyright 2009 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.AbstractLoggingTest;


public class ADLTest extends AbstractLoggingTest {

/*
* 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 testADL() throws Exception {

String inputFilename = "T-350_036_Archival_Side_1.adl";
File input = new File("testfiles/" + inputFilename);
FitsOutput fitsOut = fits.examine(input);
fitsOut.addStandardCombinedFormat();
fitsOut.saveToDisk("test-generated-output/" + inputFilename + OUTPUT_FILE_SUFFIX);
}

}
76 changes: 76 additions & 0 deletions src/test/java/edu/harvard/hul/ois/fits/junit/ADLXmlUnitTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* Copyright 2009 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;


public class ADLXmlUnitTest 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 testADL() throws Exception {

String inputFilename = "T-350_036_Archival_Side_1.adl";
File input = new File("testfiles/" + inputFilename);
FitsOutput fitsOut = fits.examine(input);
fitsOut.addStandardCombinedFormat();
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);
}

}
Loading

0 comments on commit 95ca8cb

Please sign in to comment.