summaryrefslogtreecommitdiff
path: root/BKUCommonGUI/src/test/java/at/gv
diff options
context:
space:
mode:
Diffstat (limited to 'BKUCommonGUI/src/test/java/at/gv')
-rw-r--r--BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java9
-rw-r--r--BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/DummyFontLoader.java8
-rw-r--r--BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/SecureViewerDialogTest.java4
-rw-r--r--BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/SimplePinInfo.java46
4 files changed, 54 insertions, 13 deletions
diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
index a2a84d6e..373ecaad 100644
--- a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
+++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
@@ -20,14 +20,11 @@
*/
package at.gv.egiz.bku.gui;
-import at.gv.egiz.smcc.PINSpec;
-import at.gv.egiz.smcc.STARCOSCard;
+import at.gv.egiz.smcc.PinInfo;
import at.gv.egiz.stal.HashDataInput;
import at.gv.egiz.stal.impl.ByteArrayHashDataInput;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
@@ -47,8 +44,8 @@ public class BKUGUIWorker implements Runnable {
public void run() {
try {
- final PINSpec signPinSpec = new PINSpec(6, 10, "[0-9]", "Test-PIN", (byte) 0x81, null);
- final PINSpec cardPinSpec = new PINSpec(4, 4, "[0-9]", "Test-PIN", (byte) 0x01, null);
+ final PinInfo signPinSpec = new SimplePinInfo(6, 10, "[0-9]", "Test-PIN", (byte) 0x81, null, PinInfo.UNKNOWN_RETRIES);
+ final PinInfo cardPinSpec = new SimplePinInfo(4, 4, "[0-9]", "Test-PIN", (byte) 0x01, null, PinInfo.UNKNOWN_RETRIES);
final ActionListener cancelListener = new ActionListener() {
diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/DummyFontLoader.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/DummyFontLoader.java
index 505c4247..26fc1a5e 100644
--- a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/DummyFontLoader.java
+++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/DummyFontLoader.java
@@ -21,8 +21,8 @@ import at.gv.egiz.bku.gui.viewer.FontProviderException;
import at.gv.egiz.bku.gui.viewer.FontProvider;
import java.awt.Font;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
*
@@ -30,11 +30,11 @@ import org.apache.commons.logging.LogFactory;
*/
public class DummyFontLoader implements FontProvider {
- protected final static Log log = LogFactory.getLog(DummyFontLoader.class);
+ private final Logger log = LoggerFactory.getLogger(DummyFontLoader.class);
@Override
public Font getFont() throws FontProviderException {
- log.debug("return font");
+ log.debug("Return font.");
return new Font("monospaced", Font.PLAIN, 10);
}
diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/SecureViewerDialogTest.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/SecureViewerDialogTest.java
index 9bbc1b1a..64f7e744 100644
--- a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/SecureViewerDialogTest.java
+++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/SecureViewerDialogTest.java
@@ -7,8 +7,6 @@ package at.gv.egiz.bku.gui;
import at.gv.egiz.stal.impl.ByteArrayHashDataInput;
import java.awt.Font;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@@ -35,7 +33,7 @@ public class SecureViewerDialogTest {
@BeforeClass
public static void setUpClass() throws Exception {
messages = ResourceBundle.getBundle("at/gv/egiz/bku/gui/Messages");
- secureViewer = new SecureViewerDialog(null, messages,null, null, new DummyFontLoader(), null);
+ secureViewer = new SecureViewerDialog(null, messages,null, null, new DummyFontLoader(), new DeafHelpListener("../help", messages.getLocale()), 1f);
}
@AfterClass
diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/SimplePinInfo.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/SimplePinInfo.java
new file mode 100644
index 00000000..3e583118
--- /dev/null
+++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/SimplePinInfo.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package at.gv.egiz.bku.gui;
+
+import at.gv.egiz.smcc.PinInfo;
+import java.util.Locale;
+
+/**
+ *
+ * @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at>
+ */
+public class SimplePinInfo extends PinInfo {
+
+ String name;
+
+ public SimplePinInfo(int minLength, int maxLength, String rexepPattern, String name, byte kid, byte[] contextAID, int maxRetries) {
+ super(minLength, maxLength, rexepPattern, null, null, kid, contextAID, maxRetries);
+ this.name = name;
+ }
+
+ @Override
+ public String getLocalizedName() {
+ return name;
+ }
+
+ @Override
+ public String getLocalizedName(Locale locale) {
+ return name;
+ }
+
+}