Class FileReaderTest


  • public class FileReaderTest
    extends java.lang.Object
    Unit tests for FileReader.
    • Field Detail

      • CITIES_SOURCE

        private static final org.apache.calcite.util.Source CITIES_SOURCE
      • STATES_SOURCE

        private static final org.apache.calcite.util.Source STATES_SOURCE
    • Constructor Detail

      • FileReaderTest

        public FileReaderTest()
    • Method Detail

      • file

        public static java.lang.String file​(java.lang.String s)
        Converts a path that is relative to the module into a path that is relative to where the test is running.
      • resourcePath

        private static java.lang.String resourcePath​(java.lang.String path)
                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • testFileReaderUrlNoPath

        public void testFileReaderUrlNoPath()
                                     throws org.apache.calcite.adapter.file.FileReaderException
        Tests FileReader URL instantiation - no path.
        Throws:
        org.apache.calcite.adapter.file.FileReaderException
      • testFileReaderUrlWithPath

        public void testFileReaderUrlWithPath()
                                       throws org.apache.calcite.adapter.file.FileReaderException
        Tests FileReader URL instantiation - with path.
        Throws:
        org.apache.calcite.adapter.file.FileReaderException
      • testFileReaderUrlFetch

        public void testFileReaderUrlFetch()
                                    throws org.apache.calcite.adapter.file.FileReaderException
        Tests FileReader URL fetch.
        Throws:
        org.apache.calcite.adapter.file.FileReaderException
      • testFileReaderMalUrl

        public void testFileReaderMalUrl()
                                  throws org.apache.calcite.adapter.file.FileReaderException
        Tests failed FileReader instantiation - malformed URL.
        Throws:
        org.apache.calcite.adapter.file.FileReaderException
      • testFileReaderBadUrl

        public void testFileReaderBadUrl()
                                  throws org.apache.calcite.adapter.file.FileReaderException
        Tests failed FileReader instantiation - bad URL.
        Throws:
        org.apache.calcite.adapter.file.FileReaderException
      • testFileReaderBadSelector

        public void testFileReaderBadSelector()
                                       throws org.apache.calcite.adapter.file.FileReaderException
        Tests failed FileReader instantiation - bad selector.
        Throws:
        org.apache.calcite.adapter.file.FileReaderException
      • testFileReaderHeadings

        public void testFileReaderHeadings()
                                    throws org.apache.calcite.adapter.file.FileReaderException
        Test FileReader with static file - headings.
        Throws:
        org.apache.calcite.adapter.file.FileReaderException
      • testFileReaderData

        public void testFileReaderData()
                                throws org.apache.calcite.adapter.file.FileReaderException
        Test FileReader with static file - data.
        Throws:
        org.apache.calcite.adapter.file.FileReaderException
      • testFileReaderHeadingsBadFile

        public void testFileReaderHeadingsBadFile()
                                           throws org.apache.calcite.adapter.file.FileReaderException
        Tests FileReader with bad static file - headings.
        Throws:
        org.apache.calcite.adapter.file.FileReaderException
      • testFileReaderDataBadFile

        public void testFileReaderDataBadFile()
                                       throws org.apache.calcite.adapter.file.FileReaderException
        Tests FileReader with bad static file - data.
        Throws:
        org.apache.calcite.adapter.file.FileReaderException
      • testFileReaderDataNoTh

        public void testFileReaderDataNoTh()
                                    throws org.apache.calcite.adapter.file.FileReaderException
        Tests FileReader with no headings static file - data.
        Throws:
        org.apache.calcite.adapter.file.FileReaderException
      • testFileReaderIterator

        public void testFileReaderIterator()
                                    throws org.apache.calcite.adapter.file.FileReaderException
        Tests FileReader iterator with static file,
        Throws:
        org.apache.calcite.adapter.file.FileReaderException
      • testCsvFile

        public void testCsvFile()
                         throws java.lang.Exception
        Tests reading a CSV file via the file adapter. Based on the test case for [CALCITE-1952] NPE in planner.
        Throws:
        java.lang.Exception
      • testJsonFile

        public void testJsonFile()
                          throws java.lang.Exception
        Tests reading a JSON file via the file adapter.
        Throws:
        java.lang.Exception
      • testJsonFileWithJoin

        public void testJsonFileWithJoin()
                                  throws java.lang.Exception
        Tests reading two JSON file with join via the file adapter.
        Throws:
        java.lang.Exception