summaryrefslogtreecommitdiffstats
path: root/src/net/gcdc/asn1/test/UperEncodeIntegerExtensionTest.java
diff options
context:
space:
mode:
authorCGantert345 <57003061+CGantert345@users.noreply.github.com>2020-10-29 12:44:07 +0100
committerCGantert345 <57003061+CGantert345@users.noreply.github.com>2020-10-29 12:44:07 +0100
commitca0191d050b3dac6e65815ad5662ed8e796ef9d9 (patch)
tree6690d0d9d771f3033e4106d3b22d025602571cb2 /src/net/gcdc/asn1/test/UperEncodeIntegerExtensionTest.java
parentspecification added, test fixed (diff)
downloadUIC-barcode-ca0191d050b3dac6e65815ad5662ed8e796ef9d9.tar
UIC-barcode-ca0191d050b3dac6e65815ad5662ed8e796ef9d9.tar.gz
UIC-barcode-ca0191d050b3dac6e65815ad5662ed8e796ef9d9.tar.bz2
UIC-barcode-ca0191d050b3dac6e65815ad5662ed8e796ef9d9.tar.lz
UIC-barcode-ca0191d050b3dac6e65815ad5662ed8e796ef9d9.tar.xz
UIC-barcode-ca0191d050b3dac6e65815ad5662ed8e796ef9d9.tar.zst
UIC-barcode-ca0191d050b3dac6e65815ad5662ed8e796ef9d9.zip
Diffstat (limited to 'src/net/gcdc/asn1/test/UperEncodeIntegerExtensionTest.java')
-rw-r--r--src/net/gcdc/asn1/test/UperEncodeIntegerExtensionTest.java28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/net/gcdc/asn1/test/UperEncodeIntegerExtensionTest.java b/src/net/gcdc/asn1/test/UperEncodeIntegerExtensionTest.java
index 5a33368..4c87bae 100644
--- a/src/net/gcdc/asn1/test/UperEncodeIntegerExtensionTest.java
+++ b/src/net/gcdc/asn1/test/UperEncodeIntegerExtensionTest.java
@@ -5,6 +5,7 @@ import static org.junit.Assert.assertEquals;
import java.util.logging.Level;
import net.gcdc.asn1.datatypes.Asn1BigInteger;
+import net.gcdc.asn1.datatypes.FieldOrder;
import net.gcdc.asn1.datatypes.HasExtensionMarker;
import net.gcdc.asn1.datatypes.IsExtension;
import net.gcdc.asn1.datatypes.Sequence;
@@ -51,14 +52,17 @@ Encoded successfully in 21 bytes:
@HasExtensionMarker
public static class TestRecord {
-
+ @FieldOrder(order = 0)
Asn1BigInteger value1;
+ @FieldOrder(order = 2)
+ @IsExtension
+ Asn1BigInteger value3;
+
+ @FieldOrder(order = 1)
@IsExtension
Asn1BigInteger value2;
- @IsExtension
- Asn1BigInteger value3;
public TestRecord() {
value1 = new Asn1BigInteger(12345678909999899L);
@@ -74,26 +78,14 @@ Encoded successfully in 21 bytes:
TestRecord record = new TestRecord();
byte[] encoded = UperEncoder.encode(record);
- String hex = UperEncoder.hexStringFromBytes(encoded);
- UperEncoder.logger.log(Level.FINEST,String.format("data hex: %s", hex));
- assertEquals("8395EE2A2EF8858D81C1814052C8C338C0C09F4040",hex);
-
-
- }
-
- @Test public void testDecode() throws IllegalArgumentException, IllegalAccessException {
-
- TestRecord record = new TestRecord();
- byte[] encoded = UperEncoder.encode(record);
- String hex = UperEncoder.hexStringFromBytes(encoded);
- UperEncoder.logger.log(Level.FINEST,String.format("data hex: %s", hex));
- assertEquals("8395EE2A2EF8858D81C1814052C8C338C0C09F4040",hex);
-
TestRecord result = UperEncoder.decode(encoded, TestRecord.class);
assertEquals(result.value1.longValue(),record.value1.longValue());
assertEquals(result.value2.longValue(),record.value2.longValue());
assertEquals(result.value3.longValue(),record.value3.longValue());
+
}
+
+
}