FileDocCategorySizeDatePackage
SignatureTest.javaAPI DocAndroid 5.1 API6534Thu Mar 12 22:22:12 GMT 2015android.content.pm

SignatureTest

public class SignatureTest extends TestCase

Fields Summary
private static final Signature
A
Cert A with valid syntax
private static final Signature
M
Cert A with malformed syntax
private static final Signature
B
Cert B with valid syntax
Constructors Summary
Methods Summary
private static Signature[]asArray(Signature s)

        return s;
    
public voidtestEffectiveMatch()

        assertTrue(Signature.areEffectiveMatch(asArray(A), asArray(A)));
        assertTrue(Signature.areEffectiveMatch(asArray(M), asArray(M)));

        assertFalse(Signature.areEffectiveMatch(asArray(A), asArray(B)));
        assertTrue(Signature.areEffectiveMatch(asArray(A), asArray(M)));
        assertTrue(Signature.areEffectiveMatch(asArray(M), asArray(A)));

        assertTrue(Signature.areEffectiveMatch(asArray(A, M), asArray(M, A)));
        assertTrue(Signature.areEffectiveMatch(asArray(A, B), asArray(M, B)));
        assertFalse(Signature.areEffectiveMatch(asArray(A, M), asArray(A, B)));
    
public voidtestExactlyEqual()


         
        assertTrue(Signature.areExactMatch(asArray(A), asArray(A)));
        assertTrue(Signature.areExactMatch(asArray(M), asArray(M)));

        assertFalse(Signature.areExactMatch(asArray(A), asArray(B)));
        assertFalse(Signature.areExactMatch(asArray(A), asArray(M)));
        assertFalse(Signature.areExactMatch(asArray(M), asArray(A)));

        assertTrue(Signature.areExactMatch(asArray(A, M), asArray(M, A)));