Class FakeSTouchTest

java.lang.Object
de.freaklamarsch.systarest.tests.FakeSTouchTest

class FakeSTouchTest
extends java.lang.Object
  • Field Details

  • Constructor Details

    • FakeSTouchTest

      FakeSTouchTest()
  • Method Details

    • initializeData

      private void initializeData​(java.lang.String testFileName)
      reads packetData from a pcap dumped into a c array header file. It is assumed that the file starts with the default startup sequence of the S-Touch app searching for a compatible device
      Parameters:
      testFileName -
    • initializeData

      private void initializeData​(java.lang.String testFileName, int idxDeviceTouchInfoReply, int idxPortReply, int idxPasswordReply)
      reads packetData from a pcap dumped into a c array header file. The capture file should hold packets from the communication startup sequence and you have to provide the indices of these packets
      Parameters:
      testFileName -
      idxDeviceTouchInfoReply - index of the packet holding the reply with the info string about the communication partner
      idxPortReply - index of the packet holding the reply with the port used for communication by the partner
      idxPasswordReply - index of the packet holding the reply with the password used for communication by the partner
    • setDeviceInfoFromPacketData

      private void setDeviceInfoFromPacketData​(int idxDeviceTouchInfoReply, int idxPortReply, int idxPasswordReply)
      Parameters:
      idxDeviceTouchInfoReply - index of the packet holding the reply with the info string about the communication partner
      idxPortReply - index of the packet holding the reply with the port used for communication by the partner
      idxPasswordReply - index of the packet holding the reply with the password used for communication by the partner
    • readPCAPDumpHeaderFileIntoByteBufferArray

      private void readPCAPDumpHeaderFileIntoByteBufferArray​(java.lang.String pcapDumpHeaderFile)
      loads pcap dump of the communication flow between the S-Touch app and a compatible device. The dump need to be saved as "C" header file holding the packets as hexText bytes in "C" arrays. A hexText byte is the hexadecimal asci text representing the value of the transmitted byte. The size of the ByteBuffer has to match the Hex Stream in the file. No checks are done.
      Parameters:
      pcapDumpHeaderFile - path to the file that should be loaded
    • printByteArrayAsHex

      private void printByteArrayAsHex​(byte[] bytes)
    • byteArrayToDatagramPacket

      private FakeSTouchTest.PcapPacket byteArrayToDatagramPacket​(java.util.ArrayList<java.lang.Byte> bytes)
    • findSystaComfort

      @Test void findSystaComfort()
    • testCommunication

      @Test void testCommunication()
    • saveDisplayAsExcalidraw

      private void saveDisplayAsExcalidraw​(FakeSTouch stouch, java.lang.String filename)
      Save the objectTree from the display of the passed FakeSTouch as excalidraw.png-file
      Parameters:
      stouch -
      filename -
    • saveDisplayAsPNG

      private void saveDisplayAsPNG​(FakeSTouch stouch, java.lang.String filename)
      Save the objectTree from the display of the passed FakeSTouch as png-file
      Parameters:
      stouch -
      filename -