-
-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(#3024): cache noop accessor on ctor lookup failure
- Loading branch information
Showing
4 changed files
with
69 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/test/java/com/comphenix/protocol/reflect/instances/MinecraftGeneratorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.comphenix.protocol.reflect.instances; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
import java.util.UUID; | ||
|
||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import com.comphenix.protocol.BukkitInitialization; | ||
import com.comphenix.protocol.PacketType; | ||
|
||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap; | ||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; | ||
import net.minecraft.core.NonNullList; | ||
import net.minecraft.world.entity.EntityTypes; | ||
import net.minecraft.world.item.ItemStack; | ||
|
||
public class MinecraftGeneratorTest { | ||
|
||
@BeforeAll | ||
public static void beforeClass() { | ||
BukkitInitialization.initializeAll(); | ||
} | ||
|
||
@Test | ||
public void testInstantiation() { | ||
assertNotNull(MinecraftGenerator.INSTANCE.create(UUID.class)); | ||
assertNotNull(MinecraftGenerator.INSTANCE.create(PacketType.Protocol.class)); | ||
assertNotNull(MinecraftGenerator.INSTANCE.create(ItemStack.class)); | ||
assertNotNull(MinecraftGenerator.INSTANCE.create(EntityTypes.class)); | ||
assertNotNull(MinecraftGenerator.INSTANCE.create(Int2ObjectMap.class)); | ||
assertNotNull(MinecraftGenerator.INSTANCE.create(Int2ObjectOpenHashMap.class)); | ||
assertNotNull(MinecraftGenerator.INSTANCE.create(NonNullList.class)); | ||
} | ||
} |