Some small fixes to the game test framework (#2283)

* Some small fixes to the game test framework

* Update mappings/net/minecraft/test/AfterBatch.mapping

Co-authored-by: Juuxel <6596629+Juuxel@users.noreply.github.com>

* Update mappings/net/minecraft/test/CustomTestProvider.mapping

Co-authored-by: Juuxel <6596629+Juuxel@users.noreply.github.com>

* TestTimeoutException

* GameTestException

Co-authored-by: Juuxel <6596629+Juuxel@users.noreply.github.com>
This commit is contained in:
modmuss50 2021-04-05 22:41:12 +01:00 committed by GitHub
parent 8ee7d712b5
commit 026d197686
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 38 additions and 15 deletions

View File

@ -0,0 +1,3 @@
CLASS net/minecraft/class_6300 net/minecraft/test/AfterBatch
COMMENT {@code AfterBatch} methods are ran once the batch specificied has finished.
METHOD method_35930 batchId ()Ljava/lang/String;

View File

@ -0,0 +1,3 @@
CLASS net/minecraft/class_6301 net/minecraft/test/BeforeBatch
COMMENT {@code BeforeBatch} methods are ran before the batch specificied has started.
METHOD method_35931 batchId ()Ljava/lang/String;

View File

@ -0,0 +1,2 @@
CLASS net/minecraft/class_6303 net/minecraft/test/CustomTestProvider
COMMENT {@code CustomTestProvider} methods return a {@code Collection<TestFunction>}.

View File

@ -1,4 +1,7 @@
CLASS net/minecraft/class_6302 net/minecraft/test/GameTest
COMMENT {@code GameTest} is used to tell the test framework that the annotated method is a test.
COMMENT
COMMENT <p>{@code GameTest} methods must take 1 parameter of {@link net.minecraft.test.TestContext}
METHOD method_35932 tickLimit ()I
METHOD method_35933 batchId ()Ljava/lang/String;
METHOD method_35934 rotation ()I

View File

@ -1,15 +1,17 @@
CLASS net/minecraft/class_4514 net/minecraft/test/GameTestBatch
FIELD field_20543 id Ljava/lang/String;
FIELD field_20544 testFunctions Ljava/util/Collection;
FIELD field_20545 worldSetter Ljava/util/function/Consumer;
FIELD field_20545 beforeBatchConsumer Ljava/util/function/Consumer;
FIELD field_27801 afterBatchConsumer Ljava/util/function/Consumer;
FIELD field_33145 DEFAULT_BATCH Ljava/lang/String;
METHOD <init> (Ljava/lang/String;Ljava/util/Collection;Ljava/util/function/Consumer;Ljava/util/function/Consumer;)V
ARG 1 id
ARG 2 testFunctions
ARG 3 worldSetter
ARG 3 beforeBatchConsumer
ARG 4 afterBatchConsumer
METHOD method_22152 getId ()Ljava/lang/String;
METHOD method_22153 setWorld (Lnet/minecraft/class_3218;)V
METHOD method_22153 startBatch (Lnet/minecraft/class_3218;)V
ARG 1 world
METHOD method_22154 getTestFunctions ()Ljava/util/Collection;
METHOD method_32237 (Lnet/minecraft/class_3218;)V
METHOD method_32237 finishBatch (Lnet/minecraft/class_3218;)V
ARG 1 world

View File

@ -0,0 +1,3 @@
CLASS net/minecraft/class_4512 net/minecraft/test/GameTestException
METHOD <init> (Ljava/lang/String;)V
ARG 1 message

View File

@ -74,6 +74,8 @@ CLASS net/minecraft/class_4525 net/minecraft/test/StructureTestUtil
ARG 0 structureBlockEntity
METHOD method_36105 getRotationSteps (Lnet/minecraft/class_2470;)I
ARG 0 rotation
METHOD method_36106 main ([Ljava/lang/String;)V
ARG 0 args
METHOD method_36107 (Ljava/nio/file/Path;)V
ARG 0 path
METHOD method_36108 (Ljava/nio/file/Path;)Z

View File

@ -0,0 +1,3 @@
CLASS net/minecraft/class_6308 net/minecraft/test/TeamCityTestCompletionListener
FIELD field_33176 LOGGER Lorg/apache/logging/log4j/Logger;
FIELD field_33177 ESCAPER Lcom/google/common/escape/Escaper;

View File

@ -1,4 +1,4 @@
CLASS net/minecraft/class_4516 net/minecraft/test/StartupParameter
CLASS net/minecraft/class_4516 net/minecraft/test/TestContext
FIELD field_20558 test Lnet/minecraft/class_4517;
FIELD field_33146 hasFinalClause Z
METHOD <init> (Lnet/minecraft/class_4517;)V

View File

@ -1,8 +1,9 @@
CLASS net/minecraft/class_4519 net/minecraft/test/TestFunctions
FIELD field_20570 TEST_FUNCTIONS Ljava/util/Collection;
FIELD field_20571 testClasses Ljava/util/Set;
FIELD field_20572 WORLD_SETTERS Ljava/util/Map;
FIELD field_20572 BEFORE_BATCH_CONSUMERS Ljava/util/Map;
FIELD field_25302 FAILED_TEST_FUNCTIONS Ljava/util/Collection;
FIELD field_27806 AFTER_BATCH_CONSUMERS Ljava/util/Map;
METHOD method_22191 getTestFunctions ()Ljava/util/Collection;
METHOD method_22192 isInClass (Lnet/minecraft/class_4529;Ljava/lang/String;)Z
ARG 0 testFunction
@ -16,7 +17,7 @@ CLASS net/minecraft/class_4519 net/minecraft/test/TestFunctions
ARG 0 testClass
METHOD method_22197 (Ljava/lang/String;Lnet/minecraft/class_4529;)Z
ARG 1 testFunction
METHOD method_22198 getWorldSetter (Ljava/lang/String;)Ljava/util/function/Consumer;
METHOD method_22198 getAfterBatchConsumer (Ljava/lang/String;)Ljava/util/function/Consumer;
ARG 0 batchId
METHOD method_22199 getTestFunction (Ljava/lang/String;)Ljava/util/Optional;
ARG 0 structurePath
@ -26,18 +27,22 @@ CLASS net/minecraft/class_4519 net/minecraft/test/TestFunctions
ARG 0 testFunction
METHOD method_29405 getFailedTestFunctions ()Ljava/util/Collection;
METHOD method_29406 clearFailedTestFunctions ()V
METHOD method_32244 (Ljava/lang/String;)Ljava/util/function/Consumer;
METHOD method_32244 getBeforeBatchConsumer (Ljava/lang/String;)Ljava/util/function/Consumer;
ARG 0 batchId
METHOD method_36069 (Ljava/lang/reflect/Method;)V
METHOD method_36068 register (Ljava/lang/Class;)V
ARG 0 testClass
METHOD method_36069 register (Ljava/lang/reflect/Method;)V
ARG 0 method
METHOD method_36070 validateCount (Ljava/lang/reflect/Method;Ljava/lang/Class;Ljava/util/function/Function;Ljava/util/Map;)V
METHOD method_36070 registerBatchConsumers (Ljava/lang/reflect/Method;Ljava/lang/Class;Ljava/util/function/Function;Ljava/util/Map;)V
ARG 0 method
ARG 1 clazz
ARG 2 batchIdFunction
ARG 3 batchConsumerMap
METHOD method_36071 (Ljava/lang/reflect/Method;Ljava/lang/Object;)V
ARG 1 args
METHOD method_36072 invoke (Ljava/lang/reflect/Method;)Ljava/util/Collection;
METHOD method_36072 getCustomTestFunctions (Ljava/lang/reflect/Method;)Ljava/util/Collection;
ARG 0 method
METHOD method_36073 parseTestMethod (Ljava/lang/reflect/Method;)Lnet/minecraft/class_4529;
METHOD method_36073 getTestFunction (Ljava/lang/reflect/Method;)Lnet/minecraft/class_4529;
ARG 0 method
METHOD method_36074 getInvoker (Ljava/lang/reflect/Method;)Ljava/util/function/Consumer;
ARG 0 method

View File

@ -1,3 +0,0 @@
CLASS net/minecraft/class_4512 net/minecraft/test/TimeMismatchException
METHOD <init> (Ljava/lang/String;)V
ARG 1 message