Examples of MethodDef


Examples of com.thoughtworks.qdox.parser.structs.MethodDef

        setupLex(Parser.BRACECLOSE);
        setupLex(0);

        // expectations
        MethodDef mth = new MethodDef();
        mth.name = "count";
        mth.returns = "int";
        mth.dimensions = 1;
        FieldDef p1 = new FieldDef();
        p1.name = "p1";
View Full Code Here

Examples of com.thoughtworks.qdox.parser.structs.MethodDef

        setupLex(Parser.BRACECLOSE);
        setupLex(0);

        // expectations
        MethodDef mth = new MethodDef();
        mth.name = "count";
        mth.returns = "int";
        mth.dimensions = 0;
        FieldDef p1 = new FieldDef();
        p1.name = "p1";
View Full Code Here

Examples of com.thoughtworks.qdox.parser.structs.MethodDef

        setupLex(Parser.BRACECLOSE);
        setupLex(0);

        // expectations
        MethodDef mth = new MethodDef();
        mth.name = "count";
        mth.returns = "int";
        mth.dimensions = 1;
        FieldDef p1 = new FieldDef();
        p1.name = "p1";
View Full Code Here

Examples of com.thoughtworks.qdox.parser.structs.MethodDef

        assertEquals("public", modifiers[1]);
    }

    public void testAddMethodsToCorrectClass() throws Exception {
        builder.beginClass(new ClassDef());
        builder.addMethod(new MethodDef());
        builder.endClass();

        builder.beginClass(new ClassDef());
        builder.addMethod(new MethodDef());
        builder.addMethod(new MethodDef());
        builder.addMethod(new MethodDef());
        builder.endClass();

        builder.beginClass(new ClassDef());
        builder.addMethod(new MethodDef());
        builder.addMethod(new MethodDef());
        builder.endClass();

        JavaSource source = builder.getSource();
        assertEquals(1, source.getClasses()[0].getMethods().length);
        assertEquals(3, source.getClasses()[1].getMethods().length);
View Full Code Here

Examples of com.thoughtworks.qdox.parser.structs.MethodDef

        ClassDef innerDef = new ClassDef();
        innerDef.name = "Inner";
        builder.beginClass(innerDef);

        MethodDef fooDef = new MethodDef();
        fooDef.name = "foo";
        builder.addMethod(fooDef);
        builder.endClass();

        MethodDef barDef = new MethodDef();
        barDef.name = "bar";
        builder.addMethod(barDef);
        builder.endClass();

        JavaSource source = builder.getSource();
View Full Code Here

Examples of com.thoughtworks.qdox.parser.structs.MethodDef

        assertEquals("foo", innerClass.getMethods()[0].getName());
    }

    public void testSimpleMethod() throws Exception {
        builder.beginClass(new ClassDef());
        MethodDef mth = new MethodDef();
        mth.name = "doSomething";
        mth.returns = "void";
        builder.addMethod(mth);
        builder.endClass();
View Full Code Here

Examples of com.thoughtworks.qdox.parser.structs.MethodDef

        assertEquals(0, doSomething.getExceptions().length);
    }

    public void testMethodNoArray() throws Exception {
        builder.beginClass(new ClassDef());
        MethodDef mth = new MethodDef();
        mth.name = "doSomething";
        mth.returns = "void";
        mth.dimensions = 0;
        builder.addMethod(mth);
        builder.endClass();
View Full Code Here

Examples of com.thoughtworks.qdox.parser.structs.MethodDef

        assertEquals(0, result.getReturns().getDimensions());
    }

    public void testMethod1dArray() throws Exception {
        builder.beginClass(new ClassDef());
        MethodDef mth = new MethodDef();
        mth.name = "doSomething";
        mth.returns = "void";
        mth.dimensions = 1;
        builder.addMethod(mth);
        builder.endClass();
View Full Code Here

Examples of com.thoughtworks.qdox.parser.structs.MethodDef

        assertEquals(1, result.getReturns().getDimensions());
    }

    public void testMethod2dArray() throws Exception {
        builder.beginClass(new ClassDef());
        MethodDef mth = new MethodDef();
        mth.name = "doSomething";
        mth.returns = "void";
        mth.dimensions = 2;
        builder.addMethod(mth);
        builder.endClass();
View Full Code Here

Examples of com.thoughtworks.qdox.parser.structs.MethodDef

        assertEquals(2, result.getReturns().getDimensions());
    }

    public void testMethodParameters() throws Exception {
        builder.beginClass(new ClassDef());
        MethodDef mth = new MethodDef();

        FieldDef f1 = new FieldDef();
        f1.name = "count";
        f1.type = "int";
        f1.modifiers.add("final");
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.