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

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


        assertNodesAreNotMatched(whileStatementLeft, whileStatementRight);
    }

    @Test
    public void unchangedNodesOnDifferentPositionsShouldMatch() throws Exception {
        Node whileStatementLeft = addToLeft(WHILE_STATEMENT, "i < length");
        Node forStatementRight = addToRight(FOR_STATEMENT, "j < length");
        Node whileStatementRight = addToNode(forStatementRight, WHILE_STATEMENT, "i < length");
        addToNode(whileStatementLeft, METHOD_INVOCATION, "foo.bar();");
        addToNode(whileStatementLeft, ASSIGNMENT, "aInt = 24;");
        addToNode(whileStatementRight, METHOD_INVOCATION, "foo.bar();");
        addToNode(whileStatementRight, ASSIGNMENT, "aInt = 24;");
        createMatchSet();
View Full Code Here


        assertNodesAreMatched(whileStatementLeft, whileStatementRight);
    }

    @Test
    public void unchangedNodesButDifferentLeavesShouldNotMatch() throws Exception {
        Node whileStatementLeft = addToLeft(WHILE_STATEMENT, "i < length");
        Node whileStatementRight = addToRight(WHILE_STATEMENT, "i < length");
        addToNode(whileStatementLeft, CONSTRUCTOR_INVOCATION, "foo.bar();");
        addToNode(whileStatementLeft, ASSIGNMENT, "aInt = 24;");
        addToNode(whileStatementRight, METHOD_INVOCATION, "foo.bar();");
        addToNode(whileStatementRight, VARIABLE_DECLARATION_STATEMENT, "int aInt = 24;");
        createMatchSet();
View Full Code Here

        assertNodesAreNotMatched(whileStatementLeft, whileStatementRight);
    }

    @Test
    public void changedNodesShouldMatch() throws Exception {
        Node whileStatementLeft = addToLeft(WHILE_STATEMENT, "i < length");
        Node whileStatementRight = addToRight(WHILE_STATEMENT, "i < size");
        addToNode(whileStatementLeft, METHOD_INVOCATION, "foo.bar();");
        addToNode(whileStatementLeft, ASSIGNMENT, "aInt = 24;");
        addToNode(whileStatementRight, METHOD_INVOCATION, "foo.bar();");
        addToNode(whileStatementRight, ASSIGNMENT, "aInt = 24;");
        createMatchSet();
View Full Code Here

        assertNodesAreMatched(whileStatementLeft, whileStatementRight);
    }

    @Test
    public void unchangedNodesAmongManyNodesShouldMatch() throws Exception {
        Node whileStatementLeft = addToLeft(WHILE_STATEMENT, "i < length");
        addToLeft(FOR_STATEMENT, "j < length");
        addToRight(FOREACH_STATEMENT, "j < size");
        Node whileStatementRight = addToRight(WHILE_STATEMENT, "i < length");
        addToNode(whileStatementLeft, METHOD_INVOCATION, "foo.bar();");
        addToNode(whileStatementLeft, ASSIGNMENT, "aInt = 24;");
        addToNode(whileStatementRight, METHOD_INVOCATION, "foo.bar();");
        addToNode(whileStatementRight, ASSIGNMENT, "aInt = 24;");
        createMatchSet();
View Full Code Here

public class WhenLeavesAreMatched extends WhenTreeNodesAreMatched {

    @Test
    public void unchangedLeavesShouldMatch() throws Exception {
        Node methodInvocationLeft = addToLeft(METHOD_INVOCATION, "foo.bar();");
        Node methodInvocationRight = addToRight(METHOD_INVOCATION, "foo.bar();");
        createMatchSet();
        assertLeavesAreMatched(methodInvocationLeft, methodInvocationRight);
    }
View Full Code Here

        assertLeavesAreMatched(methodInvocationLeft, methodInvocationRight);
    }

    @Test
    public void leavesWithDifferentLabelsShoudlNotMatch() throws Exception {
        Node methodInvocationLeft = addToLeft(CONSTRUCTOR_INVOCATION, "foo.bar();");
        Node methodInvocationRight = addToRight(METHOD_INVOCATION, "foo.bar();");
        createMatchSet();
        assertLeavesAreNotMatched(methodInvocationLeft, methodInvocationRight);
    }
View Full Code Here

        assertLeavesAreNotMatched(methodInvocationLeft, methodInvocationRight);
    }

    @Test
    public void unchangedLeavesOnDifferentPositionsShouldMatch() throws Exception {
        Node methodInvocationLeft = addToLeft(METHOD_INVOCATION, "foo.bar();");
        Node ifStatement = addToRight(IF_STATEMENT, "true");
        Node methodInvocationRight = addToNode(ifStatement, METHOD_INVOCATION, "foo.bar();");
        createMatchSet();
        assertLeavesAreMatched(methodInvocationLeft, methodInvocationRight);
    }
View Full Code Here

        assertLeavesAreMatched(methodInvocationLeft, methodInvocationRight);
    }

    @Test
    public void unchangedLeavesAmongManyLeavesShouldMatch() throws Exception {
        Node methodInvocationLeft = addToLeft(METHOD_INVOCATION, "foo.bar();");
        addToLeft(ASSIGNMENT, "a = b;");
        addToRight(RETURN_STATEMENT, "return b;");
        Node methodInvocationRight = addToRight(METHOD_INVOCATION, "foo.bar();");
        createMatchSet();
        assertLeavesAreMatched(methodInvocationLeft, methodInvocationRight);
    }
View Full Code Here

        assertLeavesAreMatched(methodInvocationLeft, methodInvocationRight);
    }

    @Test
    public void changedButSimilarLeavesShouldMatch() throws Exception {
        Node methodInvocationLeft = addToLeft(METHOD_INVOCATION, "foo.bar();");
        Node methodInvocationRight = addToRight(METHOD_INVOCATION, "foo.bear();");
        createMatchSet();
        assertLeavesAreMatched(methodInvocationLeft, methodInvocationRight);
    }
View Full Code Here

        assertLeavesAreMatched(methodInvocationLeft, methodInvocationRight);
    }

    @Test
    public void changedButSimilarLeavesAmongManyLeavesShouldMatch() throws Exception {
        Node methodInvocationLeft = addToLeft(METHOD_INVOCATION, "foo.bar();");
        addToLeft(JavaEntityType.ASSIGNMENT, "a = b;");
        addToRight(JavaEntityType.RETURN_STATEMENT, "return b;");
        Node methodInvocationRight = addToRight(JavaEntityType.METHOD_INVOCATION, "foo.bear();");
        createMatchSet();
        assertLeavesAreMatched(methodInvocationLeft, methodInvocationRight);
    }
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.