eu.planets_project.services.utils.test
Enum TestFile

java.lang.Object
  extended by java.lang.Enum<TestFile>
      extended by eu.planets_project.services.utils.test.TestFile
All Implemented Interfaces:
Serializable, Comparable<TestFile>

public enum TestFile
extends Enum<TestFile>

Enum containing files to test i.e. identification with. Each entry contains the file location and the expected results. In the tests, we iterate over all files, identify the file at the location and compare the received results with the expected ones

Author:
Fabian Steeg (fabian.steeg@uni-koeln.de)

Enum Constant Summary
AIFF
           
ARJ
           
BMP
           
GIF
           
HTML
           
JP2
           
JPG
           
PCX
           
PDF
           
PNG
           
PNM
           
RAW
           
RTF
           
TGA
           
TIF
           
TXT
           
WAV
           
XML
           
ZIP
           
 
Method Summary
 String getLocation()
           
 Set<URI> getTypes()
           
static boolean testIdentification(Identify identify)
           
static boolean testIdentification(TestFile f, Identify identify)
           
static boolean testValidation(TestFile f, Validate validate)
           
static boolean testValidation(Validate validate)
           
static TestFile valueOf(String name)
          Returns the enum constant of this type with the specified name.
static TestFile[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

BMP

public static final TestFile BMP

RTF

public static final TestFile RTF

XML

public static final TestFile XML

ZIP

public static final TestFile ZIP

PDF

public static final TestFile PDF

GIF

public static final TestFile GIF

JPG

public static final TestFile JPG

TIF

public static final TestFile TIF

PCX

public static final TestFile PCX

JP2

public static final TestFile JP2

RAW

public static final TestFile RAW

TGA

public static final TestFile TGA

PNM

public static final TestFile PNM

PNG

public static final TestFile PNG

ARJ

public static final TestFile ARJ

AIFF

public static final TestFile AIFF

WAV

public static final TestFile WAV

HTML

public static final TestFile HTML

TXT

public static final TestFile TXT
Method Detail

values

public static TestFile[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (TestFile c : TestFile.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static TestFile valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getLocation

public String getLocation()
Returns:
the location of the test file

getTypes

public Set<URI> getTypes()
Returns:
the expected pronom IDs for the file

testIdentification

public static boolean testIdentification(TestFile f,
                                         Identify identify)
Parameters:
f - The test file enum element for the file type to test
identify - The Identify implementation to use for testing identification of the given file type
Returns:
True, if identification was successful

testIdentification

public static boolean testIdentification(Identify identify)
Parameters:
identify - The identify implementation to test with all test files
Returns:
True, if identification was successful

testValidation

public static boolean testValidation(TestFile f,
                                     Validate validate)
Parameters:
f - The test file to validate
validate - The Validate implementation instance to test
Returns:
True, if validation was successful

testValidation

public static boolean testValidation(Validate validate)
Parameters:
validate - The Validate implementation to test with all test files
Returns:
True, if validation was successful


Copyright © 2013 Open Planets Foundation. All Rights Reserved.