aboutsummaryrefslogtreecommitdiff
path: root/id.server/src/test/abnahme/A/Test100StartAuthentication.java
diff options
context:
space:
mode:
authorrudolf <rudolf@d688527b-c9ab-4aba-bd8d-4036d912da1d>2003-10-24 08:34:56 +0000
committerrudolf <rudolf@d688527b-c9ab-4aba-bd8d-4036d912da1d>2003-10-24 08:34:56 +0000
commitdd45e938564249a5e6897bd92dd29808d8990868 (patch)
tree372d8a4b128cff09262ad09d6a4cf5765d672d61 /id.server/src/test/abnahme/A/Test100StartAuthentication.java
parent59f78a67d7357fd31de68fc2b623f95b3d654ebc (diff)
downloadmoa-id-spss-dd45e938564249a5e6897bd92dd29808d8990868.tar.gz
moa-id-spss-dd45e938564249a5e6897bd92dd29808d8990868.tar.bz2
moa-id-spss-dd45e938564249a5e6897bd92dd29808d8990868.zip
MOA-ID version 1.1 (initial)
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@19 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'id.server/src/test/abnahme/A/Test100StartAuthentication.java')
-rw-r--r--id.server/src/test/abnahme/A/Test100StartAuthentication.java171
1 files changed, 171 insertions, 0 deletions
diff --git a/id.server/src/test/abnahme/A/Test100StartAuthentication.java b/id.server/src/test/abnahme/A/Test100StartAuthentication.java
new file mode 100644
index 000000000..0d72691aa
--- /dev/null
+++ b/id.server/src/test/abnahme/A/Test100StartAuthentication.java
@@ -0,0 +1,171 @@
+package test.abnahme.A;
+
+import test.abnahme.AbnahmeTestCase;
+import at.gv.egovernment.moa.id.AuthenticationException;
+import at.gv.egovernment.moa.id.auth.WrongParametersException;
+
+/**
+ * @author Stefan Knirsch
+ * @version $Id$
+ *
+ */
+public class Test100StartAuthentication extends AbnahmeTestCase {
+
+ public Test100StartAuthentication(String name) {
+ super(name);
+ }
+
+ public void testA101() throws Exception {
+ try {
+ String htmlForm = server.startAuthentication("https://localhost:8443/auth", //authURL
+ "gb", //target
+ "http://localhost:9080/", //oaURL
+ "file:" + findXmldata("AuthTemplate.html"),
+ "http://localhost:3495/http-security-layer-request",
+ null);
+ htmlForm = killExclusive(htmlForm, "MOASessionID=","\"","DELETED");
+ //writeXmldata("htmlForm_out.html",htmlForm.getBytes("UTF-8"));
+ assertEquals(readXmldata("htmlForm.html"),htmlForm);
+ System.out.println("-----------------------\nTestfall " + this.getName() + " erfolgreich abgearbeitet! \n-----------------------");
+ }
+ catch (Exception e) {
+ System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage());
+ throw e;
+ }
+ }
+
+ public void testA102() throws Exception {
+ try {
+ String htmlForm = server.startAuthentication("https://localhost:8443/auth", //authURL
+ "gb", //target
+ "http://localhost:9080/", //oaURL
+ null,
+ "http://localhost:3495/http-security-layer-request", null);
+ htmlForm = killExclusive(htmlForm, "MOASessionID=","\"","DELETED");
+ //writeXmldata("htmlForm_out.html",htmlForm.getBytes("UTF-8"));
+ assertEquals(readXmldata("htmlForm.html"),htmlForm);
+
+ System.out.println("-----------------------\nTestfall " + this.getName() + " erfolgreich abgearbeitet! \n-----------------------");
+ }
+ catch (Exception e) {
+ System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage());
+ throw e;
+ }
+ }
+ public void testA103() throws Exception {
+ try {
+ String htmlForm = server.startAuthentication("https://localhost:8443/auth", //authURL
+ "gb", //target
+ "http://localhost:9080/", //oaURL
+ "file:" + findXmldata("AuthTemplate.html"),
+ null,
+ null);
+ htmlForm = killExclusive(htmlForm, "MOASessionID=","\"","DELETED");
+ //writeXmldata("htmlForm_out.html",htmlForm.getBytes("UTF-8"));
+ assertEquals(readXmldata("htmlForm.html"),htmlForm);
+ System.out.println("-----------------------\nTestfall " + this.getName() + " erfolgreich abgearbeitet! \n-----------------------");
+ }
+ catch (Exception e) {
+ System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage());
+ throw e;
+ }
+ }
+
+ public void testA151() throws Exception {
+ try {
+ try {
+ server.startAuthentication(null, //authURL
+ "gb", //target
+ "http://localhost:9080/", //oaURL
+ null, null, null);
+ //assertEquals("",htmlForm);
+ System.err.println(this.getName() + " hat KEINE FEHLER geworfen");
+ fail(this.getName() + " hat KEINE FEHLER geworfen");
+ }
+ catch (WrongParametersException e) {
+ System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------");
+ }
+
+ }
+ catch (Exception e) {
+ System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage());
+ throw e;
+ }
+ }
+ public void testA152() throws Exception {
+ try {
+ try {
+ server.startAuthentication("http://localhost:8080/auth", //authURL
+ "gb", "http://localhost:9080/", //oaURL
+ null, null, null);
+ System.err.println(this.getName() + " hat KEINE FEHLER geworfen");
+ fail(this.getName() + " hat KEINE FEHLER geworfen");
+ }
+ catch (AuthenticationException e) {
+ System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------");
+ }
+ }
+ catch (Exception e) {
+ System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage());
+ throw e;
+ }
+ }
+ public void testA153() throws Exception {
+ try {
+ try {
+ server.startAuthentication("https://localhost:8443/auth", //authURL
+ "gb", "http://host_not_in_config/", //oaURL
+ null, null, null);
+ System.err.println(this.getName() + " hat KEINE FEHLER geworfen");
+ fail(this.getName() + " hat KEINE FEHLER geworfen");
+ }
+ catch (AuthenticationException e) {
+ System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------");
+ }
+
+ }
+ catch (Exception e) {
+ System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage());
+ throw e;
+ }
+ }
+ public void testA154() throws Exception {
+ try {
+ try {
+ server.startAuthentication("https://localhost:8443/auth", //authURL
+ "gb", null, //oaURL
+ null, null, null);
+ System.err.println(this.getName() + " hat KEINE FEHLER geworfen");
+ fail(this.getName() + " hat KEINE FEHLER geworfen");
+ }
+ catch (WrongParametersException e) {
+ System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------");
+ }
+ }
+ catch (Exception e) {
+ System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage());
+ throw e;
+ }
+ }
+
+ public void testA155() throws Exception {
+ try {
+ try {
+ server.startAuthentication("https://localhost:8443/auth", //authURL
+ null, "http://localhost:9080/", //oaURL
+ null, null, null);
+ System.err.println(this.getName() + " hat KEINE FEHLER geworfen");
+ fail(this.getName() + " hat KEINE FEHLER geworfen");
+ }
+ catch (WrongParametersException e) {
+ System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------");
+ }
+ //assertEquals("",htmlForm);
+ }
+ catch (Exception e) {
+ System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage());
+ throw e;
+ }
+ }
+
+}