Package barsuift.simLife.tree

Examples of barsuift.simLife.tree.MockTree


        UniverseState state = factory.createRandomUniverseState();
        BasicUniverse universe = new BasicUniverse(state);
        assertEquals(state, universe.getState());
        assertSame(state, universe.getState());
        int nbTrees = universe.getState().getTrees().size();
        universe.addTree(new MockTree());
        assertEquals(state, universe.getState());
        assertSame(state, universe.getState());
        assertEquals(nbTrees + 1, universe.getState().getTrees().size());
    }
View Full Code Here



public class AgingTest extends TestCase {

    public void testExecuteCyclicStep() {
        MockTree mockTree = new MockTree();
        Aging aging = new Aging(UtilDataCreatorForTests.createSpecificConditionalTaskState(), mockTree);
        aging.executeConditionalStep();
        assertEquals(1, mockTree.getNbAgeCalled());
    }
View Full Code Here

        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());
View Full Code Here


public class PhotosynthesisTest extends TestCase {

    public void testExecuteCyclicStep() {
        MockTree mockTree = new MockTree();
        Photosynthesis photosynthesis = new Photosynthesis(
                UtilDataCreatorForTests.createSpecificConditionalTaskState(), mockTree);
        photosynthesis.executeConditionalStep();
        assertEquals(1, mockTree.getNbCollectSolarEnergyCalled());
    }
View Full Code Here

        BasicUniverse3D universe3D = new BasicUniverse3D(new Universe3DState(), new MockUniverse());
        Universe universe = new MockUniverse();
        MockTreeLeaf treeLeaf = new MockTreeLeaf();
        treeLeaf.setState(CoreDataCreatorForTests.createSpecificTreeLeafState());
        universe.addFallenLeaf(treeLeaf);
        MockTree tree = new MockTree();
        tree.setState(CoreDataCreatorForTests.createSpecificTreeState());
        universe.addTree(tree);
        universe3D.initFromUniverse(universe);

        assertTrue(universe3D.getElements3D().contains(universe.getEnvironment().getEnvironment3D().getGroup()));
        assertTrue(universe3D.getElements3D().contains(universe.getPhysics().getPhysics3D().getGroup()));

        Set<Node> elements3d = universe3D.getElements3D();
        assertNotNull(elements3d);
        assertEquals(4, elements3d.size());
        // the 3D node is added to a transform group, itself added to a branch group
        // that's why i test the parent of the parent
        // TODO 050. 032. the test will need to be fixed then
        assertTrue(elements3d.contains(tree.getTree3D().getBranchGroup().getParent().getParent()));
        assertTrue(elements3d.contains(treeLeaf.getTreeLeaf3D().getBranchGroup()));

    }
View Full Code Here

        BasicUniverse3D universe3D = new BasicUniverse3D();
        Universe universe = new MockUniverse();
        MockTreeLeaf treeLeaf = new MockTreeLeaf();
        treeLeaf.setState(CoreDataCreatorForTests.createSpecificTreeLeafState());
        universe.addFallenLeaf(treeLeaf);
        MockTree tree = new MockTree();
        tree.setState(CoreDataCreatorForTests.createSpecificTreeState());
        universe.addTree(tree);
        universe3D.initFromUniverse(universe);

        assertNotNull(universe3D.getLights());

        Set<Node> elements3d = universe3D.getElements3D();
        assertNotNull(elements3d);
        assertEquals(3, elements3d.size());
        // the 3D branch group is added to a transform group, itself added to a branch group
        // that's why i test the parent of the parent
        assertTrue(elements3d.contains(tree.getTree3D().getBranchGroup().getParent().getParent()));
        assertTrue(elements3d.contains(treeLeaf.getTreeLeaf3D().getBranchGroup().getParent().getParent()));

    }
View Full Code Here

    private Tree3DState tree3DState;

    protected void setUp() throws Exception {
        super.setUp();
        mockTree = new MockTree();
        nbBranches = 5;
        for (int index = 0; index < nbBranches; index++) {
            MockTreeBranch mockBranch = new MockTreeBranch();
            Point3dState translationVector = DisplayDataCreatorForTests.createRandomPointState();
            MockTreeBranch3D mockBranch3D = (MockTreeBranch3D) mockBranch.getBranch3D();
View Full Code Here

        BasicUniverse3D universe3D = new BasicUniverse3D();
        Universe universe = new MockUniverse();
        MockTreeLeaf treeLeaf = new MockTreeLeaf();
        treeLeaf.setState(CoreDataCreatorForTests.createSpecificTreeLeafState());
        universe.addFallenLeaf(treeLeaf);
        MockTree tree = new MockTree();
        tree.setState(CoreDataCreatorForTests.createSpecificTreeState());
        universe.addTree(tree);
        universe3D.initFromUniverse(universe);

        assertNotNull(universe3D.getLights());

        Set<Node> elements3d = universe3D.getElements3D();
        assertNotNull(elements3d);
        assertEquals(3, elements3d.size());
        // the 3D node is added to a transform group, itself added to a branch group
        // that's why i test the parent of the parent
        assertTrue(elements3d.contains(tree.getTree3D().getBranchGroup().getParent().getParent()));
        assertTrue(elements3d.contains(treeLeaf.getTreeLeaf3D().getNode().getParent().getParent()));

    }
View Full Code Here

    private Tree3DState tree3DState;

    protected void setUp() throws Exception {
        super.setUp();
        mockTree = new MockTree();
        nbBranches = 5;
        for (int index = 0; index < nbBranches; index++) {
            MockTreeBranch mockBranch = new MockTreeBranch();
            Tuple3dState translationVector = DisplayDataCreatorForTests.createRandomTupleState();
            MockTreeBranch3D mockBranch3D = (MockTreeBranch3D) mockBranch.getBranch3D();
View Full Code Here

TOP

Related Classes of barsuift.simLife.tree.MockTree

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.