Verified Commit 72801db9 authored by Daniel Mangold's avatar Daniel Mangold
Browse files

Added warning and updated metadata

parent df9380c2
......@@ -2,8 +2,8 @@
"version": "2.0.0",
"updateMessage": "",
"hashes": {
"src/test/java/h05/Utils.java": "c2d65072d0507a6457cfad33754215f1",
"src/test/java/h05/Config.java": "542a74ffa2c0eb4101b2e67d32f42e32",
"src/test/java/h05/Utils.java": "da3fec3caff6900a4064173f5bf11d27",
"src/test/java/h05/Config.java": "76ec90ff60e0fba8e4093cf340f22452",
"src/test/java/h05/Assertions.java": "6f30a42ce81689ac8ead140d3c79549b",
"src/test/java/h05/ListItemTest.java": "4978eba50ccb6f5f59152e126dff76bf",
"src/test/java/h05/MyTreeNodeTest.java": "d82afdbe6404309305cd83154bccbce4",
......@@ -14,14 +14,14 @@
},
"config": {
"file": "src/test/java/h05/Config.java",
"stub": "package h05;\n\nimport java.lang.reflect.Field;\nimport java.util.*;\nimport java.util.stream.Collectors;\n\n/**\n * This class contains constants that are used as settings for the tests.\n * They will not be overwritten when an update is downloaded (assuming this file is in {@link Config#EXCLUDED_FILES})\n */\n@SuppressWarnings({\"JavadocReference\", \"unused\"})\npublic class Config {\n\n>>>##<<<\n}\n",
"stub": "package h05;\n\nimport java.lang.reflect.Field;\nimport java.util.*;\nimport java.util.stream.Collectors;\n\n/**\n * This class contains constants that are used as settings for the tests.\n * They will not be overwritten when an update is downloaded (assuming this file is in {@link Config#EXCLUDED_FILES}),\n * but will be updated is such a way that everything between the lines containing \">>>##\" and \"##<<<\" will be kept.\n * This includes any changes or appended code.\n */\n@SuppressWarnings({\"JavadocReference\", \"unused\"})\npublic class Config {\n\n>>>##<<<\n}\n",
"constants": {
"EXISTS": " /**\n * Whether this file exists. Used by Utils.java to determine whether or not the config file is missing\n */\n public static final boolean EXISTS = true;",
"SEED": " /**\n * Seed that is used for initialization of Random object, set to fixed value for (hopefully) reproducible tests / results\n * @see Utils#RANDOM\n */\n public static final long SEED = new Random().nextLong();",
"CHECK_FOR_UPDATES": " /**\n * Settings for the updater / installer <br>\n * Set the values of these constants to {@code true} or {@code false} respectively, if you want or don't want to...\n * <ul>\n * <li>{@code CHECK_FOR_UPDATES} - use the updater / installer</li>\n * <li>{@code CHECK_HASHES} - compare the hashes of local files with the ones in the repository</li>\n * <li>{@code AUTO_UPDATE} - let the updater / installer download files from the repository and overwrite the local files automatically</li>\n * </ul>\n * @see Utils.Updater\n */\n public static final boolean CHECK_FOR_UPDATES = true, CHECK_HASHES = true, AUTO_UPDATE = true;",
"EXCLUDED_FILES": " /**\n * A list of files (with path relative to project root) to be excluded from updates.\n * It may be necessary to temporarily remove the configuration file from this list, e.g. when a update\n * is downloaded that needs additional constants that are not yet included in this file.\n */\n public static final List<String> EXCLUDED_FILES = List.of(\n \"src/test/java/h05/Config.java\"\n );",
"EXISTS": " /**\n * Whether this file exists. Used by {@link Utils} to determine whether or not the config file is missing\n */\n public static final boolean EXISTS = true;",
"SEED": " /**\n * Seed that is used for initialization of {@link Utils#RANDOM}, set to fixed value for (hopefully) reproducible results\n */\n public static final long SEED = new Random().nextLong();",
"CHECK_FOR_UPDATES": " /**\n * Settings for the updater / installer <br>\n * Set the values of these constants to {@code true} or {@code false} respectively, if you want or don't want to...\n * <ul>\n * <li>{@code CHECK_FOR_UPDATES} - use the functionality at all</li>\n * <li>{@code CHECK_HASHES} - compare the hashes of local files with the ones in the repository</li>\n * <li>{@code AUTO_UPDATE} - let the updater / installer download files from the repository and overwrite the local files automatically</li>\n * </ul>\n * @see Utils.Updater\n */\n public static final boolean CHECK_FOR_UPDATES = true, CHECK_HASHES = true, AUTO_UPDATE = true;",
"EXCLUDED_FILES": " /**\n * A list of files (with path relative to project root) to be excluded from updates.\n * This does not prevent updates to this configuration file ({@link Config#AUTO_UPDATE} does that),\n * it just prevents complete overwrites\n * @see Config\n */\n public static final List<String> EXCLUDED_FILES = List.of(\n \"src/test/java/h05/Config.java\"\n );",
"BUILD_VARIANT": " /**\n * Determines which build variant should be used in MyTree.\n * More specifically, what value to pass as the second parameter of the constructor.\n * If the value is {@code null} then the constructor will be called randomly with either {@code true} or {@code false}\n */\n public static final Boolean BUILD_VARIANT = null;",
"NUMBER_OF_TEST_RUNS": " /**\n * Allows customization of the number of test runs for a parameterized test method <br>\n * To override the number of runs add an entry consisting of the fully qualified class name +\n * '#' + the method signature mapped to an integer value (example below).\n * If the method is not in this map, a default value of 5 is used\n */\n public static final Map<String, Integer> NUMBER_OF_TEST_RUNS = Map.of(\n \"h05.MyTreeTest#testIsIsomorphic(String)\", 5\n );",
"NUMBER_OF_TEST_RUNS": " /**\n * Allows customization of the number of test runs for a parameterized test method.\n * To override the number of runs add an entry consisting of the fully qualified class name +\n * '#' + the method signature mapped to an integer value (example below).\n * If the method is not in this map, a default value of 5 is used\n */\n public static final Map<String, Integer> NUMBER_OF_TEST_RUNS = Map.of(\n \"h05.MyTreeTest#testIsIsomorphic(String)\", 5\n );",
"MAX_TREE_DEPTH": " /**\n * Defines the maximum depth of a randomly generated parentheses term\n * @see h05.provider.RandomTreeProvider\n */\n public static final int MAX_TREE_DEPTH = 5;"
},
"methods": {
......
2.0.0 -- -----
src/test/java/h05/Utils.java c2d65072d0507a6457cfad33754215f1
src/test/java/h05/Config.java 542a74ffa2c0eb4101b2e67d32f42e32
src/test/java/h05/Utils.java da3fec3caff6900a4064173f5bf11d27
src/test/java/h05/Config.java 76ec90ff60e0fba8e4093cf340f22452
src/test/java/h05/Assertions.java 6f30a42ce81689ac8ead140d3c79549b
src/test/java/h05/ListItemTest.java 4978eba50ccb6f5f59152e126dff76bf
src/test/java/h05/MyTreeNodeTest.java d82afdbe6404309305cd83154bccbce4
......
......@@ -25,6 +25,7 @@ repositories {
dependencies {
// JUnit only available in "test" source set (./src/test)
testImplementation("org.junit.jupiter:junit-jupiter:5.7.1")
testImplementation("org.json:json:20210307")
}
java {
......
......@@ -36,6 +36,8 @@ public class Utils {
);
static {
System.out.println("Reminder: remove these tests and the dependency from build.gradle.kts before submitting!");
if (!(Boolean) getConfigOrDefault("EXISTS", false))
System.err.println("Configurations could not be found, they must be downloaded from the repository. " +
"They will be automatically downloaded when using the installer or when CHECK_FOR_UPDATES and AUTO_UPDATE are true. " +
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment