Package ch.uzh.ifi.seal.changedistiller.structuredifferencing.java

Examples of ch.uzh.ifi.seal.changedistiller.structuredifferencing.java.JavaStructureNode


    @Test
    public void structureTreeWithDefaultConstructorShouldBeCreated() throws Exception {
        fSnippet = getCompilationUnit("Clazz() {}");
        createStructureTree();
        JavaStructureNode constructorNode = fRoot.getChildren().get(0).getChildren().get(0);
        assertThat(constructorNode.getType(), is(Type.CONSTRUCTOR));
        assertThat(constructorNode.getName(), is("Clazz()"));
        assertThat(constructorNode.getFullyQualifiedName(), is("Clazz.Clazz()"));
    }
View Full Code Here


    @Test
    public void structureTreeWithConstructorShouldBeCreated() throws Exception {
        fSnippet = getCompilationUnit("Clazz(int a) {}");
        createStructureTree();
        JavaStructureNode constructorNode = fRoot.getChildren().get(0).getChildren().get(0);
        assertThat(constructorNode.getType(), is(Type.CONSTRUCTOR));
        assertThat(constructorNode.getName(), is("Clazz(int)"));
        assertThat(constructorNode.getFullyQualifiedName(), is("Clazz.Clazz(int)"));
    }
View Full Code Here

    @Test
    public void structureTreeWithMethodShouldBeCreated() throws Exception {
        fSnippet = getCompilationUnit("void method() {}");
        createStructureTree();
        JavaStructureNode methodNode = fRoot.getChildren().get(0).getChildren().get(1);
        assertThat(methodNode.getType(), is(Type.METHOD));
        assertThat(methodNode.getName(), is("method()"));
        assertThat(methodNode.getFullyQualifiedName(), is("Clazz.method()"));
    }
View Full Code Here

    @Test
    public void structureTreeWithMethodWithReturnTypeShouldBeCreated() throws Exception {
        fSnippet = getCompilationUnit("int method() {}");
        createStructureTree();
        JavaStructureNode methodNode = fRoot.getChildren().get(0).getChildren().get(1);
        assertThat(methodNode.getType(), is(Type.METHOD));
        assertThat(methodNode.getName(), is("method()"));
        assertThat(methodNode.getFullyQualifiedName(), is("Clazz.method()"));
    }
View Full Code Here

    @Test
    public void structureTreeWithMethodWithParametersShouldBeCreated() throws Exception {
        fSnippet = getCompilationUnit("void method(String name, int length) {}");
        createStructureTree();
        JavaStructureNode methodNode = fRoot.getChildren().get(0).getChildren().get(1);
        assertThat(methodNode.getType(), is(Type.METHOD));
        assertThat(methodNode.getName(), is("method(String,int)"));
        assertThat(methodNode.getFullyQualifiedName(), is("Clazz.method(String,int)"));
    }
View Full Code Here

    @Test
    public void structureTreeWithQualifiedClassShouldBeCreated() throws Exception {
        fSnippet = "package org.foo;\nclass Clazz {}";
        createStructureTree();
        JavaStructureNode classNode = fRoot.getChildren().get(0);
        assertThat(classNode.getType(), is(Type.CLASS));
        assertThat(classNode.getName(), is("Clazz"));
        assertThat(classNode.getFullyQualifiedName(), is("org.foo.Clazz"));
    }
View Full Code Here

    }

    @Override
    public JavaStructureNode createStructureTree() {
        CompilationUnitDeclaration cu = fCompilation.getCompilationUnit();
        JavaStructureNode node = new JavaStructureNode(Type.CU, null, null, cu);
        cu.traverse(new JavaStructureTreeBuilder(node), (CompilationUnitScope) null);
        return node;
    }
View Full Code Here

TOP

Related Classes of ch.uzh.ifi.seal.changedistiller.structuredifferencing.java.JavaStructureNode

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.