Package ch.uzh.ifi.seal.changedistiller.treedifferencing

Examples of ch.uzh.ifi.seal.changedistiller.treedifferencing.Node


    public void methodDeclarationWithJavadocShouldBeConverted() throws Exception {
        fSnippet = "/**\n * A method\n */\nvoid method() {}";
        prepareCompilation();
        convertMethod("method");
        assertThat(getTreeString(), is("method { /**\n * A method\n */,,method: void,,, }"));
        Node javadoc = getFirstChild();
        assertThat(getSource(javadoc), is("/**\n * A method\n */"));
        assertThat(javadoc.getLabel(), is(JavaEntityType.JAVADOC));
    }
View Full Code Here


    public void typeDeclarationWithTypeArgumentShouldBeConverted() throws Exception {
        fSnippet = "class Bar<T> {}";
        prepareCompilation();
        convertClass("Bar");
        assertThat(getTreeString(), is("Bar { , { T }, }"));
        Node typeArguments = getTypeParameters();
        assertThat(getSource(typeArguments), is("T"));
        assertThat(typeArguments.getLabel(), is(JavaEntityType.TYPE_PARAMETERS));
        Node typeArgument = (Node) typeArguments.getFirstLeaf();
        assertThat(getSource(typeArgument), is("T"));
        assertThat(typeArgument.getLabel(), is(JavaEntityType.TYPE_PARAMETER));
    }
View Full Code Here

    public void typeDeclarationWithMultipleTypeArgumentsShouldBeConverted() throws Exception {
        fSnippet = "class Bar<T,U> {}";
        prepareCompilation();
        convertClass("Bar");
        assertThat(getTreeString(), is("Bar { , { T,U }, }"));
        Node typeArguments = getTypeParameters();
        assertThat(getSource(typeArguments), is("T,U"));
        assertThat(typeArguments.getLabel(), is(JavaEntityType.TYPE_PARAMETERS));
        Node firstTypeArgument = (Node) typeArguments.getFirstLeaf();
        assertThat(getSource(firstTypeArgument), is("T"));
        assertThat(firstTypeArgument.getLabel(), is(JavaEntityType.TYPE_PARAMETER));
        Node secondTypeArgument = (Node) firstTypeArgument.getNextSibling();
        assertThat(getSource(secondTypeArgument), is("U"));
        assertThat(secondTypeArgument.getLabel(), is(JavaEntityType.TYPE_PARAMETER));
    }
View Full Code Here

    public void typeDeclarationWithBoundedTypeArgumentShouldBeConverted() throws Exception {
        fSnippet = "class Bar<T extends Number> {}";
        prepareCompilation();
        convertClass("Bar");
        assertThat(getTreeString(), is("Bar { , { T extends Number }, }"));
        Node typeArguments = getTypeParameters();
        assertThat(typeArguments.getLabel(), is(JavaEntityType.TYPE_PARAMETERS));
        assertThat(getSource(typeArguments), is("T extends Number"));
        Node typeArgument = (Node) typeArguments.getFirstLeaf();
        assertThat(getSource(typeArgument), is("T extends Number"));
        assertThat(typeArgument.getLabel(), is(JavaEntityType.TYPE_PARAMETER));
    }
View Full Code Here

    public void typeDeclarationWithMultipleBoundedTypeArgumentShouldBeConverted() throws Exception {
        fSnippet = "class Bar<T extends Number & Serializable> {}";
        prepareCompilation();
        convertClass("Bar");
        assertThat(getTreeString(), is("Bar { , { T extends Number & Serializable }, }"));
        Node typeArguments = getTypeParameters();
        assertThat(getSource(typeArguments), is("T extends Number & Serializable"));
        assertThat(typeArguments.getLabel(), is(JavaEntityType.TYPE_PARAMETERS));
        Node typeArgument = (Node) typeArguments.getFirstLeaf();
        assertThat(getSource(typeArgument), is("T extends Number & Serializable"));
        assertThat(typeArgument.getLabel(), is(JavaEntityType.TYPE_PARAMETER));
    }
View Full Code Here

    public void typeDeclarationWithSuperTypeShouldBeConverted() throws Exception {
        fSnippet = "class Bar extends Number {}";
        prepareCompilation();
        convertClass("Bar");
        assertThat(getTreeString(), is("Bar { ,,Number, }"));
        Node superType = (Node) getLastChild().getPreviousSibling();
        assertThat(getSource(superType), is("Number"));
        assertThat(superType.getLabel(), is(JavaEntityType.SINGLE_TYPE));
    }
View Full Code Here

    public void typeDeclarationWithSuperInterfaceShouldBeConverted() throws Exception {
        fSnippet = "class Bar implements Number {}";
        prepareCompilation();
        convertClass("Bar");
        assertThat(getTreeString(), is("Bar { ,, { Number } }"));
        Node superInterfaces = getLastChild();
        assertThat(getSource(superInterfaces), is("Number"));
        assertThat(superInterfaces.getLabel(), is(JavaEntityType.SUPER_INTERFACE_TYPES));
        Node superInterface = (Node) superInterfaces.getFirstLeaf();
        assertThat(getSource(superInterface), is("Number"));
        assertThat(superInterface.getLabel(), is(JavaEntityType.SINGLE_TYPE));
    }
View Full Code Here

    public void typeDeclarationWithMultipleSuperInterfacesShouldBeConverted() throws Exception {
        fSnippet = "class Bar implements Number, Serializable {}";
        prepareCompilation();
        convertClass("Bar");
        assertThat(getTreeString(), is("Bar { ,, { Number,Serializable } }"));
        Node superInterfaces = getLastChild();
        assertThat(getSource(superInterfaces), is("Number, Serializable"));
        assertThat(superInterfaces.getLabel(), is(JavaEntityType.SUPER_INTERFACE_TYPES));
        Node firstSuperInterface = (Node) superInterfaces.getFirstLeaf();
        assertThat(getSource(firstSuperInterface), is("Number"));
        assertThat(firstSuperInterface.getLabel(), is(JavaEntityType.SINGLE_TYPE));
        Node secondSuperInterface = (Node) firstSuperInterface.getNextSibling();
        assertThat(getSource(secondSuperInterface), is("Serializable"));
        assertThat(secondSuperInterface.getLabel(), is(JavaEntityType.SINGLE_TYPE));
    }
View Full Code Here

    public void typeDeclarationWithJavadocShouldBeConverted() throws Exception {
        fSnippet = "/**\n * A class\n */\nclass Bar {}";
        prepareCompilation();
        convertClass("Bar");
        assertThat(getTreeString(), is("Bar { /**\n * A class\n */,,, }"));
        Node javadoc = getFirstChild();
        assertThat(getSource(javadoc), is("/**\n * A class\n */"));
        assertThat(javadoc.getLabel(), is(JavaEntityType.JAVADOC));
    }
View Full Code Here

        concatedModifiers = concatedModifiers.trim();
        assertThat(getSource(modifiers), is(concatedModifiers));
        assertThat(modifiers.getLabel(), is(JavaEntityType.MODIFIERS));
        int i = 0;
        for (Enumeration<Node> e = modifiers.children(); e.hasMoreElements(); i++) {
            Node modifier = e.nextElement();
            assertThat(getSource(modifier), is(modifierNames[i]));
            assertThat(modifier.getLabel(), is(JavaEntityType.MODIFIER));
        }
    }
View Full Code Here

TOP

Related Classes of ch.uzh.ifi.seal.changedistiller.treedifferencing.Node

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.