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

NavigationMethodQualifierTest

public class NavigationMethodQualifierTest extends TestCase

Fields Summary
private FolderConfiguration
config
private NavigationMethodQualifier
nmq
Constructors Summary
Methods Summary
public voidsetUp()

        super.setUp();
        config = new FolderConfiguration();
        nmq = new NavigationMethodQualifier();
    
protected voidtearDown()

        super.tearDown();
        config = null;
        nmq = null;
    
public voidtestDPad()

        assertEquals(true, nmq.checkAndSet("dpad", config)); //$NON-NLS-1$
        assertTrue(config.getNavigationMethodQualifier() != null);
        assertEquals(NavigationMethodQualifier.NavigationMethod.DPAD,
                config.getNavigationMethodQualifier().getValue());
        assertEquals("dpad", config.getNavigationMethodQualifier().toString()); //$NON-NLS-1$
    
public voidtestFailures()

        assertEquals(false, nmq.checkAndSet("", config));//$NON-NLS-1$
        assertEquals(false, nmq.checkAndSet("WHEEL", config));//$NON-NLS-1$
        assertEquals(false, nmq.checkAndSet("other", config));//$NON-NLS-1$
    
public voidtestTrackball()

        assertEquals(true, nmq.checkAndSet("trackball", config)); //$NON-NLS-1$
        assertTrue(config.getNavigationMethodQualifier() != null);
        assertEquals(NavigationMethodQualifier.NavigationMethod.TRACKBALL,
                config.getNavigationMethodQualifier().getValue());
        assertEquals("trackball", config.getNavigationMethodQualifier().toString()); //$NON-NLS-1$
    
public voidtestWheel()

        assertEquals(true, nmq.checkAndSet("wheel", config)); //$NON-NLS-1$
        assertTrue(config.getNavigationMethodQualifier() != null);
        assertEquals(NavigationMethodQualifier.NavigationMethod.WHEEL,
                config.getNavigationMethodQualifier().getValue());
        assertEquals("wheel", config.getNavigationMethodQualifier().toString()); //$NON-NLS-1$