/** * Test method for {@link at.ac.tuwien.auto.calimero.datapoint.StateDP#isUpdating( * at.ac.tuwien.auto.calimero.GroupAddress)}. */ public final void testIsUpdating() { final StateDP dp = new StateDP(ga, "test"); dp.add(new GroupAddress(2, 2, 2), true); assertTrue(dp.isUpdating(new GroupAddress(2, 2, 2))); dp.add(new GroupAddress(1, 1, 1), false); assertFalse(dp.isUpdating(new GroupAddress(1, 1, 1))); }
/** * Test method for {@link at.ac.tuwien.auto.calimero.datapoint.StateDP#add( * at.ac.tuwien.auto.calimero.GroupAddress, boolean)}. */ public final void testAdd() { final StateDP dp = new StateDP(ga, "name1", inv, upd); for (final Iterator i = upd.iterator(); i.hasNext(); ) { final GroupAddress a = (GroupAddress) i.next(); dp.add(a, true); } assertEquals(upd.size(), dp.getAddresses(true).size()); for (final Iterator i = inv.iterator(); i.hasNext(); ) { final GroupAddress a = (GroupAddress) i.next(); dp.add(a, false); } assertEquals(inv.size(), dp.getAddresses(false).size()); dp.add(new GroupAddress(5, 5, 5), false); assertEquals(inv.size() + 1, dp.getAddresses(false).size()); assertTrue(dp.isInvalidating(new GroupAddress(5, 5, 5))); }