Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-10 HDFS Integration
  3. GEODE-319

HDFSConfigJUnitTest testHdfsStoreInvalidCompactionConf expected exception logic is incorrect

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.0.0-incubating
    • None
    • hdfs
    • None

    Description

      It's common to follow this pattern in JUnit 3.8:

      try {
        //do something that will throw expected exception
        fail("Expected exception was not thrown");
      } catch (ExpectedException e) {
        //passed because ExpectedException was thrown
      }
      

      However, the logic in testHdfsStoreInvalidCompactionConf is clearly goofed up. The test passes on Linux only because NO exception is being thrown but that should cause that this test to fail (according to javadocs). So at best it's a test that is not valid and should be deleted, or at worse it's hiding a real bug.

      /**
       * Validates that cache creation fails if a compaction configuration is
       * provided which is not applicable to the selected compaction strategy
       */
      public void testHdfsStoreInvalidCompactionConf() {
        String conf = createStoreConf("123");
        try {
          this.c.loadCacheXml(new ByteArrayInputStream(conf.getBytes()));
          // expected
        } catch (CacheXmlException e) {
          fail();
        }
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            klund Kirk Lund
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: