FileDocCategorySizeDatePackage
SdkCommandLineTest.javaAPI DocAndroid 1.5 API4491Wed May 06 22:41:10 BST 2009com.android.sdkmanager

SdkCommandLineTest

public class SdkCommandLineTest extends TestCase

Fields Summary
private MockStdLogger
mLog
Constructors Summary
Methods Summary
protected voidsetUp()

        mLog = new MockStdLogger();
        super.setUp();
    
protected voidtearDown()

        super.tearDown();
    
public final voidtestList_Avd_Verbose()
Test list

        MockSdkCommandLine c = new MockSdkCommandLine(mLog);
        c.parseArgs(new String[] { "-v", "list", "avd" });
        assertFalse(c.wasHelpCalled());
        assertFalse(c.wasExitCalled());
        assertEquals("list", c.getVerb());
        assertEquals("avd", c.getDirectObject());
        assertTrue(c.isVerbose());
    
public final voidtestList_Invalid()

        MockSdkCommandLine c = new MockSdkCommandLine(mLog);
        c.parseArgs(new String[] { "list", "unknown" });
        assertTrue(c.wasHelpCalled());
        assertTrue(c.wasExitCalled());
        assertEquals(null, c.getVerb());
        assertEquals(null, c.getDirectObject());
        assertFalse(c.isVerbose());
    
public final voidtestList_None()

        MockSdkCommandLine c = new MockSdkCommandLine(mLog);
        c.parseArgs(new String[] { "list" });
        assertFalse(c.wasHelpCalled());
        assertFalse(c.wasExitCalled());
        assertEquals("list", c.getVerb());
        assertEquals("", c.getDirectObject());
        assertFalse(c.isVerbose());
    
public final voidtestList_Plural()

        MockSdkCommandLine c = new MockSdkCommandLine(mLog);
        c.parseArgs(new String[] { "list", "avds" });
        assertFalse(c.wasHelpCalled());
        assertFalse(c.wasExitCalled());
        assertEquals("list", c.getVerb());
        // we get the non-plural form
        assertEquals("avd", c.getDirectObject());
        assertFalse(c.isVerbose());

        c = new MockSdkCommandLine(mLog);
        c.parseArgs(new String[] { "list", "targets" });
        assertFalse(c.wasHelpCalled());
        assertFalse(c.wasExitCalled());
        assertEquals("list", c.getVerb());
        // we get the non-plural form
        assertEquals("target", c.getDirectObject());
        assertFalse(c.isVerbose());
    
public final voidtestList_Target()

        MockSdkCommandLine c = new MockSdkCommandLine(mLog);
        c.parseArgs(new String[] { "list", "target" });
        assertFalse(c.wasHelpCalled());
        assertFalse(c.wasExitCalled());
        assertEquals("list", c.getVerb());
        assertEquals("target", c.getDirectObject());
        assertFalse(c.isVerbose());