Package org.jnode.shell.syntax

Examples of org.jnode.shell.syntax.SequenceSyntax.format()


    @org.junit.Test
    public void testFormat() {
        Test test = new Test();
        Syntax syntax1 = new SequenceSyntax(new ArgumentSyntax("fileArg"));
        Assert.assertEquals("<fileArg>", syntax1.format(test.getArgumentBundle()));
        Syntax syntax2 =
                new SequenceSyntax(new RepeatSyntax(new ArgumentSyntax("fileArg")),
                        new ArgumentSyntax("intArg"));
        Assert.assertEquals("[ <fileArg> ... ] <intArg>", syntax2.format(test.getArgumentBundle()));
        Syntax syntax3 = new SequenceSyntax();
View Full Code Here


        Syntax syntax1 = new SequenceSyntax(new ArgumentSyntax("fileArg"));
        Assert.assertEquals("<fileArg>", syntax1.format(test.getArgumentBundle()));
        Syntax syntax2 =
                new SequenceSyntax(new RepeatSyntax(new ArgumentSyntax("fileArg")),
                        new ArgumentSyntax("intArg"));
        Assert.assertEquals("[ <fileArg> ... ] <intArg>", syntax2.format(test.getArgumentBundle()));
        Syntax syntax3 = new SequenceSyntax();
        Assert.assertEquals("", syntax3.format(test.getArgumentBundle()));
    }

    @org.junit.Test
View Full Code Here

        Syntax syntax2 =
                new SequenceSyntax(new RepeatSyntax(new ArgumentSyntax("fileArg")),
                        new ArgumentSyntax("intArg"));
        Assert.assertEquals("[ <fileArg> ... ] <intArg>", syntax2.format(test.getArgumentBundle()));
        Syntax syntax3 = new SequenceSyntax();
        Assert.assertEquals("", syntax3.format(test.getArgumentBundle()));
    }

    @org.junit.Test
    public void testOne() throws Exception {
        TestShell shell = new TestShell();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.