Review Email tests annotations (small/medium/large) and change some annotations based on time.

Fix an NPE appearing when running the test suite.

BUG: 1566281, 1910409.
This commit is contained in:
Mihai Preda 2009-06-18 12:16:28 -07:00
parent aeeefedb43
commit a492673609
6 changed files with 11 additions and 9 deletions

View File

@ -115,7 +115,7 @@ public abstract class Store {
if (xmlEventType == XmlResourceParser.START_TAG &&
"store".equals(xml.getName())) {
String xmlScheme = xml.getAttributeValue(null, "scheme");
if (scheme.startsWith(xmlScheme)) {
if (scheme != null && scheme.startsWith(xmlScheme)) {
StoreInfo result = new StoreInfo();
result.mScheme = xmlScheme;
result.mClassName = xml.getAttributeValue(null, "class");

View File

@ -21,7 +21,7 @@ import com.android.email.mail.Store;
import android.content.Context;
import android.content.SharedPreferences;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.SmallTest;
import android.test.suitebuilder.annotation.MediumTest;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@ -34,7 +34,7 @@ import java.io.ObjectOutputStream;
*
* Technically these are functional because they use the underlying preferences framework.
*/
@SmallTest
@MediumTest
public class AccountUnitTests extends AndroidTestCase {
private Preferences mPreferences;

View File

@ -31,7 +31,7 @@ import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.test.ActivityInstrumentationTestCase2;
import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.LargeTest;
import android.view.View;
import android.widget.EditText;
@ -40,7 +40,7 @@ import android.widget.EditText;
*
* It might be possible to convert these to ActivityUnitTest, which would be faster.
*/
@MediumTest
@LargeTest
public class MessageComposeInstrumentationTests
extends ActivityInstrumentationTestCase2<MessageCompose> {

View File

@ -28,7 +28,7 @@ import android.content.Context;
import android.content.Intent;
import android.os.Environment;
import android.test.ActivityInstrumentationTestCase2;
import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.Suppress;
import android.webkit.WebView;
import android.widget.TextView;
@ -46,7 +46,7 @@ import java.util.Arrays;
*
* It might be possible to convert these to ActivityUnitTest, which would be faster.
*/
@MediumTest
@LargeTest
public class MessageViewTests
extends ActivityInstrumentationTestCase2<MessageView> {

View File

@ -22,6 +22,7 @@ import com.android.email.mail.MessagingException;
import com.android.email.mail.Message.RecipientType;
import android.test.suitebuilder.annotation.SmallTest;
import android.test.suitebuilder.annotation.MediumTest;
import java.io.ByteArrayOutputStream;
import java.text.ParseException;
@ -69,6 +70,7 @@ public class MimeMessageTest extends TestCase {
* @throws MessagingException
* @throws ParseException
*/
@MediumTest
public void testSetSentDate() throws MessagingException, ParseException {
Locale savedLocale = Locale.getDefault();
Locale.setDefault(Locale.US);

View File

@ -41,7 +41,7 @@ import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.SmallTest;
import android.test.suitebuilder.annotation.MediumTest;
import java.io.File;
import java.net.URI;
@ -53,7 +53,7 @@ import java.util.HashSet;
/**
* This is a series of unit tests for the LocalStore class.
*/
@SmallTest
@MediumTest
public class LocalStoreUnitTests extends AndroidTestCase {
private static final String dbName = "com.android.email.mail.store.LocalStoreUnitTests.db";