Search in sources :

Example 1 with Suppress

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

the class SocketTest method disable_testConnectWithIP4IPAddr.

// Regression test for issue 1018016, connecting ignored a set timeout.
//
// Disabled because test behaves differently depending on networking
// environment. It works fine in the emulator and one the device with
// WLAN, but when 3G comes into play, the possible existence of a
// proxy makes it fail.
//
//    @LargeTest
//    public void testSocketSetSOTimeout() throws IOException {
//        Socket sock = new Socket();
//        int timeout = 5000;
//        long start = System.currentTimeMillis();
//        try {
//            sock.connect(new InetSocketAddress(NON_EXISTING_ADDRESS, 80), timeout);
//        } catch (SocketTimeoutException e) {
//            // expected
//            long delay = System.currentTimeMillis() - start;
//            if (Math.abs(delay - timeout) > 1000) {
//                fail("timeout was not accurate. expected: " + timeout
//                        + " actual: " + delay + " miliseconds.");
//            }
//        } finally {
//            try {
//                sock.close();
//            } catch (IOException ioe) {
//                // ignore
//            }
//        }
//    }
/**
     * Regression test for 1062928: Dotted IP addresses (e.g., 192.168.100.1)
     * appear to be broken in the M5 SDK.
     * 
     * Tests that a connection given a ip-addressv4 such as 192.168.100.100 does
     * not fail - sdk m5 seems only to accept dns names instead of ip numbers.
     * ip 209.85.129.147 (one address of www.google.com) on port 80 (http) is
     * used to test the connection.
     */
// Commenting out this test since it is flaky, even at the best of times.  See
// #1191317 for Info.
@Suppress
public void disable_testConnectWithIP4IPAddr() {
    // call a Google Web server
    InetSocketAddress scktAddrss = new InetSocketAddress(KNOW_GOOD_ADDRESS, 80);
    Socket clntSckt = new Socket();
    try {
        clntSckt.connect(scktAddrss, 5000);
    } catch (Throwable e) {
        fail("connection problem:" + e.getClass().getName() + ": " + e.getMessage());
    } finally {
        try {
            clntSckt.close();
        } catch (Exception e) {
        // ignore
        }
    }
}
Also used : InetSocketAddress(java.net.InetSocketAddress) Socket(java.net.Socket) ServerSocket(java.net.ServerSocket) IOException(java.io.IOException) SocketException(java.net.SocketException) SocketTimeoutException(java.net.SocketTimeoutException) Suppress(android.test.suitebuilder.annotation.Suppress)

Example 2 with Suppress

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

the class NetworkStatsHistoryTest method testFuzzing.

@Suppress
public void testFuzzing() throws Exception {
    try {
        // fuzzing with random events, looking for crashes
        final NetworkStats.Entry entry = new NetworkStats.Entry();
        final Random r = new Random();
        for (int i = 0; i < 500; i++) {
            stats = new NetworkStatsHistory(r.nextLong());
            for (int j = 0; j < 10000; j++) {
                if (r.nextBoolean()) {
                    // add range
                    final long start = r.nextLong();
                    final long end = start + r.nextInt();
                    entry.rxBytes = nextPositiveLong(r);
                    entry.rxPackets = nextPositiveLong(r);
                    entry.txBytes = nextPositiveLong(r);
                    entry.txPackets = nextPositiveLong(r);
                    entry.operations = nextPositiveLong(r);
                    stats.recordData(start, end, entry);
                } else {
                    // trim something
                    stats.removeBucketsBefore(r.nextLong());
                }
            }
            assertConsistent(stats);
        }
    } catch (Throwable e) {
        Log.e(TAG, String.valueOf(stats));
        throw new RuntimeException(e);
    }
}
Also used : Random(java.util.Random) Suppress(android.test.suitebuilder.annotation.Suppress)

Example 3 with Suppress

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

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 4 with Suppress

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

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 5 with Suppress

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

the class FilesActivityUiTest method testDownload_Queued.

// We don't really need to test the entirety of download support
// since downloads is (almost) just another provider.
@Suppress
public void testDownload_Queued() throws Exception {
    DownloadManager dm = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
    // This downloads ends up being queued (because DNS can't be resolved).
    // We'll still see an entry in the downloads UI with a "Queued" label.
    dm.enqueue(new Request(Uri.parse("http://hammychamp.toodles")));
    bots.roots.openRoot("Downloads");
    bots.directory.assertDocumentsPresent("Queued");
}
Also used : Request(android.app.DownloadManager.Request) DownloadManager(android.app.DownloadManager) Suppress(android.test.suitebuilder.annotation.Suppress)

Aggregations

Suppress (android.test.suitebuilder.annotation.Suppress)199 MediumTest (android.test.suitebuilder.annotation.MediumTest)73 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)15 ContentValues (android.content.ContentValues)13 NetworkStats (android.net.NetworkStats)13 Uri (android.net.Uri)13 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