FileDocCategorySizeDatePackage
WebkitTest.javaAPI DocAndroid 1.5 API2080Wed May 06 22:42:02 BST 2009com.android.unit_tests

WebkitTest

public class WebkitTest extends android.test.AndroidTestCase

Fields Summary
private static final String
LOGTAG
Constructors Summary
Methods Summary
public voidtestDateSorter()


    
         
        /**
         * Note: check the logging output manually to test
         * nothing automated yet, besides object creation
         */
        DateSorter dateSorter = new DateSorter(mContext);
        Date date = new Date();

        for (int i = 0; i < DateSorter.DAY_COUNT; i++) {
            Log.i(LOGTAG, "Boundary " + i + " " + dateSorter.getBoundary(i));
            Log.i(LOGTAG, "Label " + i + " " + dateSorter.getLabel(i));
        }

        Calendar c = Calendar.getInstance();
        long time = c.getTimeInMillis();
        int index;
        Log.i(LOGTAG, "now: " + dateSorter.getIndex(time));
        for (int i = 0; i < 20; i++) {
            time -= 8 * 60 * 60 * 1000; // 8 hours
            date.setTime(time);
            c.setTime(date);
            index = dateSorter.getIndex(time);
            Log.i(LOGTAG, "time: " + DateFormat.format("yyyy/MM/dd kk:mm:ss", c).toString() +
                    " " + index + " " + dateSorter.getLabel(index));
        }