FileDocCategorySizeDatePackage
ListWithOnItemSelectedActionTest.javaAPI DocAndroid 1.5 API2187Wed May 06 22:42:02 BST 2009com.android.frameworktest.listview.arrowscroll

ListWithOnItemSelectedActionTest

public class ListWithOnItemSelectedActionTest extends android.test.ActivityInstrumentationTestCase

Fields Summary
private android.widget.ListView
mListView
Constructors Summary
public ListWithOnItemSelectedActionTest()

        super("com.android.frameworktest", ListWithOnItemSelectedAction.class);
    
Methods Summary
private java.lang.StringgetValueOfSelectedTextView()

        return ((TextView) mListView.getSelectedView()).getText().toString();
    
protected voidsetUp()

        super.setUp();
        mListView = getActivity().getListView();
    
public voidtestHeaderEchoesSelectionAfterMove()

        sendKeys(KeyEvent.KEYCODE_DPAD_DOWN);

        assertEquals(1, mListView.getSelectedItemPosition());
        assertEquals("header text field should be echoing contents of selected item",
                getValueOfSelectedTextView(),
                getActivity().getHeaderValue());
    
public voidtestPreconditions()

        assertEquals(0, mListView.getSelectedItemPosition());
        assertEquals("header text field should be echoing contents of selected item",
                getValueOfSelectedTextView(),
                getActivity().getHeaderValue());