aboutsummaryrefslogtreecommitdiff
path: root/id.server/src/test/abnahme/A
diff options
context:
space:
mode:
authorharald.bratko <harald.bratko@d688527b-c9ab-4aba-bd8d-4036d912da1d>2007-01-10 15:46:55 +0000
committerharald.bratko <harald.bratko@d688527b-c9ab-4aba-bd8d-4036d912da1d>2007-01-10 15:46:55 +0000
commit547b3b6eb2be2414df1524941c8cc95d83ede3c5 (patch)
tree2e31a08d5abb7655764003521191305bb2c39771 /id.server/src/test/abnahme/A
parentb224ba28efa8e3082524f1de0d6851d73fe66f03 (diff)
downloadmoa-id-spss-547b3b6eb2be2414df1524941c8cc95d83ede3c5.tar.gz
moa-id-spss-547b3b6eb2be2414df1524941c8cc95d83ede3c5.tar.bz2
moa-id-spss-547b3b6eb2be2414df1524941c8cc95d83ede3c5.zip
Adapted tests to be compileable within MOA-ID 1.4.
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@772 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'id.server/src/test/abnahme/A')
-rw-r--r--id.server/src/test/abnahme/A/Test200VerifyIdentityLink.java64
-rw-r--r--id.server/src/test/abnahme/A/Test300VerifyAuthBlock.java24
-rw-r--r--id.server/src/test/abnahme/A/Test400GetAuthenticationData.java7
3 files changed, 72 insertions, 23 deletions
diff --git a/id.server/src/test/abnahme/A/Test200VerifyIdentityLink.java b/id.server/src/test/abnahme/A/Test200VerifyIdentityLink.java
index c3325349d..d0ba51923 100644
--- a/id.server/src/test/abnahme/A/Test200VerifyIdentityLink.java
+++ b/id.server/src/test/abnahme/A/Test200VerifyIdentityLink.java
@@ -1,10 +1,15 @@
package test.abnahme.A;
+import java.util.HashMap;
+
import org.w3c.dom.Element;
+
+
import test.abnahme.AbnahmeTestCase;
import at.gv.egovernment.moa.id.AuthenticationException;
import at.gv.egovernment.moa.id.ParseException;
+import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants;
import at.gv.egovernment.moa.id.auth.builder.VerifyXMLSignatureRequestBuilder;
import at.gv.egovernment.moa.id.auth.data.IdentityLink;
import at.gv.egovernment.moa.id.auth.invoke.SignatureVerificationInvoker;
@@ -30,8 +35,9 @@ public class Test200VerifyIdentityLink extends AbnahmeTestCase {
String sessionID = startAuthentication();
System.out.println(sessionID);
String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml");
-
- String createXMLSignatureRequest = server.verifyIdentityLink(sessionID, infoboxReadResponse);
+ HashMap parameters = new HashMap(1);
+ parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse);
+ String createXMLSignatureRequest = server.verifyIdentityLink(sessionID, parameters);
InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse);
IdentityLink idl = irrp.parseIdentityLink();
@@ -61,8 +67,11 @@ public class Test200VerifyIdentityLink extends AbnahmeTestCase {
startAuthentication();
String sessionID = "0";
String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml");
+
try {
- server.verifyIdentityLink(sessionID, infoboxReadResponse);
+ HashMap parameters = new HashMap(1);
+ parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse);
+ server.verifyIdentityLink(sessionID, parameters);
System.err.println(this.getName() + " hat KEINE FEHLER geworfen");
fail(this.getName() + " hat KEINE FEHLER geworfen");
}
@@ -87,7 +96,9 @@ public class Test200VerifyIdentityLink extends AbnahmeTestCase {
System.out.println(sessionID);
String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml");
try {
- server.verifyIdentityLink(sessionID, infoboxReadResponse);
+ HashMap parameters = new HashMap(1);
+ parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse);
+ server.verifyIdentityLink(sessionID, parameters);
System.err.println(this.getName() + " hat KEINE FEHLER geworfen");
fail(this.getName() + " hat KEINE FEHLER geworfen");
}
@@ -108,8 +119,9 @@ public class Test200VerifyIdentityLink extends AbnahmeTestCase {
System.out.println(sessionID);
String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml");
try {
- server.verifyIdentityLink(sessionID, infoboxReadResponse);
- server.verifyIdentityLink(sessionID, infoboxReadResponse);
+ HashMap parameters = new HashMap(1);
+ parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse);
+ server.verifyIdentityLink(sessionID, parameters);
System.err.println(this.getName() + " hat KEINE FEHLER geworfen");
fail(this.getName() + " hat KEINE FEHLER geworfen");
}
@@ -128,7 +140,9 @@ public class Test200VerifyIdentityLink extends AbnahmeTestCase {
String sessionID = startAuthentication();
String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml");
try {
- server.verifyIdentityLink(sessionID, infoboxReadResponse);
+ HashMap parameters = new HashMap(1);
+ parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse);
+ server.verifyIdentityLink(sessionID, parameters);
System.err.println(this.getName() + " hat KEINE FEHLER geworfen");
fail(this.getName() + " hat KEINE FEHLER geworfen");
}
@@ -148,7 +162,9 @@ public class Test200VerifyIdentityLink extends AbnahmeTestCase {
System.out.println(sessionID);
String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml");
try {
- server.verifyIdentityLink(sessionID, infoboxReadResponse);
+ HashMap parameters = new HashMap(1);
+ parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse);
+ server.verifyIdentityLink(sessionID, parameters);
}
catch (ParseException e) {
System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------");
@@ -165,7 +181,9 @@ public class Test200VerifyIdentityLink extends AbnahmeTestCase {
System.out.println(sessionID);
String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml");
try {
- server.verifyIdentityLink(sessionID, infoboxReadResponse);
+ HashMap parameters = new HashMap(1);
+ parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse);
+ server.verifyIdentityLink(sessionID, parameters);
}
catch (ValidateException e) {
System.out.println("-----------------------\nFehler in " + this.getName() + " erfolgreich abgefangen: " + e.getLocalizedMessage() + "\n-----------------------");
@@ -183,7 +201,9 @@ public class Test200VerifyIdentityLink extends AbnahmeTestCase {
System.out.println(sessionID);
String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml");
try {
- server.verifyIdentityLink(sessionID, infoboxReadResponse);
+ HashMap parameters = new HashMap(1);
+ parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse);
+ server.verifyIdentityLink(sessionID, parameters);
System.err.println(this.getName() + " hat KEINE FEHLER geworfen");
fail(this.getName() + " hat KEINE FEHLER geworfen");
@@ -204,7 +224,9 @@ public class Test200VerifyIdentityLink extends AbnahmeTestCase {
System.out.println(sessionID);
String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml");
try {
- server.verifyIdentityLink(sessionID, infoboxReadResponse);
+ HashMap parameters = new HashMap(1);
+ parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse);
+ server.verifyIdentityLink(sessionID, parameters);
System.err.println(this.getName() + " hat KEINE FEHLER geworfen");
fail(this.getName() + " hat KEINE FEHLER geworfen");
}
@@ -224,7 +246,9 @@ public class Test200VerifyIdentityLink extends AbnahmeTestCase {
System.out.println(sessionID);
String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml");
try {
- server.verifyIdentityLink(sessionID, infoboxReadResponse);
+ HashMap parameters = new HashMap(1);
+ parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse);
+ server.verifyIdentityLink(sessionID, parameters);
System.err.println(this.getName() + " hat KEINE FEHLER geworfen");
fail(this.getName() + " hat KEINE FEHLER geworfen");
}
@@ -244,7 +268,9 @@ public class Test200VerifyIdentityLink extends AbnahmeTestCase {
System.out.println(sessionID);
String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml");
try {
- server.verifyIdentityLink(sessionID, infoboxReadResponse);
+ HashMap parameters = new HashMap(1);
+ parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse);
+ server.verifyIdentityLink(sessionID, parameters);
System.err.println(this.getName() + " hat KEINE FEHLER geworfen");
fail(this.getName() + " hat KEINE FEHLER geworfen");
}
@@ -264,7 +290,9 @@ public class Test200VerifyIdentityLink extends AbnahmeTestCase {
String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml");
try {
- server.verifyIdentityLink(sessionID, infoboxReadResponse);
+ HashMap parameters = new HashMap(1);
+ parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse);
+ server.verifyIdentityLink(sessionID, parameters);
System.err.println(this.getName() + " hat KEINE FEHLER geworfen");
fail(this.getName() + " hat KEINE FEHLER geworfen");
}
@@ -288,7 +316,9 @@ public class Test200VerifyIdentityLink extends AbnahmeTestCase {
// System.out.println(infoboxReadResponse);
try {
- server.verifyIdentityLink(sessionID, infoboxReadResponse);
+ HashMap parameters = new HashMap(1);
+ parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse);
+ server.verifyIdentityLink(sessionID, parameters);
System.err.println(this.getName() + " hat KEINE FEHLER geworfen");
fail(this.getName() + " hat KEINE FEHLER geworfen");
}
@@ -307,7 +337,9 @@ public class Test200VerifyIdentityLink extends AbnahmeTestCase {
String sessionID = startAuthentication();
System.out.println(sessionID);
String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml");
- server.verifyIdentityLink(sessionID, infoboxReadResponse);
+ HashMap parameters = new HashMap(1);
+ parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse);
+ server.verifyIdentityLink(sessionID, parameters);
InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse);
IdentityLink idl = irrp.parseIdentityLink();
Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder().build(idl, AuthConfigurationProvider.getInstance().getMoaSpAuthBlockTrustProfileID());
diff --git a/id.server/src/test/abnahme/A/Test300VerifyAuthBlock.java b/id.server/src/test/abnahme/A/Test300VerifyAuthBlock.java
index 8bf7f32ab..9bf92e54b 100644
--- a/id.server/src/test/abnahme/A/Test300VerifyAuthBlock.java
+++ b/id.server/src/test/abnahme/A/Test300VerifyAuthBlock.java
@@ -1,6 +1,7 @@
package test.abnahme.A;
import java.util.Calendar;
+import java.util.HashMap;
import org.w3c.dom.Element;
import test.abnahme.AbnahmeTestCase;
@@ -9,6 +10,7 @@ import at.gv.egovernment.moa.id.AuthenticationException;
import at.gv.egovernment.moa.id.BuildException;
import at.gv.egovernment.moa.id.ParseException;
import at.gv.egovernment.moa.id.auth.AuthenticationServer;
+import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants;
import at.gv.egovernment.moa.id.auth.builder.AuthenticationDataAssertionBuilder;
import at.gv.egovernment.moa.id.auth.builder.PersonDataBuilder;
import at.gv.egovernment.moa.id.auth.builder.BPKBuilder;
@@ -187,7 +189,9 @@ public class Test300VerifyAuthBlock extends AbnahmeTestCase {
String sessionID = startAuthentication();
System.out.println(sessionID);
String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml");
- server.verifyIdentityLink(sessionID, infoboxReadResponse);
+ HashMap parameters = new HashMap(1);
+ parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse);
+ server.verifyIdentityLink(sessionID, parameters);
InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse);
IdentityLink idl = irrp.parseIdentityLink();
Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder().build(idl, AuthConfigurationProvider.getInstance().getMoaSpAuthBlockTrustProfileID());
@@ -218,7 +222,9 @@ public class Test300VerifyAuthBlock extends AbnahmeTestCase {
String sessionID = startAuthentication();
System.out.println(sessionID);
String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml");
- server.verifyIdentityLink(sessionID, infoboxReadResponse);
+ HashMap parameters = new HashMap(1);
+ parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse);
+ server.verifyIdentityLink(sessionID, parameters);
server.setSecondsSessionTimeOut(-100);
server.cleanup();
InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse);
@@ -277,7 +283,9 @@ public class Test300VerifyAuthBlock extends AbnahmeTestCase {
String sessionID = startAuthentication();
System.out.println(sessionID);
String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml");
- server.verifyIdentityLink(sessionID, infoboxReadResponse);
+ HashMap parameters = new HashMap(1);
+ parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse);
+ server.verifyIdentityLink(sessionID, parameters);
InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse);
IdentityLink idl = irrp.parseIdentityLink();
Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder().build(idl, AuthConfigurationProvider.getInstance().getMoaSpAuthBlockTrustProfileID());
@@ -500,7 +508,9 @@ public class Test300VerifyAuthBlock extends AbnahmeTestCase {
private AuthenticationData initServer(String sessionID) throws Exception {
String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml");
- server.verifyIdentityLink(sessionID, infoboxReadResponse);
+ HashMap parameters = new HashMap(1);
+ parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse);
+ server.verifyIdentityLink(sessionID, parameters);
InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse);
IdentityLink idl = irrp.parseIdentityLink();
Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder().build(idl, "TrustProfile1");
@@ -517,7 +527,9 @@ public class Test300VerifyAuthBlock extends AbnahmeTestCase {
private AuthenticationData initServerWithoutValidateAuthBlock(String sessionID) throws Exception {
String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml");
- server.verifyIdentityLink(sessionID, infoboxReadResponse);
+ HashMap parameters = new HashMap(1);
+ parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse);
+ server.verifyIdentityLink(sessionID, parameters);
InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse);
IdentityLink idl = irrp.parseIdentityLink();
Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder().build(idl, "TrustProfile1");
@@ -583,7 +595,7 @@ public class Test300VerifyAuthBlock extends AbnahmeTestCase {
oaParam.getProvideIdentityLink() ? DOMUtils.serializeNode(identityLink.getSamlAssertion()) : "";
String authBlock = oaParam.getProvideAuthBlock() ? session.getAuthBlock() : "";
String samlAssertion = new AuthenticationDataAssertionBuilder().build(
- authData, prPerson, authBlock, ilAssertion, session.getBkuURL(), "", false);
+ authData, prPerson, authBlock, ilAssertion, session.getBkuURL(), "", false, null);
authData.setSamlAssertion(samlAssertion);
return authData;
}
diff --git a/id.server/src/test/abnahme/A/Test400GetAuthenticationData.java b/id.server/src/test/abnahme/A/Test400GetAuthenticationData.java
index e265905b8..3db0a6d69 100644
--- a/id.server/src/test/abnahme/A/Test400GetAuthenticationData.java
+++ b/id.server/src/test/abnahme/A/Test400GetAuthenticationData.java
@@ -1,10 +1,13 @@
package test.abnahme.A;
+import java.util.HashMap;
+
import org.w3c.dom.Element;
import test.abnahme.AbnahmeTestCase;
import at.gv.egovernment.moa.id.AuthenticationException;
import at.gv.egovernment.moa.id.auth.AuthenticationServer;
+import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants;
import at.gv.egovernment.moa.id.auth.builder.VerifyXMLSignatureRequestBuilder;
import at.gv.egovernment.moa.id.auth.data.AuthenticationSession;
import at.gv.egovernment.moa.id.auth.data.IdentityLink;
@@ -34,7 +37,9 @@ public class Test400GetAuthenticationData extends AbnahmeTestCase {
String sessionID = startAuthentication();
AuthenticationSession session = AuthenticationServer.getSession(sessionID);
String infoboxReadResponse = readXmldata("InfoBoxReadResponse.xml");
- server.verifyIdentityLink(sessionID, infoboxReadResponse);
+ HashMap parameters = new HashMap(1);
+ parameters.put(MOAIDAuthConstants.PARAM_XMLRESPONSE, infoboxReadResponse);
+ server.verifyIdentityLink(sessionID, parameters);
InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(infoboxReadResponse);
IdentityLink idl = irrp.parseIdentityLink();
Element domVerifyXMLSignatureRequest = new VerifyXMLSignatureRequestBuilder().build(idl, AuthConfigurationProvider.getInstance().getMoaSpAuthBlockTrustProfileID());