Package barsuift.simLife.tree

Examples of barsuift.simLife.tree.MockTreeBranchPart


public class TreeGrowthTest extends TestCase {

    public void testExecuteCyclicStep() {
        MockTreeLeaf mockLeaf = new MockTreeLeaf();

        MockTreeBranchPart mockBranchPart = new MockTreeBranchPart();
        mockBranchPart.addLeaf(mockLeaf);

        MockTreeBranch mockBranch = new MockTreeBranch();
        mockBranch.addPart(mockBranchPart);

        MockTree mockTree = new MockTree();
        mockTree.addBranch(mockBranch);

        TreeGrowth treeGrowth = new TreeGrowth(UtilDataCreatorForTests.createSpecificConditionalTaskState(), mockTree);
        treeGrowth.executeConditionalStep();

        assertEquals(1, mockLeaf.getNbImproveEfficiencyCalled());

        assertEquals(1, mockBranchPart.getNbGrowCalled());
    }
View Full Code Here


    private TreeBranchPart3DState part3DState;

    protected void setUp() throws Exception {
        super.setUp();
        mockBranchPart = new MockTreeBranchPart();
        nbLeaves = 5;
        for (int index = 0; index < nbLeaves; index++) {
            MockTreeLeaf mockLeaf = new MockTreeLeaf();
            mockLeaf.getTreeLeaf3D().getState().setTransform(DisplayDataCreatorForTests.createRandomTransform3DState());
            mockBranchPart.addLeaf(mockLeaf);
View Full Code Here

        nbParts = 5;
        previousPartEndPoints = new ArrayList<Point3dState>();
        Point3dState partEndPoint = new Point3dState();
        for (int index = 0; index < nbParts; index++) {
            previousPartEndPoints.add(partEndPoint);
            MockTreeBranchPart mockBranchPart = new MockTreeBranchPart();
            partEndPoint = DisplayDataCreatorForTests.createRandomPointState();
            MockTreeBranchPart3D mockBranchPart3D = (MockTreeBranchPart3D) mockBranchPart.getBranchPart3D();
            mockBranchPart3D.getState().setEndPoint(partEndPoint);
            mockBranchPart3D.setEndPoint(partEndPoint.toPointValue());
            mockBranch.addPart(mockBranchPart);
        }
        mockUniverse3D = new MockUniverse3D();
View Full Code Here

    private TreeBranchPart3DState part3DState;

    protected void setUp() throws Exception {
        super.setUp();
        mockBranchPart = new MockTreeBranchPart();
        nbLeaves = 5;
        for (int index = 0; index < nbLeaves; index++) {
            MockTreeLeaf mockLeaf = new MockTreeLeaf();
            mockLeaf.getTreeLeaf3D().getState().setRotation(Randomizer.randomRotation());
            mockLeaf.getTreeLeaf3D().getState().setLeafAttachPoint(DisplayDataCreatorForTests.createRandomPointState());
View Full Code Here

        nbParts = 5;
        previousPartEndPoints = new ArrayList<Tuple3dState>();
        Tuple3dState partEndPoint = new Tuple3dState();
        for (int index = 0; index < nbParts; index++) {
            previousPartEndPoints.add(partEndPoint);
            MockTreeBranchPart mockBranchPart = new MockTreeBranchPart();
            partEndPoint = DisplayDataCreatorForTests.createRandomTupleState();
            MockTreeBranchPart3D mockBranchPart3D = (MockTreeBranchPart3D) mockBranchPart.getBranchPart3D();
            mockBranchPart3D.getState().setEndPoint(partEndPoint);
            mockBranchPart3D.setEndPoint(partEndPoint.toPointValue());
            mockBranch.addPart(mockBranchPart);
        }
        mockUniverse3D = new MockUniverse3D();
View Full Code Here

    private TreeBranchPart3DState part3DState;

    protected void setUp() throws Exception {
        super.setUp();
        mockBranchPart = new MockTreeBranchPart();
        nbLeaves = 5;
        for (int index = 0; index < nbLeaves; index++) {
            MockTreeLeaf mockLeaf = new MockTreeLeaf();
            mockLeaf.getTreeLeaf3D().getState().setRotation(Randomizer.randomRotation());
            mockLeaf.getTreeLeaf3D().getState().setLeafAttachPoint(DisplayDataCreatorForTests.createRandomTupleState());
View Full Code Here

TOP

Related Classes of barsuift.simLife.tree.MockTreeBranchPart

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.