summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCGantert345 <57003061+CGantert345@users.noreply.github.com>2021-01-05 11:06:35 +0100
committerCGantert345 <57003061+CGantert345@users.noreply.github.com>2021-01-05 11:06:35 +0100
commita2646bc8c28ffdf90c0d6bc5c1162e78d5a1aa4f (patch)
tree7ff7413b456b2c694ddf611911676ef4ebf8ee9d /src
parentUTC offset of valid from / until dates in Pass (diff)
downloadUIC-barcode-a2646bc8c28ffdf90c0d6bc5c1162e78d5a1aa4f.tar
UIC-barcode-a2646bc8c28ffdf90c0d6bc5c1162e78d5a1aa4f.tar.gz
UIC-barcode-a2646bc8c28ffdf90c0d6bc5c1162e78d5a1aa4f.tar.bz2
UIC-barcode-a2646bc8c28ffdf90c0d6bc5c1162e78d5a1aa4f.tar.lz
UIC-barcode-a2646bc8c28ffdf90c0d6bc5c1162e78d5a1aa4f.tar.xz
UIC-barcode-a2646bc8c28ffdf90c0d6bc5c1162e78d5a1aa4f.tar.zst
UIC-barcode-a2646bc8c28ffdf90c0d6bc5c1162e78d5a1aa4f.zip
Diffstat (limited to 'src')
-rw-r--r--src/net/gcdc/asn1/test/UperEncodeStringDefaultTest.java9
-rw-r--r--src/org/uic/ticket/api/impl/SimpleTraveler.java6
-rw-r--r--src/org/uic/ticket/api/spec/ITraveler.java4
3 files changed, 13 insertions, 6 deletions
diff --git a/src/net/gcdc/asn1/test/UperEncodeStringDefaultTest.java b/src/net/gcdc/asn1/test/UperEncodeStringDefaultTest.java
index 5abaa37..46f2ba9 100644
--- a/src/net/gcdc/asn1/test/UperEncodeStringDefaultTest.java
+++ b/src/net/gcdc/asn1/test/UperEncodeStringDefaultTest.java
@@ -64,7 +64,14 @@ public class UperEncodeStringDefaultTest {
assertEquals(result.valueIA5,"testString");
}
-
+ @Test public void testEncodeDefault2() throws IllegalArgumentException, IllegalAccessException {
+ TestRecord record = new TestRecord("Müller", null);
+ byte[] encoded = UperEncoder.encode(record);
+ TestRecord result = UperEncoder.decode(encoded, TestRecord.class);
+ String hex = UperEncoder.hexStringFromBytes(encoded);
+ UperEncoder.logger.log(Level.FINEST,String.format("data hex: %s", hex));
+ assertEquals(result.valueIA5,"testString");
+ }
}
diff --git a/src/org/uic/ticket/api/impl/SimpleTraveler.java b/src/org/uic/ticket/api/impl/SimpleTraveler.java
index ef60dd7..7451b4c 100644
--- a/src/org/uic/ticket/api/impl/SimpleTraveler.java
+++ b/src/org/uic/ticket/api/impl/SimpleTraveler.java
@@ -53,7 +53,7 @@ public class SimpleTraveler implements ITraveler {
protected IPassengerType passengerType;
/** The passenger with reduced mobility. */
- protected boolean passengerWithReducedMobility = false;
+ protected boolean passengerWithReducedMobility;
/** The country of residence. */
protected int countryOfResidence = 0;
@@ -225,14 +225,14 @@ public class SimpleTraveler implements ITraveler {
/* (nicht-Javadoc)
* @see org.uic.ticket.api.spec.ITraveler#isPassengerWithReducedMobility()
*/
- public boolean isPassengerWithReducedMobility() {
+ public Boolean isPassengerWithReducedMobility() {
return passengerWithReducedMobility;
}
/* (nicht-Javadoc)
* @see org.uic.ticket.api.spec.ITraveler#setPassengerWithReducedMobility(boolean)
*/
- public void setPassengerWithReducedMobility(boolean passengerWithReducedMobility) {
+ public void setPassengerWithReducedMobility(Boolean passengerWithReducedMobility) {
this.passengerWithReducedMobility = passengerWithReducedMobility;
}
diff --git a/src/org/uic/ticket/api/spec/ITraveler.java b/src/org/uic/ticket/api/spec/ITraveler.java
index 498a7e3..35d229d 100644
--- a/src/org/uic/ticket/api/spec/ITraveler.java
+++ b/src/org/uic/ticket/api/spec/ITraveler.java
@@ -174,14 +174,14 @@ public interface ITraveler {
*
* @return true, if is passenger with reduced mobility
*/
- public boolean isPassengerWithReducedMobility();
+ public Boolean isPassengerWithReducedMobility();
/**
* Sets the passenger with reduced mobility.
*
* @param passengerWithReducedMobility the new passenger with reduced mobility
*/
- public void setPassengerWithReducedMobility(boolean passengerWithReducedMobility);
+ public void setPassengerWithReducedMobility(Boolean passengerWithReducedMobility);
/**
* Gets the country of residence (numeric ISO country code) .