Package ch.njol.skript.test.runner
Class SkriptJUnitTest
java.lang.Object
ch.njol.skript.test.runner.SkriptJUnitTest
Class that helps the JUnit test communicate with Skript.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidcleanup()static voidUsed internally.static org.bukkit.block.BlockgetBlock()Return the main block for testing in the getTestLocation();static StringGet the currently running JUnit test name.static longThe delay this JUnit test is requiring to run.static org.bukkit.Locationstatic org.bukkit.Worldstatic org.bukkit.block.BlocksetBlock(org.bukkit.Material material) Set the type of the block at the testing location.static voidsetCurrentJUnitTest(String currentJUnitTest) Used internally.static voidsetShutdownDelay(long delay) static org.bukkit.entity.PigSpawns a testing pig at the spawn location of the testing world.
-
Constructor Details
-
SkriptJUnitTest
public SkriptJUnitTest()
-
-
Method Details
-
getShutdownDelay
public static long getShutdownDelay()The delay this JUnit test is requiring to run. Do note this is global to all other tests. The most delay is the final waiting time.- Returns:
- the delay in Minecraft ticks this junit test is requiring to run for.
-
setShutdownDelay
public static void setShutdownDelay(long delay) - Parameters:
delay- Set the delay in Minecraft ticks for this test to run.
-
cleanup
public final void cleanup() -
getTestWorld
public static org.bukkit.World getTestWorld()- Returns:
- the test world.
-
getTestLocation
public static org.bukkit.Location getTestLocation()- Returns:
- the testing location at the spawn of the testing world.
-
spawnTestPig
public static org.bukkit.entity.Pig spawnTestPig()Spawns a testing pig at the spawn location of the testing world.- Returns:
- Pig that has been spawned.
-
setBlock
public static org.bukkit.block.Block setBlock(org.bukkit.Material material) Set the type of the block at the testing location.- Parameters:
material- The material to set the block to.- Returns:
- the Block after it has been updated.
-
getBlock
public static org.bukkit.block.Block getBlock()Return the main block for testing in the getTestLocation();- Returns:
- the Block after it has been updated.
-
getCurrentJUnitTest
Get the currently running JUnit test name. -
setCurrentJUnitTest
Used internally. -
clearJUnitTest
public static void clearJUnitTest()Used internally.
-