Skip to content

Commit e049618

Browse files
committed
Fix latest Graal not being able to run unit tests anymore
1 parent b19fef0 commit e049618

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/test/java/org/cyclops/integratedscripting/evaluate/translation/ValueTranslatorsJavaScriptTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import net.minecraft.nbt.*;
55
import net.minecraft.network.chat.MutableComponent;
66
import net.minecraft.resources.ResourceLocation;
7-
import net.minecraft.server.Bootstrap;
87
import net.minecraft.world.item.ItemStack;
98
import net.minecraft.world.item.Items;
109
import net.minecraft.world.level.block.Blocks;
@@ -40,7 +39,10 @@
4039
public class ValueTranslatorsJavaScriptTests {
4140

4241
static {
43-
Bootstrap.bootStrap();
42+
// Override NeoForge's class loader, which is injected because JUnit is run through NeoForge's JUnitMain.
43+
// We need to do this, because otherwise Graal will fail to load.
44+
// This is not a problem at runtime.
45+
Thread.currentThread().setContextClassLoader(ValueTranslatorsJavaScriptTests.class.getClassLoader());
4446
}
4547

4648
private static ValueDeseralizationContext VDC = null;

0 commit comments

Comments
 (0)