Search in sources :

Example 6 with Asn1Node

use of com.android.internal.telephony.uicc.asn1.Asn1Node in project android_frameworks_opt_telephony by LineageOS.

the class Asn1NodeTest method testAsBytes_ConstructedTag.

@SmallTest
@Test(expected = IllegalStateException.class)
public void testAsBytes_ConstructedTag() throws InvalidAsn1DataException {
    Asn1Node node = Asn1Node.newBuilder(0xBF37).build();
    node.asBytes();
}
Also used : Asn1Node(com.android.internal.telephony.uicc.asn1.Asn1Node) SmallTest(android.test.suitebuilder.annotation.SmallTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 7 with Asn1Node

use of com.android.internal.telephony.uicc.asn1.Asn1Node in project android_frameworks_opt_telephony by LineageOS.

the class Asn1NodeTest method testAsLong_ConstructedTag.

@SmallTest
@Test(expected = IllegalStateException.class)
public void testAsLong_ConstructedTag() throws InvalidAsn1DataException {
    Asn1Node node = Asn1Node.newBuilder(0xBF37).build();
    node.asRawLong();
}
Also used : Asn1Node(com.android.internal.telephony.uicc.asn1.Asn1Node) SmallTest(android.test.suitebuilder.annotation.SmallTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 8 with Asn1Node

use of com.android.internal.telephony.uicc.asn1.Asn1Node in project android_frameworks_opt_telephony by LineageOS.

the class Asn1NodeTest method testAsString_ConstructedTag.

@SmallTest
@Test(expected = IllegalStateException.class)
public void testAsString_ConstructedTag() throws InvalidAsn1DataException {
    Asn1Node node = Asn1Node.newBuilder(0xBF37).build();
    node.asString();
}
Also used : Asn1Node(com.android.internal.telephony.uicc.asn1.Asn1Node) SmallTest(android.test.suitebuilder.annotation.SmallTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 9 with Asn1Node

use of com.android.internal.telephony.uicc.asn1.Asn1Node in project android_frameworks_opt_telephony by LineageOS.

the class Asn1NodeTest method testWriteToBytes.

@SmallTest
@Test
public void testWriteToBytes() throws InvalidAsn1DataException {
    final String nodeHex = "3031110312D687120F54686973206973206120746573742E310B13040422C4F0" + "1403FF00FF1501FF13040422C4F01403FF00FF";
    Asn1Node node = new Asn1Decoder(nodeHex).nextNode();
    // Writes the bytes before children accessed.
    assertEquals(nodeHex, node.toHex());
    // Writes the bytes after children accessed.
    node.getChildren();
    assertEquals(nodeHex, node.toHex());
}
Also used : Asn1Node(com.android.internal.telephony.uicc.asn1.Asn1Node) Asn1Decoder(com.android.internal.telephony.uicc.asn1.Asn1Decoder) SmallTest(android.test.suitebuilder.annotation.SmallTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 10 with Asn1Node

use of com.android.internal.telephony.uicc.asn1.Asn1Node in project android_frameworks_opt_telephony by LineageOS.

the class Asn1NodeTest method testCreateConstructedNodeWithShortTag.

@SmallTest
@Test
public void testCreateConstructedNodeWithShortTag() {
    Asn1Node node = Asn1Node.newBuilder(0x65).build();
    assertEquals(0x65, node.getTag());
    assertTrue(node.isConstructed());
    assertEquals(2, node.getEncodedLength());
    assertEquals(0, node.getDataLength());
    assertArrayEquals(new byte[] { 0x65, 0x00 }, node.toBytes());
}
Also used : Asn1Node(com.android.internal.telephony.uicc.asn1.Asn1Node) SmallTest(android.test.suitebuilder.annotation.SmallTest) Test(org.junit.Test) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Aggregations

Asn1Node (com.android.internal.telephony.uicc.asn1.Asn1Node)31 Test (org.junit.Test)23 SmallTest (android.test.suitebuilder.annotation.SmallTest)22 Asn1Decoder (com.android.internal.telephony.uicc.asn1.Asn1Decoder)10 RequestBuilder (com.android.internal.telephony.uicc.euicc.apdu.RequestBuilder)6 InvalidAsn1DataException (com.android.internal.telephony.uicc.asn1.InvalidAsn1DataException)3 EuiccProfileInfo (android.service.euicc.EuiccProfileInfo)2 EuiccNotification (android.telephony.euicc.EuiccNotification)2 TagNotFoundException (com.android.internal.telephony.uicc.asn1.TagNotFoundException)2 Nullable (android.annotation.Nullable)1 CarrierIdentifier (android.service.carrier.CarrierIdentifier)1 UiccAccessRule (android.telephony.UiccAccessRule)1 EuiccRulesAuthTable (android.telephony.euicc.EuiccRulesAuthTable)1 TelephonyTest (com.android.internal.telephony.TelephonyTest)1