summaryrefslogtreecommitdiff
path: root/bkucommon/src/test/java/at/gv/egiz/stal/dummy
diff options
context:
space:
mode:
Diffstat (limited to 'bkucommon/src/test/java/at/gv/egiz/stal/dummy')
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/stal/dummy/DummySTAL.java13
-rw-r--r--bkucommon/src/test/java/at/gv/egiz/stal/dummy/DummyStalFactory.java38
2 files changed, 44 insertions, 7 deletions
diff --git a/bkucommon/src/test/java/at/gv/egiz/stal/dummy/DummySTAL.java b/bkucommon/src/test/java/at/gv/egiz/stal/dummy/DummySTAL.java
index 8adeadee..e4ffdb9d 100644
--- a/bkucommon/src/test/java/at/gv/egiz/stal/dummy/DummySTAL.java
+++ b/bkucommon/src/test/java/at/gv/egiz/stal/dummy/DummySTAL.java
@@ -27,10 +27,9 @@ import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
-import java.util.Locale;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import at.gv.egiz.stal.ErrorResponse;
import at.gv.egiz.stal.InfoboxReadRequest;
@@ -43,7 +42,7 @@ import at.gv.egiz.stal.SignResponse;
public class DummySTAL implements STAL {
- static Log log = LogFactory.getLog(DummySTAL.class);
+ private final Logger log = LoggerFactory.getLogger(DummySTAL.class);
protected X509Certificate cert = null;
protected PrivateKey privateKey = null;
@@ -66,7 +65,7 @@ public class DummySTAL implements STAL {
}
}
} catch (Exception e) {
- log.error(e);
+ log.error("Failed to create DummySTAL.", e);
}
}
@@ -113,7 +112,7 @@ public class DummySTAL implements STAL {
infoboxReadResponse.setInfoboxValue(cert.getEncoded());
response = infoboxReadResponse;
} catch (CertificateEncodingException e) {
- log.error(e);
+ log.error("Failed to encode certificate.", e);
response = new ErrorResponse();
}
} else {
@@ -136,7 +135,7 @@ public class DummySTAL implements STAL {
resp.setSignatureValue(sigVal);
responses.add(resp);
} catch (Exception e) {
- log.error(e);
+ log.error("Failed to create signature.", e);
responses.add(new ErrorResponse());
}
diff --git a/bkucommon/src/test/java/at/gv/egiz/stal/dummy/DummyStalFactory.java b/bkucommon/src/test/java/at/gv/egiz/stal/dummy/DummyStalFactory.java
new file mode 100644
index 00000000..b8e3fff4
--- /dev/null
+++ b/bkucommon/src/test/java/at/gv/egiz/stal/dummy/DummyStalFactory.java
@@ -0,0 +1,38 @@
+/*
+* 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.stal.dummy;
+
+import java.util.Locale;
+
+import at.gv.egiz.stal.STAL;
+import at.gv.egiz.stal.STALFactory;
+
+public class DummyStalFactory implements STALFactory {
+
+ @Override
+ public STAL createSTAL() {
+ // TODO Auto-generated method stub
+ return new at.gv.egiz.stal.dummy.DummySTAL();
+ }
+
+ @Override
+ public void setLocale(Locale locale) {
+ // TODO Auto-generated method stub
+
+ }
+
+}