Beispiel #1
0
 /**
  * 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)));
 }
Beispiel #2
0
 /**
  * Test method for {@link Datapoint#create(XMLReader)}.
  *
  * @throws KNXMLException
  */
 public final void testCreate() throws KNXMLException {
   final XMLReader r = XMLFactory.getInstance().createXMLReader(dpFile);
   assertTrue(Datapoint.create(r) instanceof StateDP);
   r.close();
 }