FileDocCategorySizeDatePackage
TouchScreenQualifierTest.javaAPI DocAndroid 1.5 API2628Wed May 06 22:41:10 BST 2009com.android.ide.eclipse.editors.resources.configurations

TouchScreenQualifierTest

public class TouchScreenQualifierTest extends TestCase

Fields Summary
private TouchScreenQualifier
tsq
private FolderConfiguration
config
Constructors Summary
Methods Summary
protected voidsetUp()

        super.setUp();
        tsq = new TouchScreenQualifier();
        config = new FolderConfiguration();
    
protected voidtearDown()

        super.tearDown();
        tsq = null;
        config = null;
    
public voidtestFailures()

        assertEquals(false, tsq.checkAndSet("", config));//$NON-NLS-1$
        assertEquals(false, tsq.checkAndSet("STYLUS", config));//$NON-NLS-1$
        assertEquals(false, tsq.checkAndSet("other", config));//$NON-NLS-1$
    
public voidtestFinger()

        assertEquals(true, tsq.checkAndSet("finger", config)); //$NON-NLS-1$
        assertTrue(config.getTouchTypeQualifier() != null);
        assertEquals(TouchScreenQualifier.TouchScreenType.FINGER,
                config.getTouchTypeQualifier().getValue());
        assertEquals("finger", config.getTouchTypeQualifier().toString()); //$NON-NLS-1$
    
public voidtestNoTouch()

        assertEquals(true, tsq.checkAndSet("notouch", config)); //$NON-NLS-1$
        assertTrue(config.getTouchTypeQualifier() != null);
        assertEquals(TouchScreenQualifier.TouchScreenType.NOTOUCH,
                config.getTouchTypeQualifier().getValue());
        assertEquals("notouch", config.getTouchTypeQualifier().toString()); //$NON-NLS-1$
    
public voidtestStylus()

        assertEquals(true, tsq.checkAndSet("stylus", config)); //$NON-NLS-1$
        assertTrue(config.getTouchTypeQualifier() != null);
        assertEquals(TouchScreenQualifier.TouchScreenType.STYLUS,
                config.getTouchTypeQualifier().getValue());
        assertEquals("stylus", config.getTouchTypeQualifier().toString()); //$NON-NLS-1$