Examples of JavaStructureNode


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

    @Test
    public void structureTreeWithQualifiedFieldShouldBeCreated() throws Exception {
        fSnippet = getQualifiedCompilationUnit("private int fInteger = 12;");
        createStructureTree();
        JavaStructureNode fieldNode = fRoot.getChildren().get(0).getChildren().get(0);
        assertThat(fieldNode.getType(), is(Type.FIELD));
        assertThat(fieldNode.getName(), is("fInteger : int"));
        assertThat(fieldNode.getFullyQualifiedName(), is("org.foo.Clazz.fInteger : int"));
    }
View Full Code Here

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

    @Test
    public void structureTreeWithQualifiedConstructorShouldBeCreated() throws Exception {
        fSnippet = getQualifiedCompilationUnit("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("org.foo.Clazz.Clazz()"));
    }
View Full Code Here

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

    @Test
    public void structureTreeWithQualifiedMethodShouldBeCreated() throws Exception {
        fSnippet = getQualifiedCompilationUnit("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("org.foo.Clazz.method(String,int)"));
    }
View Full Code Here

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

    }

    private void createStructureTree() {
        JavaCompilation compilation = CompilationUtils.compileSource(fSnippet);
        CompilationUnitDeclaration cu = compilation.getCompilationUnit();
        fRoot = new JavaStructureNode(Type.CU, null, null, cu);
        cu.traverse(new JavaStructureTreeBuilder(fRoot), (CompilationUnitScope) null);
    }
View Full Code Here

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

    }

    private JavaStructureNode createStructureTree(String source) {
        JavaCompilation compilation = CompilationUtils.compileSource(source);
        CompilationUnitDeclaration cu = compilation.getCompilationUnit();
        JavaStructureNode root = new JavaStructureNode(Type.CU, null, null, cu);
        cu.traverse(new JavaStructureTreeBuilder(root), (CompilationUnitScope) null);
        return root;
    }
View Full Code Here

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

    @Test
    public void structureTreeWithClassShouldBeCreated() throws Exception {
        fSnippet = "class Clazz {}";
        createStructureTree();
        JavaStructureNode classNode = fRoot.getChildren().get(0);
        assertThat(classNode.getType(), is(Type.CLASS));
        assertNameCorrectness(classNode, "Clazz");
    }
View Full Code Here

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

    @Test
    public void structureTreeWithInterfaceShouldBeCreated() throws Exception {
        fSnippet = "interface Type {}";
        createStructureTree();
        JavaStructureNode classNode = fRoot.getChildren().get(0);
        assertThat(classNode.getType(), is(Type.INTERFACE));
        assertNameCorrectness(classNode, "Type");
    }
View Full Code Here

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

    @Test
    public void structureTreeWithAnnotationShouldBeCreated() throws Exception {
        fSnippet = "@interface Annotation {}";
        createStructureTree();
        JavaStructureNode classNode = fRoot.getChildren().get(0);
        assertThat(classNode.getType(), is(Type.ANNOTATION));
        assertNameCorrectness(classNode, "Annotation");
    }
View Full Code Here

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

    @Test
    public void structureTreeWithEnumShouldBeCreated() throws Exception {
        fSnippet = "enum Enumeration {}";
        createStructureTree();
        JavaStructureNode classNode = fRoot.getChildren().get(0);
        assertThat(classNode.getType(), is(Type.ENUM));
        assertNameCorrectness(classNode, "Enumeration");
    }
View Full Code Here

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

    @Test
    public void structureTreeWithFieldShouldBeCreated() throws Exception {
        fSnippet = getCompilationUnit("private int fInteger = 12;");
        createStructureTree();
        JavaStructureNode fieldNode = fRoot.getChildren().get(0).getChildren().get(0);
        assertThat(fieldNode.getType(), is(Type.FIELD));
        assertThat(fieldNode.getName(), is("fInteger : int"));
        assertThat(fieldNode.getFullyQualifiedName(), is("Clazz.fInteger : int"));
    }
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.