Skip to content

Commit

Permalink
checkCloning kopiert Felder nach ByteAdresse
Browse files Browse the repository at this point in the history
  • Loading branch information
Oli B committed May 13, 2024
1 parent 71c42b1 commit 4c8acf4
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions lib/src/test/java/gdv/xport/satz/xml/XmlServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
package gdv.xport.satz.xml;

import gdv.xport.config.Config;
import gdv.xport.feld.Bezeichner;
import gdv.xport.feld.Feld;
import gdv.xport.feld.NumFeld;
import gdv.xport.feld.Zeichen;
import gdv.xport.feld.*;
import gdv.xport.satz.AbstractSatzTest;
import gdv.xport.satz.Satz;
import gdv.xport.satz.Teildatensatz;
Expand Down Expand Up @@ -280,16 +277,19 @@ private static void checkCloning(SatzXml orig) {
}

private static void checkFeldCloning(Satz orig, Satz copy) {
for (Feld feld : orig.getFelder()) {
Feld copyFeld = copy.getFeld(feld.getBezeichner());
assertEquals(feld, copyFeld);
assertNotSame(feld, copyFeld);
String inhalt = feld.getInhalt();
feld.setInhalt("9");
copyFeld.setInhalt("8");
assertNotEquals(feld, copyFeld);
feld.setInhalt(inhalt);
copyFeld.setInhalt(inhalt);
for (Teildatensatz origTds : orig.getTeildatensaetze()) {
for (Feld feld : origTds.getFelder()) {
Feld copyFeld = copy.getTeildatensatzBySatzNr(origTds.getSatznummer().toInt())
.getFeld(ByteAdresse.of(feld.getByteAdresse()));
assertEquals(feld, copyFeld);
assertNotSame(feld, copyFeld);
String inhalt = feld.getInhalt();
feld.setInhalt("9");
copyFeld.setInhalt("8");
assertNotEquals(feld, copyFeld);
feld.setInhalt(inhalt);
copyFeld.setInhalt(inhalt);
}
}
}

Expand Down

0 comments on commit 4c8acf4

Please sign in to comment.