@Test(groups = {"functional.encode", "subscriberInformation"}) public void testEncode() throws Exception { ExtBasicServiceCode extBasicServiceCode = new ExtBasicServiceCodeImpl( new ExtTeleserviceCodeImpl(TeleserviceCodeValue.allShortMessageServices)); ExtCwFeatureImpl extCwFeature = new ExtCwFeatureImpl(extBasicServiceCode, new ExtSSStatusImpl(true, true, false, false)); AsnOutputStream asnOS = new AsnOutputStream(); extCwFeature.encodeAll(asnOS); byte[] encodedData = asnOS.toByteArray(); assertTrue(Arrays.equals(data, encodedData)); }
@Test(groups = {"functional.decode", "subscriberInformation"}) public void testDecode() throws Exception { AsnInputStream ansIS = new AsnInputStream(data); int tag = ansIS.readTag(); assertEquals(tag, Tag.SEQUENCE); ExtCwFeatureImpl extCwFeature = new ExtCwFeatureImpl(); extCwFeature.decodeAll(ansIS); ExtBasicServiceCode extBasicServiceCode = extCwFeature.getBasicService(); assertEquals( extBasicServiceCode.getExtTeleservice().getTeleserviceCodeValue(), TeleserviceCodeValue.allShortMessageServices); ExtSSStatus extSSStatus = extCwFeature.getSsStatus(); assertTrue(extSSStatus.getBitQ()); assertTrue(extSSStatus.getBitP()); assertFalse(extSSStatus.getBitR()); assertFalse(extSSStatus.getBitA()); }