Package com.example.types

Examples of com.example.types.Tree


        Assert.assertEquals((long)0, (long)port.sum_tree(null));
    }

    @Test
    public void test_notset() throws Exception {
        Assert.assertEquals((long)0, (long)port.sum_tree(new Tree()));
    }
View Full Code Here


    }

    @Test
    public void test_null() throws Exception {
        Assert.assertEquals(
            (long)0, (long)port.sum_tree(new Tree(null, null, null)));
    }
View Full Code Here

    }

    @Test
    public void test_value() throws Exception {
        Assert.assertEquals(
            (long)10, (long)port.sum_tree(new Tree(10, null, null)));
    }
View Full Code Here

    }

    @Test
    public void test() throws Exception {
        Assert.assertEquals(
            (long)60, (long)port.sum_tree(new Tree(10,
                new Tree(20, null, null),
                new Tree(30, null, null)
            ))
        );
    }
View Full Code Here

public class GetTreeTestCase extends TestServiceTestCase {

    @Test
    public void test_null_ret() throws Exception {
        Tree r = port.get_tree(0);
        Assert.assertEquals(null, r);
    }
View Full Code Here

        Assert.assertEquals(null, r);
    }

    @Test
    public void test_notset() throws Exception {
        Tree r = port.get_tree(1);
        Assert.assertEquals((long)1, (long)r.getValue());
        Assert.assertEquals(null, r.getLeft());
        Assert.assertEquals(null, r.getRight());
    }
View Full Code Here

        Assert.assertEquals(null, r.getRight());
    }

    @Test
    public void test_null() throws Exception {
        Tree r = port.get_tree(2);
        Assert.assertEquals((long)2, (long)r.getValue());
        Assert.assertEquals(null, r.getLeft());
        Assert.assertEquals(null, r.getRight());
    }
View Full Code Here

        Assert.assertEquals(null, r.getRight());
    }

    @Test
    public void test() throws Exception {
        Tree r = port.get_tree(3);
        Assert.assertEquals((long)3, (long)r.getValue());
        Assert.assertEquals((long)4, (long)r.getLeft().getValue());
        Assert.assertEquals(null, r.getLeft().getLeft());
        Assert.assertEquals(null, r.getLeft().getRight());
        Assert.assertEquals((long)5, (long)r.getRight().getValue());
        Assert.assertEquals(null, r.getRight().getLeft());
        Assert.assertEquals(null, r.getRight().getRight());
    }
View Full Code Here

TOP

Related Classes of com.example.types.Tree

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.