File tree Expand file tree Collapse file tree
android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55import com .livio .BSON .BsonEncoder ;
66import com .smartdevicelink .protocol .enums .ControlFrameTags ;
7+ import com .smartdevicelink .test .TestValues ;
8+ import com .smartdevicelink .transport .enums .TransportType ;
9+ import com .smartdevicelink .transport .utl .TransportRecord ;
710
811import org .junit .Test ;
912import org .junit .runner .RunWith ;
1518
1619@ RunWith (AndroidJUnit4 .class )
1720public class SdlPacketTests {
18- //TODO: Add tests to cover other parts of SdlPacket class
1921
2022 // Test variables
2123 private final int TEST_HASH_ID = 65537 ;
@@ -43,9 +45,19 @@ public void testNull(){
4345 String tag = "hello" ;
4446
4547 SdlPacket sdlPacket = new SdlPacket ();
48+
4649 assertNull (sdlPacket .getTag (tag ));
4750 sdlPacket .setPayload (testPayload );
4851 assertEquals (sdlPacket .getTag ("hello" ),"world" );
52+
53+ assertEquals (1 , sdlPacket .getVersion ());
54+
55+ sdlPacket .setPriorityCoefficient (TestValues .GENERAL_INT );
56+ assertEquals (TestValues .GENERAL_INT , sdlPacket .getPrioirtyCoefficient ());
57+
58+ sdlPacket .setTransportRecord (new TransportRecord (TransportType .TCP , TestValues .GENERAL_STRING ));
59+ assertEquals (TransportType .TCP , sdlPacket .getTransportRecord ().getType ());
60+ assertEquals (TestValues .GENERAL_STRING , sdlPacket .getTransportRecord ().getAddress ());
4961 }
5062
5163 @ Test
You can’t perform that action at this time.
0 commit comments