Class ArchiveFactoryTest

java.lang.Object
org.gbif.dwca.io.ArchiveFactoryTest

public class ArchiveFactoryTest extends Object
  • Constructor Details

  • Method Details

    • testMetaHandlerUtf16le

      @Test public void testMetaHandlerUtf16le() throws Exception
      Throws:
      Exception
    • testCoreRecords

      @Test public void testCoreRecords() throws IOException
      Throws:
      IOException
    • testCsv

      @Test public void testCsv() throws org.gbif.dwc.UnsupportedArchiveException, IOException
      Test dwca-reader bug 83
      Throws:
      org.gbif.dwc.UnsupportedArchiveException
      IOException
      See Also:
    • testGnubTab

      @Test public void testGnubTab() throws org.gbif.dwc.UnsupportedArchiveException, IOException
      Test GNUB style dwca with a single tab delimited file that has a .tab suffix.
      Throws:
      org.gbif.dwc.UnsupportedArchiveException
      IOException
    • testGnubTabZip

      @Test public void testGnubTabZip() throws org.gbif.dwc.UnsupportedArchiveException, IOException
      Test GNUB style dwca with a single tab delimited file that has a .tab suffix.
      Throws:
      org.gbif.dwc.UnsupportedArchiveException
      IOException
    • testCsvOptionalQuotes

      @Test public void testCsvOptionalQuotes() throws org.gbif.dwc.UnsupportedArchiveException, IOException
      Testing CSV with optional quotes
      Throws:
      org.gbif.dwc.UnsupportedArchiveException
      IOException
    • testIssue2158

      @Test public void testIssue2158() throws org.gbif.dwc.UnsupportedArchiveException, IOException
      Test IPT bug 2158
      Throws:
      org.gbif.dwc.UnsupportedArchiveException
      IOException
      See Also:
    • testExtensionNPE

      @Test public void testExtensionNPE() throws org.gbif.dwc.UnsupportedArchiveException, IOException
      The pensoft archive http://pensoft.net/dwc/bdj/checklist_980.zip contains empty extension files which caused NPE in the dwca reader.
      Throws:
      org.gbif.dwc.UnsupportedArchiveException
      IOException
    • testStarIteratorExtRecords

      @Test public void testStarIteratorExtRecords() throws Exception
      Test extension sorting verifying that all core records do have the right number of extension records attached when using the star record iterator.
      Throws:
      Exception
    • testIssue78

      @Test public void testIssue78() throws IOException, org.gbif.dwc.UnsupportedArchiveException
      Identifier not set properly when reading single csv file the csv file attached is a utf16 little endian encoded file. This encoding is known to cause problems and not supported. If you look at the detected concept terms you will find that there is NO concept at all detected because of the wrong character encoding used (the factory tries it with utf8).
      Throws:
      IOException
      org.gbif.dwc.UnsupportedArchiveException
      See Also:
    • testOpenArchive

      @Test public void testOpenArchive() throws IOException, org.gbif.dwc.UnsupportedArchiveException
      Throws:
      IOException
      org.gbif.dwc.UnsupportedArchiveException
    • testOpenSmallArchiveWithEmptyLines

      @Test public void testOpenSmallArchiveWithEmptyLines() throws IOException, org.gbif.dwc.UnsupportedArchiveException
      Throws:
      IOException
      org.gbif.dwc.UnsupportedArchiveException
    • testQuotedHeaders

      @Test public void testQuotedHeaders() throws IOException, org.gbif.dwc.UnsupportedArchiveException
      Test bug 77.
      Throws:
      IOException
      org.gbif.dwc.UnsupportedArchiveException
      See Also:
    • testTab

      @Test public void testTab() throws org.gbif.dwc.UnsupportedArchiveException, IOException
      Throws:
      org.gbif.dwc.UnsupportedArchiveException
      IOException
    • testSimpleDWCA

      @Test public void testSimpleDWCA() throws org.gbif.dwc.UnsupportedArchiveException, IOException
      Test reading a single-file Simple Darwin Core Archive.
      Throws:
      org.gbif.dwc.UnsupportedArchiveException
      IOException
    • testTabEol

      @Test public void testTabEol() throws org.gbif.dwc.UnsupportedArchiveException, IOException
      Throws:
      org.gbif.dwc.UnsupportedArchiveException
      IOException
    • testCsvJsonEscapedQuotes

      @Test public void testCsvJsonEscapedQuotes() throws org.gbif.dwc.UnsupportedArchiveException, IOException
      Test extracting a CSV file containing embedded JSON, which itself contains escaped quotes. JSON value: { "test": "value, \"like\" this" } As a column in CSV: "{ ""test"": ""value, \""like\"" this"" }"
      Throws:
      org.gbif.dwc.UnsupportedArchiveException
      IOException
    • testNullCoreID

      @Test public void testNullCoreID() throws IOException
      Ensure that extensions are just skipped for archives that do not have the core id in the mapped extension. https://code.google.com/p/darwincore/issues/detail?id=232
      Throws:
      IOException
    • testOpenArchiveForEventCore

      @Test public void testOpenArchiveForEventCore() throws IOException, org.gbif.dwc.UnsupportedArchiveException
      Test opening a single data file with both eventID column, meaning it has dwc:Event rowType.
      Throws:
      IOException
      org.gbif.dwc.UnsupportedArchiveException
    • testOpenArchiveForGenericCore

      @Test public void testOpenArchiveForGenericCore() throws IOException, org.gbif.dwc.UnsupportedArchiveException
      Test opening a single data file with a generic ID column and an eventID column meaning the Archive's ID-term gets set to (DwcTerm.eventID and its rowType gets set to DwcTerm.Event.
      Throws:
      IOException
      org.gbif.dwc.UnsupportedArchiveException
    • testFallbackToDefaultsArchives

      @Test public void testFallbackToDefaultsArchives() throws IOException
      Basic validation of archives, where we rely on falling back to defaults from the DWC-A metadata schema.
      Throws:
      IOException
    • testInvalidArchives

      @Test public void testInvalidArchives()
      Basic validation of archives, that the declared files exist and have basic, valid structure.