Class ExampleTestUtil

  • public final class ExampleTestUtil
    extends java.lang.Object
    Test Utils for Examples.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void deleteOutputFile​(java.lang.String directory, java.lang.String outputFileName)
      Delete output files.
      static void ensureALSOutputValidity​(java.lang.String resourcePath, java.lang.String outputFileName, java.lang.String testResourceFileName)
      This method test the output validity of AlternatingLeastSquareITCase.
      static void ensureOutputValidity​(java.lang.String resourcePath, java.lang.String outputFileName, java.lang.String testResourceFileName)
      Ensures output correctness with the given test resource file.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • ensureOutputValidity

        public static void ensureOutputValidity​(java.lang.String resourcePath,
                                                java.lang.String outputFileName,
                                                java.lang.String testResourceFileName)
        Ensures output correctness with the given test resource file.
        resourcePath - root folder for both resources.
        outputFileName - output file name.
        testResourceFileName - the test result file name.
        Throws: - if the output is invalid.
      • ensureALSOutputValidity

        public static void ensureALSOutputValidity​(java.lang.String resourcePath,
                                                   java.lang.String outputFileName,
                                                   java.lang.String testResourceFileName)
        This method test the output validity of AlternatingLeastSquareITCase. Due to the floating point math error, the output of the test can be different every time. Thus we cannot compare plain text output, but have to check its numeric error.
        resourcePath - path to resources.
        outputFileName - name of output file.
        testResourceFileName - name of the file to compare the outputs to.
        java.lang.RuntimeException - if the output is invalid. - exception.
      • deleteOutputFile

        public static void deleteOutputFile​(java.lang.String directory,
                                            java.lang.String outputFileName)
        Delete output files.
        directory - the path of file directory.
        outputFileName - the output file prefix.
        Throws: - if fail to delete.