Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
java/test/jmri/jmrix/ipocs/protocol/packets/RequestStatusPacketTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,29 @@ | ||
package jmri.jmrix.ipocs.protocol.packets; | ||
|
||
import static org.junit.Assert.assertArrayEquals; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import java.nio.ByteBuffer; | ||
|
||
import org.junit.Test; | ||
|
||
public class RequestStatusPacketTest { | ||
private byte[] testPacket = { }; | ||
|
||
@Test | ||
public void getIdTest() { | ||
assertEquals(RequestStatusPacket.IDENT, new RequestStatusPacket().getId()); | ||
} | ||
|
||
@Test | ||
public void parseSpecificTest() { | ||
RequestStatusPacket pkt = new RequestStatusPacket(); | ||
pkt.parseSpecific(ByteBuffer.wrap(testPacket)); | ||
} | ||
|
||
@Test | ||
public void serializeSpecificTest() { | ||
RequestStatusPacket pkt = new RequestStatusPacket(); | ||
assertArrayEquals(testPacket, pkt.serializeSpecific()); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
java/test/jmri/jmrix/ipocs/protocol/packets/ResetControllerPacketTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,29 @@ | ||
package jmri.jmrix.ipocs.protocol.packets; | ||
|
||
import static org.junit.Assert.assertArrayEquals; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import java.nio.ByteBuffer; | ||
|
||
import org.junit.Test; | ||
|
||
public class ResetControllerPacketTest { | ||
private byte[] testPacket = { }; | ||
|
||
@Test | ||
public void getIdTest() { | ||
assertEquals(ResetControllerPacket.IDENT, new ResetControllerPacket().getId()); | ||
} | ||
|
||
@Test | ||
public void parseSpecificTest() { | ||
ResetControllerPacket pkt = new ResetControllerPacket(); | ||
pkt.parseSpecific(ByteBuffer.wrap(testPacket)); | ||
} | ||
|
||
@Test | ||
public void serializeSpecificTest() { | ||
ResetControllerPacket pkt = new ResetControllerPacket(); | ||
assertArrayEquals(testPacket, pkt.serializeSpecific()); | ||
} | ||
} |