From 265b0aca555d9880361b754b6a18ce70b5be28cd Mon Sep 17 00:00:00 2001 From: mcentner Date: Wed, 16 Jun 2010 11:19:41 +0000 Subject: Refactored smart card unit tests to use Spring to configure smart card emulators. git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@754 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../test/java/at/gv/egiz/smcc/AbstractAppl.java | 71 ++++++++++++++++++++-- 1 file changed, 66 insertions(+), 5 deletions(-) (limited to 'smcc/src/test/java/at/gv/egiz/smcc/AbstractAppl.java') diff --git a/smcc/src/test/java/at/gv/egiz/smcc/AbstractAppl.java b/smcc/src/test/java/at/gv/egiz/smcc/AbstractAppl.java index affb06ff..62339591 100644 --- a/smcc/src/test/java/at/gv/egiz/smcc/AbstractAppl.java +++ b/smcc/src/test/java/at/gv/egiz/smcc/AbstractAppl.java @@ -20,15 +20,34 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import javax.smartcardio.CardException; import javax.smartcardio.CommandAPDU; -import javax.smartcardio.ResponseAPDU; public abstract class AbstractAppl implements CardAppl { - public final HashMap pins = new HashMap(); + /** + * The Application Identifier. + */ + private byte[] aid; + + /** + * The File Identifier. + */ + private byte[] fid; + + /** + * The File Control (Information / Parameter) + */ + private byte[] fcx; + + /** + * The PINs used by this Application. + */ + public HashMap pins = new HashMap(); + /** + * The Files used by this Application. + */ protected List files = new ArrayList(); public void checkINS(CommandAPDU command, int ins) { @@ -37,12 +56,54 @@ public abstract class AbstractAppl implements CardAppl { } } + public void setAid(byte[] aID) { + aid = aID; + } + + @Override + public byte[] getAID() { + return aid; + } + + public void setFid(byte[] fid) { + this.fid = fid; + } + @Override - public abstract byte[] getAID(); + public byte[] getFID() { + return fid; + } + + public void setFcx(byte[] fcx) { + this.fcx = fcx; + } @Override - public abstract byte[] getFCI(); + public byte[] getFCX() { + return fcx; + } + /** + * @return the pins + */ + public HashMap getPins() { + return pins; + } + + /** + * @param pins the pins to set + */ + public void setPins(HashMap pins) { + this.pins = pins; + } + + /** + * @param files the files to set + */ + public void setFiles(List files) { + this.files = files; + } + public void putFile(File file) { files.add(file); } -- cgit v1.2.3