Added ability to copy artifacts, CrossJeeves is now working

This commit is contained in:
Flare Microsystems
2024-11-14 19:44:01 -08:00
parent db4d12c47a
commit f67892eac7
9 changed files with 331 additions and 35 deletions

View File

@@ -22,13 +22,15 @@ public class Packet5ArtifactTest extends PacketTestBase {
@Test
public void testWrite() throws IOException
{
Packet5Artifact packet = new Packet5Artifact(1, "file.txt");
Packet5Artifact packet = new Packet5Artifact(1, 2, "file.txt");
assertEquals(packet.getFileId(), 1);
assertEquals(packet.getFileSize(), 2);
assertEquals("file.txt", packet.getRelativeFile());
packet.sendPacket(output());
assertEquals(5, input().readByte());
assertEquals(1, input().readLong());
assertEquals(2, input().readLong());
assertEquals("file.txt", input().readUTF());
}
@@ -38,18 +40,20 @@ public class Packet5ArtifactTest extends PacketTestBase {
Packet5Artifact packet = new Packet5Artifact();
output().writeLong(1);
output().writeLong(2);
output().writeUTF("file.txt");
packet.recievePacket(input());
assertEquals(1, packet.getFileId());
assertEquals(2, packet.getFileSize());
assertEquals("file.txt", packet.getRelativeFile());
}
@Test
public void testProcess() throws IOException
{
Packet5Artifact packet = new Packet5Artifact(1, "file.txt");
Packet5Artifact packet = new Packet5Artifact(1, 2, "file.txt");
packet.processPacket(handler);
Mockito.verify(handler, Mockito.times(1)).handlePacket(packet);
}