From 89b7019e29969f04ead1d4192d7e739dbf26d0b8 Mon Sep 17 00:00:00 2001 From: Kamron Vaswani Date: Thu, 3 Mar 2022 16:02:02 -0500 Subject: [PATCH] Delete CompressorTest.java Not needed in final version --- .../luizotavio/compressor/CompressorTest.java | 77 ------------------- 1 file changed, 77 deletions(-) delete mode 100644 src/test/java/me/luizotavio/compressor/CompressorTest.java diff --git a/src/test/java/me/luizotavio/compressor/CompressorTest.java b/src/test/java/me/luizotavio/compressor/CompressorTest.java deleted file mode 100644 index 1dfc0977e..000000000 --- a/src/test/java/me/luizotavio/compressor/CompressorTest.java +++ /dev/null @@ -1,77 +0,0 @@ -package me.luizotavio.compressor; - -import net.minecraft.nbt.NBTTagCompound; -import noppes.npcs.util.JsonException; -import noppes.npcs.util.NBTJsonUtil; - -import java.io.ByteArrayInputStream; -import java.io.DataInputStream; -import java.io.File; -import java.io.IOException; -import java.util.logging.Logger; - -public class CompressorTest { - - public static final int MAX_ENTRIES = 1000; - - public static void main(String[] args) throws JsonException, IOException { - Logger logger = Logger.getLogger("CompressorTest"); - - logger.info("Starting CompressorTest with " + MAX_ENTRIES + " entries"); - - NBTTagCompound compound = new NBTTagCompound(); - File file = new File("test.json"); - - fill(compound); - - long start = System.currentTimeMillis(); - - logger.info("Writing the data into JSON..."); - - NBTJsonUtil.SaveFile(file, compound); - - long end = System.currentTimeMillis(); - - logger.info("Done! Took " + (end - start) + "ms"); - logger.info("Reading the data from JSON..."); - - start = System.currentTimeMillis(); - - NBTJsonUtil.LoadFile(new File("test.json")); - - end = System.currentTimeMillis(); - - logger.info("Done! Took " + (end - start) + "ms"); - logger.info("Now, we will compress the data into zstd..."); - - start = System.currentTimeMillis(); - - byte[] bytes = ZstdCompressor.writeCompound(compound); - - end = System.currentTimeMillis(); - - logger.info("Done! Took " + (end - start) + "ms"); - logger.info("Now, we will decompress the data from zstd..."); - - start = System.currentTimeMillis(); - - ZstdCompressor.readCompressed( - new DataInputStream( - new ByteArrayInputStream(bytes) - ) - ); - - end = System.currentTimeMillis(); - - logger.info("Done! Took " + (end - start) + "ms"); - - file.deleteOnExit(); - } - - private static void fill(NBTTagCompound compound) { - for (int i = 0; i < MAX_ENTRIES; i++) { - compound.setInteger("" + i, i); - } - } - -}