FileDocCategorySizeDatePackage
ListWithFooterViewAndNewLabelsTest.javaAPI DocAndroid 5.1 API2254Thu Mar 12 22:22:12 GMT 2015android.widget.focus

ListWithFooterViewAndNewLabelsTest

public class ListWithFooterViewAndNewLabelsTest extends android.test.ActivityInstrumentationTestCase

Fields Summary
private android.widget.Button
mButton
private android.widget.ListAdapter
mAdapter
private android.widget.ListView
mListView
Constructors Summary
public ListWithFooterViewAndNewLabelsTest()

        super("com.android.frameworks.coretests",
                ListWithFooterViewAndNewLabels.class);
    
Methods Summary
public voidFAILING_testPreconditions()

        assertNotNull(mButton);
        assertNotNull(mAdapter);
        assertNotNull(mListView);

        assertTrue(mButton.hasFocus());
        assertEquals("expected list adapter to have 1 item",
                1, mAdapter.getCount());
        assertEquals("expected list view to have 2 items (1 in adapter, plus " 
                + "the footer view).",
                2, mListView.getCount());

        // fails here!!!
        assertEquals("Expecting the selected index to be 0, the first non footer "
                + "view item.",
                0, mListView.getSelectedItemPosition());
    
protected voidsetUp()

        super.setUp();

        ListWithFooterViewAndNewLabels a = getActivity();
        mButton = (Button) a.findViewById(R.id.button);
        mAdapter = a.getListAdapter();
        mListView = a.getListView();