Uploaded image for project: 'OODT'
  1. OODT
  2. OODT-685 Fix OODT 0.7-SNAPSHOT Jenkins nightly build on Ubuntu
  3. OODT-723

Fix File Manager Unit Tests - 'validation' Package

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.7
    • Fix Version/s: 0.7
    • Component/s: file manager
    • Labels:
    • Skill Level:
      Don't Know (Unsure) - The default level

      Description

      This step fixes unit tests for the file manager's 'validation' package. This package has a single test class TestXMLValidationLayer and the changes are trivial (a couple of lines in the setUp() method):

      Before:

        protected void setUp() throws Exception {
          ...
          for (File f : new File("./src/testdata/vallayer")
            ...
        }
      

      After:

      import java.net.URL;
      ...
        protected void setUp() throws Exception {
          ...
            URL url = this.getClass().getResource("/vallayer");
            for (File f : new File(url.getFile())
            ...
        }
      

      This is a straightforward fix as there are no System.setProperty() calls in this test class.

      Test results before applying the patch:

      -------------------------------------------------------
       T E S T S
      -------------------------------------------------------
      Running org.apache.oodt.cas.filemgr.validation.TestXMLValidationLayer
      Tests run: 7, Failures: 0, Errors: 7, Skipped: 0, Time elapsed: 0.038 sec <<< FAILURE!
      
      Results :
      
      Tests in error: 
        testModifyElement(org.apache.oodt.cas.filemgr.validation.TestXMLValidationLayer)
        testGetElements(org.apache.oodt.cas.filemgr.validation.TestXMLValidationLayer)
        testReadProperDescriptionTrimImplicitTrue(org.apache.oodt.cas.filemgr.validation.TestXMLValidationLayer)
        testReadBadFormattedDescriptionTrimImplicitTrue(org.apache.oodt.cas.filemgr.validation.TestXMLValidationLayer)
        testReadDescriptionTrimExplicitFalse(org.apache.oodt.cas.filemgr.validation.TestXMLValidationLayer)
        testReadDescriptionTrimExplicitTrue(org.apache.oodt.cas.filemgr.validation.TestXMLValidationLayer)
        testGetElementsForProductType(org.apache.oodt.cas.filemgr.validation.TestXMLValidationLayer)
      
      Tests run: 7, Failures: 0, Errors: 7, Skipped: 0
      

      Test results after applying the patch:

      -------------------------------------------------------
       T E S T S
      -------------------------------------------------------
      Running org.apache.oodt.cas.filemgr.validation.TestXMLValidationLayer
      Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.234 sec
      
      Results :
      
      Tests run: 7, Failures: 0, Errors: 0, Skipped: 0
      

      The following command runs the test from the top level directory:

      mvn clean -Dtest=TestXMLValidationLayer -DfailIfNoTests=false test -pl filemgr -am
      

      The following command runs the test within the filemgr subdirectory:

      mvn clean -Dtest=TestXMLValidationLayer test
      

        Attachments

          Activity

            People

            • Assignee:
              rlaidlaw Ross Laidlaw
              Reporter:
              rlaidlaw Ross Laidlaw
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: