Class TestCasePropertiesBase


  • public class TestCasePropertiesBase
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.Optional<java.lang.String> description
      Description of this test case (for display in student's grade report)
      java.util.Optional<java.lang.String> expected
      A string containing expected output when the program under evaluation is run.
      java.util.Optional<java.lang.String> failIf
      If this tag is active, then this case should fail, unrun, with score of zero.
      java.util.Optional<java.util.List<OracleProperties>> grading
      The grading criteria for this test case.
      java.util.Optional<java.lang.String> kind
      A tag name used to determine when (if ever) a test case should be performed.
      java.util.Optional<java.lang.String> launch
      The command string used to launch the program under evaluation.
      java.util.Optional<java.lang.Boolean> multiplier
      Is this test a multiplier for the overall score?
      java.util.Optional<java.util.List<java.lang.String>> onFail
      What tags should be activated if this case fails (score < 100)
      java.util.Optional<java.util.List<java.lang.String>> onSuccess
      What tags should be activated if this case succeeds (score == 100)
      java.util.Optional<java.lang.String> params
      The command line parameters to be supplies when executing the program under evaluation.
      java.util.Optional<java.lang.Boolean> status
      Should the status code be checked for evidence that a program has crashed? Defaults to false because students aren't likely to be all that careful about returning status codes.
      java.util.Optional<java.lang.Boolean> stderr
      Should the standard error stream be captures and included in the program output being evaluated?
      java.util.OptionalInt timelimit
      How many seconds to allow a test execution to run before concluding that the program is hanging, caught in an infinite loop, or simply unacceptably slow.
      java.util.OptionalInt weight
      How many points this test case is worth?
    • Constructor Summary

      Constructors 
      Constructor Description
      TestCasePropertiesBase()
      Create an empty properties set.
      TestCasePropertiesBase​(java.nio.file.Path testCaseDirectory)
      Load property values that are stored in explicit files, e.g., file anything.params can contain values for the "params" property.
    • Field Detail

      • kind

        public java.util.Optional<java.lang.String> kind
        A tag name used to determine when (if ever) a test case should be performed. Default is "test". A test suite begins by activating all cases of kind "build".
      • params

        public java.util.Optional<java.lang.String> params
        The command line parameters to be supplies when executing the program under evaluation.
      • weight

        public java.util.OptionalInt weight
        How many points this test case is worth?
      • multiplier

        public java.util.Optional<java.lang.Boolean> multiplier
        Is this test a multiplier for the overall score?
      • launch

        public java.util.Optional<java.lang.String> launch
        The command string used to launch the program under evaluation.
      • expected

        public java.util.Optional<java.lang.String> expected
        A string containing expected output when the program under evaluation is run.
      • timelimit

        public java.util.OptionalInt timelimit
        How many seconds to allow a test execution to run before concluding that the program is hanging, caught in an infinite loop, or simply unacceptably slow.
      • stderr

        public java.util.Optional<java.lang.Boolean> stderr
        Should the standard error stream be captures and included in the program output being evaluated?
      • status

        public java.util.Optional<java.lang.Boolean> status
        Should the status code be checked for evidence that a program has crashed? Defaults to false because students aren't likely to be all that careful about returning status codes.
      • grading

        public java.util.Optional<java.util.List<OracleProperties>> grading
        The grading criteria for this test case.
      • description

        public java.util.Optional<java.lang.String> description
        Description of this test case (for display in student's grade report)
      • onFail

        public java.util.Optional<java.util.List<java.lang.String>> onFail
        What tags should be activated if this case fails (score < 100)
      • onSuccess

        public java.util.Optional<java.util.List<java.lang.String>> onSuccess
        What tags should be activated if this case succeeds (score == 100)
      • failIf

        public java.util.Optional<java.lang.String> failIf
        If this tag is active, then this case should fail, unrun, with score of zero.
    • Constructor Detail

      • TestCasePropertiesBase

        public TestCasePropertiesBase()
        Create an empty properties set.
      • TestCasePropertiesBase

        public TestCasePropertiesBase​(java.nio.file.Path testCaseDirectory)
        Load property values that are stored in explicit files, e.g., file anything.params can contain values for the "params" property.
        Parameters:
        testCaseDirectory - directory containing configuration info for this test case
    • Method Detail

      • toString

        public java.lang.String toString()
        Render as a string (YAML).
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object right)
        Compare by name.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        right - another test cast property collection
        Returns:
        true if the names match
      • hashCode

        public int hashCode()
        Hash code of name.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hash code