Skip to content

Commit

Permalink
Update README documentation with custom IO testing and trusted packages
Browse files Browse the repository at this point in the history
  • Loading branch information
MaisiKoleni committed Mar 24, 2022
1 parent e032d0e commit 5810483
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ But what is whitelisted?
Therefore, *never use such package names for student assignments!*
* Single classes whitelisted using `@WhitelistClass` and
all classes matching `@AddTrustedPackage`
* Additional package prefixes provided with by system property
`ares.security.trustedpackages` separated by a comma `,`.

Ares also grants permissions that are requested by certain actions
(`System.exit`, File IO, Networking, Threads, …) based on whitelisted
Expand Down Expand Up @@ -329,7 +331,7 @@ students manage to load classes that would be in trusted packages. This
is especially problematic if they shadow library classes, such as
JUnit’s `Assertions`.

To prevent that, you have to use the Maven/Gradle Enforcer Plugin to make sure
To prevent that, you have to use the Maven Enforcer Plugin to make sure
no student content lands in trusted packages:

Maven:
Expand Down Expand Up @@ -379,8 +381,6 @@ Maven:
----

Gradle:

Make sure to exactly copy the following configuration:
[source,groovy]
----
Expand Down Expand Up @@ -654,6 +654,16 @@ test.
<<showing-standard-output>> covers how the student output is
managed and shown in the test logs.

[TIP]
====
In case the default `IOTester` from Ares does not meet your requirements,
you can provide a custom implementation by applying `@WithIOManager(MyCustomOne.class)`
to e.g. the test class or individual methods. This also allows you to register
a custom parameter to control IO testing with ease inside the test method.
Have a look into the test class linked above to learn more or read the documentation of
link:src/main/java/de/tum/in/test/api/io/IOManager.java[`IOManager`].
====

==== Networking

Ares allows for local network connections by using the `@AllowLocalPort`
Expand Down

0 comments on commit 5810483

Please sign in to comment.