Exemplo n.º 1
0
 private static void checkToFeld(final FeldXml input, final Class<? extends Feld> expected) {
   Feld converted = input.toFeld(42);
   assertEquals(42, converted.getByteAdresse());
   assertTrue(
       converted + ": bezeichnung expected", StringUtils.isNotEmpty(converted.getBezeichnung()));
   assertEquals(input.getBezeichnung(), converted.getBezeichnung());
   assertEquals(input.getAnzahlBytes(), converted.getAnzahlBytes());
   assertEquals(expected, converted.getClass());
 }
Exemplo n.º 2
0
 /**
  * Testet, ob der XML-Teil mit der VU-Nummer korrekt geparst wird.
  *
  * @throws XMLStreamException the XML stream exception
  */
 @Test
 public void testVuNummer() throws XMLStreamException {
   FeldXml vuNr = createFeldXmlFrom("feldVuNr.xml");
   assertEquals(Bezeichner.VU_NR, vuNr.getBezeichner());
   assertEquals(5, vuNr.getAnzahlBytes());
 }
Exemplo n.º 3
0
 /**
  * Test-Methode fuer {@link FeldXml#toFeld(int)} mit einer Gleitkommazahl.
  *
  * @throws XMLStreamException the XML stream exception
  */
 @Test
 public void testToGleitkomma() throws XMLStreamException {
   FeldXml gleitkomma = createFeldXmlFrom("feldFliesskomma.xml");
   checkToFeld(gleitkomma, NumFeld.class);
   assertEquals(12, gleitkomma.getAnzahlBytes());
 }