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

VCardTestsBase

public abstract class VCardTestsBase extends android.test.AndroidTestCase
BaseClass for vCard unit tests with utility classes. Please do not add each unit test here.

Fields Summary
public static final int
V21
public static final int
V30
public static final int
V40
protected final android.content.ContentValues
mContentValuesForQP
protected final android.content.ContentValues
mContentValuesForSJis
protected final android.content.ContentValues
mContentValuesForUtf8
protected final android.content.ContentValues
mContentValuesForQPAndSJis
protected final android.content.ContentValues
mContentValuesForQPAndUtf8
protected final android.content.ContentValues
mContentValuesForBase64V21
protected final android.content.ContentValues
mContentValuesForBase64V30
protected com.android.vcard.tests.testutils.VCardVerifier
mVerifier
private boolean
mSkipVerification
true when we shouldn't call {@link VCardVerifier#verify()}.
Constructors Summary
public VCardTestsBase()


      
        super();
        // Not using constants in vCard code since it may be wrong.
        mContentValuesForQP = new ContentValues();
        mContentValuesForQP.put("ENCODING", "QUOTED-PRINTABLE");
        mContentValuesForSJis = new ContentValues();
        mContentValuesForSJis.put("CHARSET", "SHIFT_JIS");
        mContentValuesForUtf8 = new ContentValues();
        mContentValuesForUtf8.put("CHARSET", "UTF-8");
        mContentValuesForQPAndSJis = new ContentValues();
        mContentValuesForQPAndSJis.put("ENCODING", "QUOTED-PRINTABLE");
        mContentValuesForQPAndSJis.put("CHARSET", "SHIFT_JIS");
        mContentValuesForQPAndUtf8 = new ContentValues();
        mContentValuesForQPAndUtf8.put("ENCODING", "QUOTED-PRINTABLE");
        mContentValuesForQPAndUtf8.put("CHARSET", "UTF-8");
        mContentValuesForBase64V21 = new ContentValues();
        mContentValuesForBase64V21.put("ENCODING", "BASE64");
        mContentValuesForBase64V30 = new ContentValues();
        mContentValuesForBase64V30.put("ENCODING", "b");
    
Methods Summary
public final voidsetUp()
Calls super's {@link #setUp()} and prepares {@link VCardVerifier}. We call {@link VCardVerifier#verify()} on {@link #tearDown()}.

        super.setUp();
        mVerifier = new VCardVerifier(this);
        mSkipVerification = false;
    
public final voidtearDown()
Calls super's {@link #tearDown()} and {@link VCardVerifier#verify()}.

        // We don't want to forget to call verify() as it makes unit test successful silently even
        // when it shouldn't be, while each test case tends become so large to manage and sometimes
        // we had forgotten to call the method. That is why we override setUp()/tearDown() here.
        if (!mSkipVerification) {
            mVerifier.verify();
        }
        super.tearDown();
    
public voidtestAndroidTestCaseSetupProperly()

        super.testAndroidTestCaseSetupProperly();
        mSkipVerification = true;