Annotation Interface GradedTest


@Retention(RUNTIME) @Target(METHOD) public @interface GradedTest
The GradedTest annotation is primarily based off of capturing the data for a test object in the Gradescope JSON output. They are used to create corresponding Result objects.

This reuses code from jgrade by Tim Kutcher.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    A description of the defect detected by this test.
    boolean
    Whether to include the output in the test results.
    The name of the test.
    double
    The number of points the test is worth.
    The visibility level of the test, which determines when the result is shown to the student whose code is being graded.
  • Element Details

    • name

      String name
      The name of the test. If this is not set, the name of the test method will be used in the corresponding Result.
      Returns:
      the name of the test
      Default:
      ""
    • description

      String description
      A description of the defect detected by this test.
      Returns:
      the description
      Default:
      ""
    • points

      double points
      The number of points the test is worth.
      Returns:
      the number of points the test is worth
      Default:
      1.0
    • includeOutput

      boolean includeOutput
      Whether to include the output in the test results.
      Returns:
      true if the output should be included, false otherwise
      Default:
      true
    • visibility

      Visibility visibility
      The visibility level of the test, which determines when the result is shown to the student whose code is being graded.
      Returns:
      the visibility level of the test
      Default:
      VISIBLE