diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-05-13 17:27:46 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-05-13 17:35:48 +0200 |
commit | 9f539f1c1343cc47d1bea8f750a1cf319facf42b (patch) | |
tree | c3da5650971741840bb6aeea32f573b910a8b814 /test | |
parent | efb09d0f74aa792dc453b379112c37b780a9ddf1 (diff) |
submit: Implement parsing of the submit SM message
Not all attribute classes have all the attributes specified. The
SMPPValueHolder routines for parsing/writing were not tested/executed
and might contain issues. The sm_length/short_message was combined
into a single attribute as it is more like a LV. The question if
the >>readFrom:with: should read the length or not is something that
keeps on coming up. I need to have a more sane way of handling that.
Diffstat (limited to 'test')
-rw-r--r-- | test/SMPPMessageTest.st | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/SMPPMessageTest.st b/test/SMPPMessageTest.st index 08caac9..77a58fa 100644 --- a/test/SMPPMessageTest.st +++ b/test/SMPPMessageTest.st @@ -52,6 +52,22 @@ TestCase subclass: SMPPMessageTest [ 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r06] ] + exampleSubmitSM [ + ^#[16r00 16r00 16r00 16r61 16r00 16r00 16r00 16r04 + 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r04 + 16r00 16r01 16r01 16r39 16r32 16r32 16r35 16r30 + 16r30 16r31 16r00 16r01 16r01 16r34 16r30 16r30 + 16r39 16r39 16r39 16r31 16r36 16r00 16r02 16r00 + 16r00 16r00 16r00 16r00 16r00 16r00 16r00 16r31 + 16r44 16r69 16r65 16r73 16r20 16r69 16r73 16r74 + 16r20 16r65 16r69 16r6E 16r65 16r20 16r54 16r65 + 16r73 16r74 16r6E 16r61 16r63 16r68 16r72 16r69 + 16r63 16r68 16r74 16r21 16r20 16r20 16r32 16r30 + 16r31 16r34 16r2D 16r30 16r33 16r2D 16r30 16r31 + 16r5F 16r31 16r36 16r2E 16r34 16r30 16r2E 16r34 + 16r32] + ] + testReadMessage [ | msg | msg := SMPPMessage readFrom: self examplePdu readStream. @@ -112,4 +128,13 @@ TestCase subclass: SMPPMessageTest [ msg := SMPPMessage readFrom: self exampleUnbind readStream. self assert: msg body class equals: SMPPUnbind. ] + + testSubmitSM [ + | msg | + msg := SMPPMessage readFrom: self exampleSubmitSM readStream. + self assert: msg body class equals:SMPPSubmitSM. + self assert: msg body shortMessage equals: 'Dies ist eine Testnachricht! 2014-03-01_16.40.42'. + self assert: msg body sourceAddress equals: '9225001'. + self assert: msg body destinationAddress equals: '40099916'. + ] ] |