Package net.sourceforge.argparse4j.mock

Examples of net.sourceforge.argparse4j.mock.MockArgument


    @Test
    public void testConvert() throws ArgumentParserException {
        ConstructorArgumentType<Integer> at = new ConstructorArgumentType<Integer>(Integer.class);
        assertEquals((Integer)100, at.convert(null, null, "100"));
        try {
            at.convert(null, new MockArgument(), "0x100");
            fail();
        } catch(ArgumentParserException e) {
        }
    }
View Full Code Here


    @Test
    public void testConvert() throws ArgumentParserException {
        EnumArgumentType<Foo> type = new EnumArgumentType<Foo>(Foo.class);
        assertEquals(Foo.BRAVO, type.convert(null, null, "BRAVO"));
        try {
            type.convert(null, new MockArgument(), "DELTA");
        } catch (ArgumentParserException e) {
            assertEquals(
                    "argument null: could not convert 'DELTA' (choose from {ALPHA,BRAVO,CHARLIE})",
                    e.getMessage());
        }
View Full Code Here

    private MockArgument ma;

    @Before
    public void setup() throws Exception {
        ma = new MockArgument();
    }
View Full Code Here

        file = new FileArgumentType().verifyCanRead().acceptSystemIn()
                .convert(null, null, "-");
        assertEquals("-", file.getName());
        try {
            new FileArgumentType().verifyCanRead().convert(null,
                    new MockArgument(), "-");
        } catch (ArgumentParserException e) {
            assertEquals(
                    "argument null: Insufficient permissions to read file: '-'",
                    e.getMessage());
        }
View Full Code Here

TOP

Related Classes of net.sourceforge.argparse4j.mock.MockArgument

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.