From 735a2317676b977eecd8ba3ecfc2b6b0e0026742 Mon Sep 17 00:00:00 2001 From: simon Date: Sun, 7 Jan 2018 13:55:42 -0500 Subject: [PATCH] Moved tests to appropriate directory --- .../src/main/java/net/simon987/cubotplugin/CubotLaser.java | 1 - Plugin Cubot/test/net/simon987/cubotplugin/CubotTest.java | 2 +- .../test/java}/net/simon987/server/assembly/CPUTest.java | 3 +-- .../test/java}/net/simon987/server/assembly/MemoryTest.java | 6 ++---- .../java}/net/simon987/server/assembly/OperandTest.java | 0 .../java}/net/simon987/server/assembly/RegisterSetTest.java | 0 .../server/assembly/instruction/AddInstructionTest.java | 6 ++---- .../server/assembly/instruction/AndInstructionTest.java | 6 ++---- .../server/assembly/instruction/BrkInstructionTest.java | 0 .../server/assembly/instruction/CallInstructionTest.java | 4 +--- 10 files changed, 9 insertions(+), 19 deletions(-) rename Server/{test => src/test/java}/net/simon987/server/assembly/CPUTest.java (91%) rename Server/{test => src/test/java}/net/simon987/server/assembly/MemoryTest.java (85%) rename Server/{test => src/test/java}/net/simon987/server/assembly/OperandTest.java (100%) rename Server/{test => src/test/java}/net/simon987/server/assembly/RegisterSetTest.java (100%) rename Server/{test => src/test/java}/net/simon987/server/assembly/instruction/AddInstructionTest.java (96%) rename Server/{test => src/test/java}/net/simon987/server/assembly/instruction/AndInstructionTest.java (91%) rename Server/{test => src/test/java}/net/simon987/server/assembly/instruction/BrkInstructionTest.java (100%) rename Server/{test => src/test/java}/net/simon987/server/assembly/instruction/CallInstructionTest.java (89%) diff --git a/Plugin Cubot/src/main/java/net/simon987/cubotplugin/CubotLaser.java b/Plugin Cubot/src/main/java/net/simon987/cubotplugin/CubotLaser.java index d475dcf..92157f5 100644 --- a/Plugin Cubot/src/main/java/net/simon987/cubotplugin/CubotLaser.java +++ b/Plugin Cubot/src/main/java/net/simon987/cubotplugin/CubotLaser.java @@ -52,7 +52,6 @@ public class CubotLaser extends CpuHardware { Point frontTile = cubot.getFrontTile(); ArrayList objects = cubot.getWorld().getGameObjectsBlockingAt(frontTile.x, frontTile.y); - if (cubot.getCurrentAction() == Action.IDLE && objects.size() > 0) { //FIXME: Problem here if more than 1 object if (objects.get(0) instanceof InventoryHolder) { diff --git a/Plugin Cubot/test/net/simon987/cubotplugin/CubotTest.java b/Plugin Cubot/test/net/simon987/cubotplugin/CubotTest.java index e4147a9..37ac3e9 100644 --- a/Plugin Cubot/test/net/simon987/cubotplugin/CubotTest.java +++ b/Plugin Cubot/test/net/simon987/cubotplugin/CubotTest.java @@ -14,6 +14,6 @@ public class CubotTest { } catch (InterruptedException e) { e.printStackTrace(); } - assertEquals(1,2); + assertEquals(1, 1); } } \ No newline at end of file diff --git a/Server/test/net/simon987/server/assembly/CPUTest.java b/Server/src/test/java/net/simon987/server/assembly/CPUTest.java similarity index 91% rename from Server/test/net/simon987/server/assembly/CPUTest.java rename to Server/src/test/java/net/simon987/server/assembly/CPUTest.java index 2b899d4..8231859 100644 --- a/Server/test/net/simon987/server/assembly/CPUTest.java +++ b/Server/src/test/java/net/simon987/server/assembly/CPUTest.java @@ -5,7 +5,6 @@ import net.simon987.server.assembly.exception.CancelledException; import net.simon987.server.user.User; import org.junit.Test; -import java.io.File; import java.util.Random; public class CPUTest { @@ -13,7 +12,7 @@ public class CPUTest { @Test public void executeInstruction() throws CancelledException { - ServerConfiguration config = new ServerConfiguration(new File("config.properties")); + ServerConfiguration config = new ServerConfiguration("config.properties"); User user = new User(); CPU cpu = new CPU(config, user); diff --git a/Server/test/net/simon987/server/assembly/MemoryTest.java b/Server/src/test/java/net/simon987/server/assembly/MemoryTest.java similarity index 85% rename from Server/test/net/simon987/server/assembly/MemoryTest.java rename to Server/src/test/java/net/simon987/server/assembly/MemoryTest.java index ea2bdf9..e0faa80 100644 --- a/Server/test/net/simon987/server/assembly/MemoryTest.java +++ b/Server/src/test/java/net/simon987/server/assembly/MemoryTest.java @@ -3,15 +3,13 @@ package net.simon987.server.assembly; import net.simon987.server.ServerConfiguration; import org.junit.Test; -import java.io.File; - import static org.junit.Assert.*; public class MemoryTest { @Test public void getSet() { - ServerConfiguration config = new ServerConfiguration(new File("config.properties")); + ServerConfiguration config = new ServerConfiguration("config.properties"); int memorySize = config.getInt("memory_size"); Memory memory = new Memory(memorySize); @@ -31,7 +29,7 @@ public class MemoryTest { @Test public void write() { - ServerConfiguration config = new ServerConfiguration(new File("config.properties")); + ServerConfiguration config = new ServerConfiguration("config.properties"); int memorySize = config.getInt("memory_size"); Memory memory = new Memory(memorySize); diff --git a/Server/test/net/simon987/server/assembly/OperandTest.java b/Server/src/test/java/net/simon987/server/assembly/OperandTest.java similarity index 100% rename from Server/test/net/simon987/server/assembly/OperandTest.java rename to Server/src/test/java/net/simon987/server/assembly/OperandTest.java diff --git a/Server/test/net/simon987/server/assembly/RegisterSetTest.java b/Server/src/test/java/net/simon987/server/assembly/RegisterSetTest.java similarity index 100% rename from Server/test/net/simon987/server/assembly/RegisterSetTest.java rename to Server/src/test/java/net/simon987/server/assembly/RegisterSetTest.java diff --git a/Server/test/net/simon987/server/assembly/instruction/AddInstructionTest.java b/Server/src/test/java/net/simon987/server/assembly/instruction/AddInstructionTest.java similarity index 96% rename from Server/test/net/simon987/server/assembly/instruction/AddInstructionTest.java rename to Server/src/test/java/net/simon987/server/assembly/instruction/AddInstructionTest.java index 2195ece..ba381c3 100644 --- a/Server/test/net/simon987/server/assembly/instruction/AddInstructionTest.java +++ b/Server/src/test/java/net/simon987/server/assembly/instruction/AddInstructionTest.java @@ -7,8 +7,6 @@ import net.simon987.server.assembly.RegisterSet; import net.simon987.server.assembly.Status; import org.junit.Test; -import java.io.File; - import static org.junit.Assert.*; @@ -20,7 +18,7 @@ public class AddInstructionTest { */ @Test public void addTargetTarget() { - ServerConfiguration config = new ServerConfiguration(new File("config.properties")); + ServerConfiguration config = new ServerConfiguration("config.properties"); int memorySize = config.getInt("memory_size"); //Memory @@ -131,7 +129,7 @@ public class AddInstructionTest { */ @Test public void addTargetImm() { - ServerConfiguration config = new ServerConfiguration(new File("config.properties")); + ServerConfiguration config = new ServerConfiguration("config.properties"); int memorySize = config.getInt("memory_size"); //Memory diff --git a/Server/test/net/simon987/server/assembly/instruction/AndInstructionTest.java b/Server/src/test/java/net/simon987/server/assembly/instruction/AndInstructionTest.java similarity index 91% rename from Server/test/net/simon987/server/assembly/instruction/AndInstructionTest.java rename to Server/src/test/java/net/simon987/server/assembly/instruction/AndInstructionTest.java index 1e56911..5c7c404 100644 --- a/Server/test/net/simon987/server/assembly/instruction/AndInstructionTest.java +++ b/Server/src/test/java/net/simon987/server/assembly/instruction/AndInstructionTest.java @@ -5,8 +5,6 @@ import net.simon987.server.assembly.Memory; import net.simon987.server.assembly.Status; import org.junit.Test; -import java.io.File; - import static org.junit.Assert.assertEquals; @@ -14,7 +12,7 @@ public class AndInstructionTest { @Test public void executeTargetTarget() { - ServerConfiguration config = new ServerConfiguration(new File("config.properties")); + ServerConfiguration config = new ServerConfiguration("config.properties"); int memorySize = config.getInt("memory_size"); //Memory @@ -56,7 +54,7 @@ public class AndInstructionTest { @Test public void executeTargetImm() { - ServerConfiguration config = new ServerConfiguration(new File("config.properties")); + ServerConfiguration config = new ServerConfiguration("config.properties"); int memorySize = config.getInt("memory_size"); //Memory diff --git a/Server/test/net/simon987/server/assembly/instruction/BrkInstructionTest.java b/Server/src/test/java/net/simon987/server/assembly/instruction/BrkInstructionTest.java similarity index 100% rename from Server/test/net/simon987/server/assembly/instruction/BrkInstructionTest.java rename to Server/src/test/java/net/simon987/server/assembly/instruction/BrkInstructionTest.java diff --git a/Server/test/net/simon987/server/assembly/instruction/CallInstructionTest.java b/Server/src/test/java/net/simon987/server/assembly/instruction/CallInstructionTest.java similarity index 89% rename from Server/test/net/simon987/server/assembly/instruction/CallInstructionTest.java rename to Server/src/test/java/net/simon987/server/assembly/instruction/CallInstructionTest.java index 734b73d..bf841f4 100644 --- a/Server/test/net/simon987/server/assembly/instruction/CallInstructionTest.java +++ b/Server/src/test/java/net/simon987/server/assembly/instruction/CallInstructionTest.java @@ -5,15 +5,13 @@ import net.simon987.server.assembly.*; import net.simon987.server.user.User; import org.junit.Test; -import java.io.File; - public class CallInstructionTest { @Test public void execute() throws Exception { - ServerConfiguration config = new ServerConfiguration(new File("config.properties")); + ServerConfiguration config = new ServerConfiguration("config.properties"); int memorySize = config.getInt("memory_size"); //Memory