FileDocCategorySizeDatePackage
IncludeTest.javaAPI DocAndroid 1.5 API2986Wed May 06 22:42:02 BST 2009com.android.frameworktest.view

IncludeTest

public class IncludeTest extends android.test.ActivityInstrumentationTestCase

Fields Summary
Constructors Summary
public IncludeTest()

        super("com.android.frameworktest", Include.class);
    
Methods Summary
public voidsetUp()

        super.setUp();
    
public voidtestIncluded()

        final Include activity = getActivity();

        final View button1 = activity.findViewById(R.id.included_button);
        assertNotNull("The layout include_button was not included", button1);

        final View button2 = activity.findViewById(R.id.included_button_overriden);
        assertNotNull("The layout include_button was not included with overriden id", button2);
    
public voidtestIncludedWithLayoutParams()

        final Include activity = getActivity();

        final View button1 = activity.findViewById(R.id.included_button);
        final View button2 = activity.findViewById(R.id.included_button_overriden);

        assertTrue("Both buttons should have different width",
                button1.getLayoutParams().width != button2.getLayoutParams().width);
        assertTrue("Both buttons should have different height",
                button1.getLayoutParams().height != button2.getLayoutParams().height);
    
public voidtestIncludedWithSize()

        final Include activity = getActivity();
        final View button1 = activity.findViewById(R.id.included_button_with_size);

        final ViewGroup.LayoutParams lp = button1.getLayoutParams();
        assertEquals("Included button should be 23dip x 23dip", 23, lp.width);
        assertEquals("Included button should be 23dip x 23dip", 23, lp.height);
    
public voidtestIncludedWithVisibility()

        final Include activity = getActivity();
        final View button1 = activity.findViewById(R.id.included_button_visibility);

        assertEquals("Included button should be invisible", View.INVISIBLE, button1.getVisibility());