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

ScreenOrientationQualifierTest

public class ScreenOrientationQualifierTest extends TestCase

Fields Summary
private ScreenOrientationQualifier
soq
private FolderConfiguration
config
Constructors Summary
Methods Summary
protected voidsetUp()

        super.setUp();
        soq = new ScreenOrientationQualifier();
        config = new FolderConfiguration();
    
protected voidtearDown()

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

        assertEquals(false, soq.checkAndSet("", config));//$NON-NLS-1$
        assertEquals(false, soq.checkAndSet("PORT", config));//$NON-NLS-1$
        assertEquals(false, soq.checkAndSet("landscape", config));//$NON-NLS-1$
        assertEquals(false, soq.checkAndSet("portrait", config));//$NON-NLS-1$
        assertEquals(false, soq.checkAndSet("other", config));//$NON-NLS-1$
    
public voidtestLanscape()

        assertEquals(true, soq.checkAndSet("land", config)); //$NON-NLS-1$
        assertTrue(config.getScreenOrientationQualifier() != null);
        assertEquals(ScreenOrientationQualifier.ScreenOrientation.LANDSCAPE,
                config.getScreenOrientationQualifier().getValue());
        assertEquals("land", config.getScreenOrientationQualifier().toString()); //$NON-NLS-1$
    
public voidtestPortrait()

        assertEquals(true, soq.checkAndSet("port", config)); //$NON-NLS-1$
        assertTrue(config.getScreenOrientationQualifier() != null);
        assertEquals(ScreenOrientationQualifier.ScreenOrientation.PORTRAIT,
                config.getScreenOrientationQualifier().getValue());
        assertEquals("port", config.getScreenOrientationQualifier().toString()); //$NON-NLS-1$
    
public voidtestSquare()

        assertEquals(true, soq.checkAndSet("square", config)); //$NON-NLS-1$
        assertTrue(config.getScreenOrientationQualifier() != null);
        assertEquals(ScreenOrientationQualifier.ScreenOrientation.SQUARE,
                config.getScreenOrientationQualifier().getValue());
        assertEquals("square", config.getScreenOrientationQualifier().toString()); //$NON-NLS-1$