ls1intum / Ares

The Artemis Java Test Sandbox. A JUnit 5 Extension for Easy and Secure Artemis Java Testing
https://ls1intum.github.io/Ares/
MIT License
18 stars 7 forks source link

StructuralTestProvider: provide better feedback for classes expected in the default package #293

Closed martinmo closed 1 year ago

martinmo commented 1 year ago

Is your feature request related to a problem? Please describe. If a class is expected in the default package, e.g., with the following test.json snippet:

[
  {
    "class": {
      "name": "SomeClass",
      "package": ""
    }
  }
]

and cannot be found (or is misplaced), the error message will read: "The exercise expects a class with the name SomeClass in the package . You did not implement the class in the exercise."

Describe the solution you'd like I think the error message should look like:

- The exercise expects a class with the name SomeClass in the package . You did not implement the class in the exercise.
+ The exercise expects a class with the name SomeClass in the default package. You did not implement the class in the exercise.

And, maybe, to mitigate that beginners then try to add package default; at the beginning of their Java files, one could even go further:

- The exercise expects a class with the name SomeClass in the package . You did not implement the class in the exercise.
+ The exercise expects a class with the name SomeClass in the default package (i.e., no package). You did not implement the class in the exercise.

Describe alternatives you've considered

Additional context This is only affects very basic Java programming exercises w/o packages.

Ares-Version you are using 1.11.3

MaisiKoleni commented 1 year ago

Would The exercise expects a class with the name SomeClass in the package <default> (i.e., no package). You did not implement the class in the exercise. be OK? I would choose that implementation, as it does not require reordering in the messages or grammatical adjustments:

It should address the problem for now, that the package name is just an empty string. If this solution does not meet your needs, feel free to reopen the ticket and preferably open a pull request with your suggestion.

MaisiKoleni commented 1 year ago

Will be fixed in version 1.12.0.

Thanks for reposting and creating the bug report!

martinmo commented 1 year ago

This solution is sufficient. Thank you very much!