aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/test/java/test/abnahme/A/Test100StartAuthentication.java
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/idserverlib/src/test/java/test/abnahme/A/Test100StartAuthentication.java')
-rw-r--r--id/server/idserverlib/src/test/java/test/abnahme/A/Test100StartAuthentication.java187
1 files changed, 187 insertions, 0 deletions
diff --git a/id/server/idserverlib/src/test/java/test/abnahme/A/Test100StartAuthentication.java b/id/server/idserverlib/src/test/java/test/abnahme/A/Test100StartAuthentication.java
new file mode 100644
index 000000000..4293fc477
--- /dev/null
+++ b/id/server/idserverlib/src/test/java/test/abnahme/A/Test100StartAuthentication.java
@@ -0,0 +1,187 @@
+/*
+* Copyright 2003 Federal Chancellery Austria
+*
+* 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 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, 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 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, 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 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,
+ 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, 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, 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, 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, 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, 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;
+ }
+ }
+
+}