Search in sources :

Example 76 with Suppress

use of android.test.suitebuilder.annotation.Suppress in project android_frameworks_base by AOSPA.

the class TimeTest method disableTestGetJulianDay.

@Suppress
public void disableTestGetJulianDay() throws Exception {
    Time time = new Time();
    // same Julian day.
    for (int monthDay = 1; monthDay <= 366; monthDay++) {
        for (int zoneIndex = 0; zoneIndex < mTimeZones.length; zoneIndex++) {
            // We leave the "month" as zero because we are changing the
            // "monthDay" from 1 to 366.  The call to normalize() will
            // then change the "month" (but we don't really care).
            time.set(0, 0, 0, monthDay, 0, 2008);
            time.timezone = mTimeZones[zoneIndex];
            long millis = time.normalize(true);
            if (zoneIndex == 0) {
                Log.i("TimeTest", time.format("%B %d, %Y"));
            }
            // This is the Julian day for 12am for this day of the year
            int julianDay = Time.getJulianDay(millis, time.gmtoff);
            // Julian day.
            for (int hour = 0; hour < 24; hour++) {
                for (int minute = 0; minute < 60; minute += 15) {
                    time.set(0, minute, hour, monthDay, 0, 2008);
                    millis = time.normalize(true);
                    int day = Time.getJulianDay(millis, time.gmtoff);
                    if (day != julianDay) {
                        Log.e("TimeTest", "Julian day: " + day + " at time " + time.hour + ":" + time.minute + " != today's Julian day: " + julianDay + " timezone: " + time.timezone);
                    }
                    assertEquals(day, julianDay);
                }
            }
        }
    }
}
Also used : Time(android.text.format.Time) Suppress(android.test.suitebuilder.annotation.Suppress)

Example 77 with Suppress

use of android.test.suitebuilder.annotation.Suppress in project android_frameworks_base by AOSPA.

the class TimeTest method disableTestSetJulianDay.

@Suppress
public void disableTestSetJulianDay() throws Exception {
    Time time = new Time();
    // test that we can set the Julian day correctly.
    for (int monthDay = 1; monthDay <= 366; monthDay++) {
        for (int zoneIndex = 0; zoneIndex < mTimeZones.length; zoneIndex++) {
            // We leave the "month" as zero because we are changing the
            // "monthDay" from 1 to 366.  The call to normalize() will
            // then change the "month" (but we don't really care).
            time.set(0, 0, 0, monthDay, 0, 2008);
            time.timezone = mTimeZones[zoneIndex];
            long millis = time.normalize(true);
            if (zoneIndex == 0) {
                Log.i("TimeTest", time.format("%B %d, %Y"));
            }
            int julianDay = Time.getJulianDay(millis, time.gmtoff);
            time.setJulianDay(julianDay);
            // Some places change daylight saving time at 12am and so there
            // is no 12am on some days in some timezones.  In those cases,
            // the time is set to 1am.
            // Examples: Africa/Cairo on April 25, 2008
            //  America/Sao_Paulo on October 12, 2008
            //  Atlantic/Azores on March 30, 2008
            assertTrue(time.hour == 0 || time.hour == 1);
            assertEquals(0, time.minute);
            assertEquals(0, time.second);
            millis = time.toMillis(false);
            int day = Time.getJulianDay(millis, time.gmtoff);
            if (day != julianDay) {
                Log.i("TimeTest", "Error: gmtoff " + (time.gmtoff / 3600.0) + " day " + julianDay + " millis " + millis + " " + time.format("%B %d, %Y") + " " + time.timezone);
            }
            assertEquals(day, julianDay);
        }
    }
}
Also used : Time(android.text.format.Time) Suppress(android.test.suitebuilder.annotation.Suppress)

Example 78 with Suppress

use of android.test.suitebuilder.annotation.Suppress in project android_frameworks_base by AOSPA.

the class AppCacheTest method testFreeApplicationCacheAllFiles.

@LargeTest
// Failing.
@Suppress
public void testFreeApplicationCacheAllFiles() throws Exception {
    boolean TRACKING = true;
    StatFs st = new StatFs("/data");
    long blks1 = getFreeStorageBlks(st);
    long availableMem = getFreeStorageSize(st);
    File cacheDir = mContext.getCacheDir();
    assertNotNull(cacheDir);
    createTestFiles1(cacheDir, "testtmpdir", 5);
    long blks2 = getFreeStorageBlks(st);
    if (localLOGV || TRACKING)
        Log.i(TAG, "blk1=" + blks1 + ", blks2=" + blks2);
    //this should free up the test files that were created earlier
    if (!invokePMFreeApplicationCache(availableMem)) {
        fail("Could not successfully invoke PackageManager free app cache API");
    }
    long blks3 = getFreeStorageBlks(st);
    if (localLOGV || TRACKING)
        Log.i(TAG, "blks3=" + blks3);
    verifyTestFiles1(cacheDir, "testtmpdir", 5);
}
Also used : StatFs(android.os.StatFs) File(java.io.File) Suppress(android.test.suitebuilder.annotation.Suppress) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Example 79 with Suppress

use of android.test.suitebuilder.annotation.Suppress in project android_frameworks_base by AOSPA.

the class MediaPlayerInvokeTest method testPing.

// Generate a random number, sends it to the ping test player.
@Suppress
@MediumTest
public void testPing() throws Exception {
    mPlayer.setDataSource("test:invoke_mock_media_player.so?url=ping");
    Parcel request = mPlayer.newRequest();
    Parcel reply = Parcel.obtain();
    int val = rnd.nextInt();
    request.writeInt(val);
    mPlayer.invoke(request, reply);
    assertEquals(val, reply.readInt());
}
Also used : Parcel(android.os.Parcel) Suppress(android.test.suitebuilder.annotation.Suppress) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 80 with Suppress

use of android.test.suitebuilder.annotation.Suppress in project android_frameworks_base by DirtyUnicorns.

the class TimeTest method disableTestSetJulianDay.

@Suppress
public void disableTestSetJulianDay() throws Exception {
    Time time = new Time();
    // test that we can set the Julian day correctly.
    for (int monthDay = 1; monthDay <= 366; monthDay++) {
        for (int zoneIndex = 0; zoneIndex < mTimeZones.length; zoneIndex++) {
            // We leave the "month" as zero because we are changing the
            // "monthDay" from 1 to 366.  The call to normalize() will
            // then change the "month" (but we don't really care).
            time.set(0, 0, 0, monthDay, 0, 2008);
            time.timezone = mTimeZones[zoneIndex];
            long millis = time.normalize(true);
            if (zoneIndex == 0) {
                Log.i("TimeTest", time.format("%B %d, %Y"));
            }
            int julianDay = Time.getJulianDay(millis, time.gmtoff);
            time.setJulianDay(julianDay);
            // Some places change daylight saving time at 12am and so there
            // is no 12am on some days in some timezones.  In those cases,
            // the time is set to 1am.
            // Examples: Africa/Cairo on April 25, 2008
            //  America/Sao_Paulo on October 12, 2008
            //  Atlantic/Azores on March 30, 2008
            assertTrue(time.hour == 0 || time.hour == 1);
            assertEquals(0, time.minute);
            assertEquals(0, time.second);
            millis = time.toMillis(false);
            int day = Time.getJulianDay(millis, time.gmtoff);
            if (day != julianDay) {
                Log.i("TimeTest", "Error: gmtoff " + (time.gmtoff / 3600.0) + " day " + julianDay + " millis " + millis + " " + time.format("%B %d, %Y") + " " + time.timezone);
            }
            assertEquals(day, julianDay);
        }
    }
}
Also used : Time(android.text.format.Time) Suppress(android.test.suitebuilder.annotation.Suppress)

Aggregations

Suppress (android.test.suitebuilder.annotation.Suppress)191 MediumTest (android.test.suitebuilder.annotation.MediumTest)69 ServiceStatus (com.vodafone360.people.service.ServiceStatus)39 Cursor (android.database.Cursor)29 Contact (com.vodafone360.people.datatypes.Contact)28 ArrayList (java.util.ArrayList)26 SmallTest (android.test.suitebuilder.annotation.SmallTest)17 ContactDetail (com.vodafone360.people.datatypes.ContactDetail)16 Intent (android.content.Intent)15 LargeTest (android.test.suitebuilder.annotation.LargeTest)14 ContentValues (android.content.ContentValues)13 NetworkStats (android.net.NetworkStats)13 Uri (android.net.Uri)12 Time (android.text.format.Time)12 Random (java.util.Random)12 DatabaseHelper (com.vodafone360.people.database.DatabaseHelper)11 IEngineEventCallback (com.vodafone360.people.engine.IEngineEventCallback)11 IContactSyncCallback (com.vodafone360.people.engine.contactsync.IContactSyncCallback)11 ProcessorFactory (com.vodafone360.people.engine.contactsync.ProcessorFactory)11 DownloadManager (android.app.DownloadManager)10