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

LinkifyTest

public class LinkifyTest extends android.test.AndroidTestCase
LinkifyTest tests {@link Linkify}.

Fields Summary
Constructors Summary
Methods Summary
public voidtestNormal()

        TextView tv;

        tv = new TextView(getContext());
        tv.setAutoLinkMask(Linkify.ALL);
        tv.setText("Hey, foo@google.com, call 415-555-1212.");

        assertTrue(tv.getMovementMethod() instanceof LinkMovementMethod);
        assertTrue(tv.getUrls().length == 2);
    
public voidtestNothing()

        TextView tv;

        tv = new TextView(getContext());
        tv.setText("Hey, foo@google.com, call 415-555-1212.");

        assertFalse(tv.getMovementMethod() instanceof LinkMovementMethod);
        assertTrue(tv.getUrls().length == 0);
    
public voidtestUnclickable()

        TextView tv;

        tv = new TextView(getContext());
        tv.setAutoLinkMask(Linkify.ALL);
        tv.setLinksClickable(false);
        tv.setText("Hey, foo@google.com, call 415-555-1212.");

        assertFalse(tv.getMovementMethod() instanceof LinkMovementMethod);
        assertTrue(tv.getUrls().length == 2);