Examples of nbUpdated()


Examples of barsuift.simLife.time.ObservableTestHelper.nbUpdated()

        List<ObservableTestHelper> observerHelpers = new ArrayList<ObservableTestHelper>();
        for (TreeLeaf leaf : branchPart.getLeaves()) {
            ObservableTestHelper observerHelper = new ObservableTestHelper();
            observerHelpers.add(observerHelper);
            observerHelper.addIObserver(leaf);
            assertEquals(0, observerHelper.nbUpdated());
        }

        branchPart.spendTime();

        assertEquals(16, branchPart.getAge());
View Full Code Here

Examples of barsuift.simLife.time.ObservableTestHelper.nbUpdated()

        assertEquals(13.34112, branchPart.collectFreeEnergy().doubleValue(), 0.00001);
        // can not collect the free energy more than once
        assertEquals(new BigDecimal(0), branchPart.collectFreeEnergy());
        int nbFall = 0;
        for (ObservableTestHelper observerHelper : observerHelpers) {
            assertEquals(1, observerHelper.nbUpdated());
            int updateParam = (Integer) observerHelper.getUpdateObjects().get(0);
            if (LeafUpdateMask.isFieldSet(updateParam, LeafUpdateMask.FALL_MASK)) {
                // the single falling leaf (the first one)
                assertTrue(LeafUpdateMask.isFieldSet(updateParam, LeafUpdateMask.AGE_MASK));
                assertTrue(LeafUpdateMask.isFieldSet(updateParam, LeafUpdateMask.EFFICIENCY_MASK));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.