FileDocCategorySizeDatePackage
CellSpanTest.javaAPI DocAndroid 1.5 API2903Wed May 06 22:42:02 BST 2009com.android.frameworktest.layout.table

CellSpanTest

public class CellSpanTest extends android.test.ActivityInstrumentationTestCase
{@link com.android.frameworktest.layout.table.CellSpan} is setup to exercise tables in which cells use spanning.

Fields Summary
private android.view.View
mA
private android.view.View
mB
private android.view.View
mC
private android.view.View
mSpanThenCell
private android.view.View
mCellThenSpan
private android.view.View
mSpan
Constructors Summary
public CellSpanTest()

        super("com.android.frameworktest", CellSpan.class);
    
Methods Summary
protected voidsetUp()

        super.setUp();

        final CellSpan activity = getActivity();
        mA            = activity.findViewById(R.id.a);
        mB            = activity.findViewById(R.id.b);
        mC            = activity.findViewById(R.id.c);
        mSpanThenCell = activity.findViewById(R.id.spanThenCell);
        mCellThenSpan = activity.findViewById(R.id.cellThenSpan);
        mSpan         = activity.findViewById(R.id.span);
    
public voidtestCellThenSpan()

        int spanWidth = mB.getMeasuredWidth() + mC.getMeasuredWidth();
        assertEquals("cell followed by span is broken", spanWidth,
                mCellThenSpan.getMeasuredWidth());
    
public voidtestSetUpConditions()

        assertNotNull(mA);
        assertNotNull(mB);
        assertNotNull(mC);
        assertNotNull(mSpanThenCell);
        assertNotNull(mCellThenSpan);
        assertNotNull(mSpan);
    
public voidtestSpan()

        int spanWidth = mA.getMeasuredWidth() + mB.getMeasuredWidth() +
                mC.getMeasuredWidth();
        assertEquals("span is broken", spanWidth, mSpan.getMeasuredWidth());
    
public voidtestSpanThenCell()

        int spanWidth = mA.getMeasuredWidth() + mB.getMeasuredWidth();
        assertEquals("span followed by cell is broken", spanWidth,
                mSpanThenCell.getMeasuredWidth());