/**
   * Tests the supported reads and/or writes.
   *
   * <p>Using Compare result mode, the results generator and query write is not used
   *
   * @throws Exception
   */
  @Test
  public void testCoreSupport() throws Exception {
    System.setProperty("result.mode", "compare");

    //  the following 3 properties are what's normally found in the scenario.properties file
    System.setProperty("queryset.dirname", "test_query_set");
    System.setProperty("test.queries.dirname", "test_queries");
    System.setProperty("expected.results.dirname", "expected_results");

    //
    System.setProperty("project.data.path", UnitTestUtil.getTestDataPath());

    System.setProperty("output.dir", UnitTestUtil.getTestOutputPath() + File.separator + "sqltest");

    System.setProperty(
        ConfigPropertyNames.CONFIG_FILE,
        UnitTestUtil.getTestDataPath() + File.separator + "localconfig.properties");

    ConfigPropertyLoader _instance = ConfigPropertyLoader.getInstance();
    Properties p = _instance.getProperties();
    if (p == null || p.isEmpty()) {
      throw new RuntimeException("Failed to load config properties file");
    }

    QueryScenario set = QueryScenario.createInstance("testscenario", p);

    assertTrue(set instanceof Compare);

    assertTrue(set.getQuerySetIDs().size() == 1);

    assertTrue(set.getQueryReader().getQueries("test_queries1").size() == 2);

    assertTrue(set.getQueryWriter() == null);

    Collection<String> setIDs = set.getQuerySetIDs();
    assertTrue(setIDs.size() == 1);
    for (String id : setIDs) {
      assertTrue(set.getQueries(id).size() == 2);
    }

    QueryTest qt = new QueryTest(set.getQueryScenarioIdentifier(), "test_queries1", "Query1", null);
    TestResult testResult = new TestResult(qt.getQuerySetID(), qt.getQueryID());

    TestCase testcase = new TestCase(qt);
    testcase.setTestResult(testResult);

    List readers = set.getExpectedResultsReaders(testcase);
    assertNotNull(readers);
    assertEquals(1, readers.size());

    assertNotNull(set.getFileType());
    assertNotNull(set.getQueryReader());

    assertEquals(1, set.getQuerySetIDs().size());

    assertTrue(set.isCompare());

    testResult.setResultMode(set.getResultsMode());
    testResult.setStatus(TestResult.RESULT_STATE.TEST_SUCCESS);
  }
  /**
   * Should throw an exception when the expectd results folder is empty or not found
   *
   * @throws Exception
   */
  @Test(expected = FrameworkRuntimeException.class)
  public void testEmptyExpectedResultsFolder() throws Exception {
    System.setProperty("result.mode", "compare");

    //  the following 3 properties are what's normally found in the scenario.properties file
    System.setProperty("queryset.dirname", "empty_query_set");
    System.setProperty("test.queries.dirname", "test_queries");
    System.setProperty("expected.results.dirname", "expected_results");

    //
    System.setProperty("project.data.path", UnitTestUtil.getTestDataPath());

    System.setProperty("output.dir", UnitTestUtil.getTestOutputPath() + File.separator + "sqltest");

    System.setProperty(
        ConfigPropertyNames.CONFIG_FILE,
        UnitTestUtil.getTestDataPath() + File.separator + "localconfig.properties");

    ConfigPropertyLoader _instance = ConfigPropertyLoader.getInstance();
    Properties p = _instance.getProperties();
    if (p == null || p.isEmpty()) {
      throw new RuntimeException("Failed to load config properties file");
    }

    QueryScenario set = QueryScenario.createInstance("testscenario", p);
    assertNotNull(set.getFileType());

    QueryTest qt = new QueryTest(set.getQueryScenarioIdentifier(), "test_queries1", "Query1", null);

    TestCase testcase = new TestCase(qt);

    set.getExpectedResultsReaders(testcase);
  }
  @Before
  public void setUp() throws Exception {

    ConfigPropertyLoader.reset();
  }