From 87225b1c65b54f06b09bdbe0ed44c56152d55783 Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Thu, 2 Mar 2023 01:20:38 -0500 Subject: [PATCH] Move old tests to old-test. --- build.gradle | 34 +++++++++++++++---- .../MultiverseCore/TestDebugMode.java | 0 .../MultiverseCore/TestEntitySpawnRules.java | 0 .../TestEntryFeeConversion.java | 0 .../MultiverseCore/TestModifyCommand.java | 0 .../MultiverseCore/TestWorldProperties.java | 0 .../MultiverseCore/TestWorldPurger.java | 0 .../MultiverseCore/TestWorldStuff.java | 0 .../MultiverseCore/utils/FileUtilsTest.java | 0 .../utils/MVTestLogFormatter.java | 0 .../utils/MockWorldFactory.java | 0 .../utils/TestInstanceCreator.java | 0 .../MultiverseCore/utils/Util.java | 0 .../utils/WorldCreatorMatcher.java | 0 .../org.mockito.plugins.MockMaker | 0 15 files changed, 27 insertions(+), 7 deletions(-) rename src/{test => old-test}/java/com/onarandombox/MultiverseCore/TestDebugMode.java (100%) rename src/{test => old-test}/java/com/onarandombox/MultiverseCore/TestEntitySpawnRules.java (100%) rename src/{test => old-test}/java/com/onarandombox/MultiverseCore/TestEntryFeeConversion.java (100%) rename src/{test => old-test}/java/com/onarandombox/MultiverseCore/TestModifyCommand.java (100%) rename src/{test => old-test}/java/com/onarandombox/MultiverseCore/TestWorldProperties.java (100%) rename src/{test => old-test}/java/com/onarandombox/MultiverseCore/TestWorldPurger.java (100%) rename src/{test => old-test}/java/com/onarandombox/MultiverseCore/TestWorldStuff.java (100%) rename src/{test => old-test}/java/com/onarandombox/MultiverseCore/utils/FileUtilsTest.java (100%) rename src/{test => old-test}/java/com/onarandombox/MultiverseCore/utils/MVTestLogFormatter.java (100%) rename src/{test => old-test}/java/com/onarandombox/MultiverseCore/utils/MockWorldFactory.java (100%) rename src/{test => old-test}/java/com/onarandombox/MultiverseCore/utils/TestInstanceCreator.java (100%) rename src/{test => old-test}/java/com/onarandombox/MultiverseCore/utils/Util.java (100%) rename src/{test => old-test}/java/com/onarandombox/MultiverseCore/utils/WorldCreatorMatcher.java (100%) rename src/{test => old-test}/resources/mockito-extensions/org.mockito.plugins.MockMaker (100%) diff --git a/build.gradle b/build.gradle index d36d117a..394464cb 100644 --- a/build.gradle +++ b/build.gradle @@ -52,6 +52,11 @@ repositories { } } +configurations { + oldTestImplementation.extendsFrom implementation + oldTestRuntime.extendsFrom runtime +} + dependencies { compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT' @@ -88,6 +93,15 @@ dependencies { testImplementation 'junit:junit:4.13.1' testImplementation 'org.mockito:mockito-core:3.11.2' testImplementation 'commons-io:commons-io:2.7' + + // Old Tests + oldTestImplementation 'org.spigotmc:spigot-api:1.19.3-R0.1-SNAPSHOT' + oldTestImplementation('com.googlecode.json-simple:json-simple:1.1.1') { + exclude group: 'junit', module: 'junit' + } + oldTestImplementation 'junit:junit:4.13.1' + oldTestImplementation 'org.mockito:mockito-core:3.11.2' + oldTestImplementation 'commons-io:commons-io:2.7' } @@ -112,6 +126,19 @@ configurations { } } + +sourceSets { + oldTest { + java { + compileClasspath += main.output + runtimeClasspath += main.output + srcDir file('src/old-test/java') + } + resources.srcDir file('src/old-test/resources') + } +} + + publishing { publications { maven(MavenPublication) { @@ -191,10 +218,3 @@ shadowJar { build.dependsOn shadowJar jar.enabled = false - - -// Excludes all test -// TODO: Remove this when we have tests for MV5 -test { - exclude '**/*' -} diff --git a/src/test/java/com/onarandombox/MultiverseCore/TestDebugMode.java b/src/old-test/java/com/onarandombox/MultiverseCore/TestDebugMode.java similarity index 100% rename from src/test/java/com/onarandombox/MultiverseCore/TestDebugMode.java rename to src/old-test/java/com/onarandombox/MultiverseCore/TestDebugMode.java diff --git a/src/test/java/com/onarandombox/MultiverseCore/TestEntitySpawnRules.java b/src/old-test/java/com/onarandombox/MultiverseCore/TestEntitySpawnRules.java similarity index 100% rename from src/test/java/com/onarandombox/MultiverseCore/TestEntitySpawnRules.java rename to src/old-test/java/com/onarandombox/MultiverseCore/TestEntitySpawnRules.java diff --git a/src/test/java/com/onarandombox/MultiverseCore/TestEntryFeeConversion.java b/src/old-test/java/com/onarandombox/MultiverseCore/TestEntryFeeConversion.java similarity index 100% rename from src/test/java/com/onarandombox/MultiverseCore/TestEntryFeeConversion.java rename to src/old-test/java/com/onarandombox/MultiverseCore/TestEntryFeeConversion.java diff --git a/src/test/java/com/onarandombox/MultiverseCore/TestModifyCommand.java b/src/old-test/java/com/onarandombox/MultiverseCore/TestModifyCommand.java similarity index 100% rename from src/test/java/com/onarandombox/MultiverseCore/TestModifyCommand.java rename to src/old-test/java/com/onarandombox/MultiverseCore/TestModifyCommand.java diff --git a/src/test/java/com/onarandombox/MultiverseCore/TestWorldProperties.java b/src/old-test/java/com/onarandombox/MultiverseCore/TestWorldProperties.java similarity index 100% rename from src/test/java/com/onarandombox/MultiverseCore/TestWorldProperties.java rename to src/old-test/java/com/onarandombox/MultiverseCore/TestWorldProperties.java diff --git a/src/test/java/com/onarandombox/MultiverseCore/TestWorldPurger.java b/src/old-test/java/com/onarandombox/MultiverseCore/TestWorldPurger.java similarity index 100% rename from src/test/java/com/onarandombox/MultiverseCore/TestWorldPurger.java rename to src/old-test/java/com/onarandombox/MultiverseCore/TestWorldPurger.java diff --git a/src/test/java/com/onarandombox/MultiverseCore/TestWorldStuff.java b/src/old-test/java/com/onarandombox/MultiverseCore/TestWorldStuff.java similarity index 100% rename from src/test/java/com/onarandombox/MultiverseCore/TestWorldStuff.java rename to src/old-test/java/com/onarandombox/MultiverseCore/TestWorldStuff.java diff --git a/src/test/java/com/onarandombox/MultiverseCore/utils/FileUtilsTest.java b/src/old-test/java/com/onarandombox/MultiverseCore/utils/FileUtilsTest.java similarity index 100% rename from src/test/java/com/onarandombox/MultiverseCore/utils/FileUtilsTest.java rename to src/old-test/java/com/onarandombox/MultiverseCore/utils/FileUtilsTest.java diff --git a/src/test/java/com/onarandombox/MultiverseCore/utils/MVTestLogFormatter.java b/src/old-test/java/com/onarandombox/MultiverseCore/utils/MVTestLogFormatter.java similarity index 100% rename from src/test/java/com/onarandombox/MultiverseCore/utils/MVTestLogFormatter.java rename to src/old-test/java/com/onarandombox/MultiverseCore/utils/MVTestLogFormatter.java diff --git a/src/test/java/com/onarandombox/MultiverseCore/utils/MockWorldFactory.java b/src/old-test/java/com/onarandombox/MultiverseCore/utils/MockWorldFactory.java similarity index 100% rename from src/test/java/com/onarandombox/MultiverseCore/utils/MockWorldFactory.java rename to src/old-test/java/com/onarandombox/MultiverseCore/utils/MockWorldFactory.java diff --git a/src/test/java/com/onarandombox/MultiverseCore/utils/TestInstanceCreator.java b/src/old-test/java/com/onarandombox/MultiverseCore/utils/TestInstanceCreator.java similarity index 100% rename from src/test/java/com/onarandombox/MultiverseCore/utils/TestInstanceCreator.java rename to src/old-test/java/com/onarandombox/MultiverseCore/utils/TestInstanceCreator.java diff --git a/src/test/java/com/onarandombox/MultiverseCore/utils/Util.java b/src/old-test/java/com/onarandombox/MultiverseCore/utils/Util.java similarity index 100% rename from src/test/java/com/onarandombox/MultiverseCore/utils/Util.java rename to src/old-test/java/com/onarandombox/MultiverseCore/utils/Util.java diff --git a/src/test/java/com/onarandombox/MultiverseCore/utils/WorldCreatorMatcher.java b/src/old-test/java/com/onarandombox/MultiverseCore/utils/WorldCreatorMatcher.java similarity index 100% rename from src/test/java/com/onarandombox/MultiverseCore/utils/WorldCreatorMatcher.java rename to src/old-test/java/com/onarandombox/MultiverseCore/utils/WorldCreatorMatcher.java diff --git a/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/src/old-test/resources/mockito-extensions/org.mockito.plugins.MockMaker similarity index 100% rename from src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker rename to src/old-test/resources/mockito-extensions/org.mockito.plugins.MockMaker