Added ability to copy artifacts, CrossJeeves is now working
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user