/** * Test method for {@link at.ac.tuwien.auto.calimero.datapoint.StateDP#StateDP( * at.ac.tuwien.auto.calimero.xml.XMLReader)}. * * @throws KNXMLException */ public final void testStateDPXMLReader() throws KNXMLException { final XMLWriter w = XMLFactory.getInstance().createXMLWriter(dpFile); StateDP dp = new StateDP(ga, "testSave2", inv, upd); dp.setExpirationTimeout(15); dp.save(w); w.close(); final XMLReader r = XMLFactory.getInstance().createXMLReader(dpFile); dp = new StateDP(r); r.close(); assertEquals(ga, dp.getMainAddress()); assertEquals("testSave2", dp.getName()); assertTrue(dp.isStateBased()); assertEquals(0, dp.getMainNumber()); assertNull(dp.getDPT()); assertEquals(15, dp.getExpirationTimeout()); assertEquals(upd, new ArrayList(dp.getAddresses(true))); assertEquals(inv, new ArrayList(dp.getAddresses(false))); }
/** * Test method for {@link at.ac.tuwien.auto.calimero.datapoint.StateDP#setExpirationTimeout(int)}. */ public final void testSetExpirationTimeout() { final StateDP dp = new StateDP(ga, "test"); assertEquals(0, dp.getExpirationTimeout()); dp.setExpirationTimeout(1000); assertEquals(1000, dp.getExpirationTimeout()); }