FileDocCategorySizeDatePackage
PropertyNodesVerifier.javaAPI DocAndroid 5.1 API3013Thu Mar 12 22:22:54 GMT 2015com.android.vcard.tests.testutils

PropertyNodesVerifier

public class PropertyNodesVerifier extends VNodeBuilder

Fields Summary
private final List
mPropertyNodesVerifierElemList
private final android.test.AndroidTestCase
mAndroidTestCase
private int
mIndex
Constructors Summary
public PropertyNodesVerifier(android.test.AndroidTestCase testCase)

        super();
        mPropertyNodesVerifierElemList = new ArrayList<PropertyNodesVerifierElem>();
        mAndroidTestCase = testCase;
    
Methods Summary
public PropertyNodesVerifierElemaddPropertyNodesVerifierElem()

        PropertyNodesVerifierElem elem = new PropertyNodesVerifierElem(mAndroidTestCase);
        mPropertyNodesVerifierElemList.add(elem);
        return elem;
    
public voidonEntryEnded()

        mPropertyNodesVerifierElemList.get(mIndex).verify(getCurrentVNode());
        super.onEntryEnded();
        mIndex++;
    
public voidonEntryStarted()

        super.onEntryStarted();
        AndroidTestCase.assertTrue(mIndex < mPropertyNodesVerifierElemList.size());
    
public voidverify(int resId, int vcardType)

        verify(mAndroidTestCase.getContext().getResources().openRawResource(resId), vcardType);
    
public voidverify(int resId, int vcardType, com.android.vcard.VCardParser parser)

        verify(mAndroidTestCase.getContext().getResources().openRawResource(resId),
                vcardType, parser);
    
public voidverify(java.io.InputStream is, int vcardType)

        final VCardParser parser = VCardUtils.getAppropriateParser(vcardType);
        verify(is, vcardType, parser);
    
public voidverify(java.io.InputStream is, int vcardType, com.android.vcard.VCardParser parser)

        parser.addInterpreter(this);
        try {
            parser.parse(is);
        } finally {
            if (is != null) {
                try {
                    is.close();
                } catch (IOException e) {
                }
            }
        }