diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2013-09-04 11:33:35 +0200 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2013-09-04 11:33:35 +0200 |
commit | 0d8dfd1b3b0892164fbd9d3d13eb231adad4062b (patch) | |
tree | 7b336240678bf008c3cdc1063eb8cfee7492178e /id/server/idserverlib/src/test/java/test/abnahme/P/Test100LoginParameterResolver.java | |
parent | eadd6dd97f1b30608b31ffcd90382874fbcdaddc (diff) | |
download | moa-id-spss-0d8dfd1b3b0892164fbd9d3d13eb231adad4062b.tar.gz moa-id-spss-0d8dfd1b3b0892164fbd9d3d13eb231adad4062b.tar.bz2 moa-id-spss-0d8dfd1b3b0892164fbd9d3d13eb231adad4062b.zip |
MOA-ID-LIB tests deactivated
Diffstat (limited to 'id/server/idserverlib/src/test/java/test/abnahme/P/Test100LoginParameterResolver.java')
-rw-r--r-- | id/server/idserverlib/src/test/java/test/abnahme/P/Test100LoginParameterResolver.java | 306 |
1 files changed, 153 insertions, 153 deletions
diff --git a/id/server/idserverlib/src/test/java/test/abnahme/P/Test100LoginParameterResolver.java b/id/server/idserverlib/src/test/java/test/abnahme/P/Test100LoginParameterResolver.java index 0e5d88c4d..70b47c938 100644 --- a/id/server/idserverlib/src/test/java/test/abnahme/P/Test100LoginParameterResolver.java +++ b/id/server/idserverlib/src/test/java/test/abnahme/P/Test100LoginParameterResolver.java @@ -1,159 +1,159 @@ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package test.abnahme.P; -import test.abnahme.AbnahmeTestCase; - -/** - * @author Stefan Knirsch - * @version $Id$ - * - */ - -public class Test100LoginParameterResolver extends AbnahmeTestCase { - -// private static final String CLIENT_IP_ADDRESS = "56.246.75.11"; -// private OAConfiguration oaConf; -// private LoginParameterResolver lpr; +///* +// * Copyright 2003 Federal Chancellery Austria +// * MOA-ID has been developed in a cooperation between BRZ, the Federal +// * Chancellery Austria - ICT staff unit, and Graz University of Technology. +// * +// * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by +// * the European Commission - subsequent versions of the EUPL (the "Licence"); +// * You may not use this work except in compliance with the Licence. +// * You may obtain a copy of the Licence at: +// * http://www.osor.eu/eupl/ +// * +// * Unless required by applicable law or agreed to in writing, software +// * distributed under the Licence is distributed on an "AS IS" basis, +// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// * See the Licence for the specific language governing permissions and +// * limitations under the Licence. +// * +// * This product combines work with different licenses. See the "NOTICE" text +// * file for details on the various modules and licenses. +// * The "NOTICE" text file is part of the distribution. Any derivative works +// * that you distribute must include a readable copy of the "NOTICE" text file. +// */ // - public Test100LoginParameterResolver(String name) { - super(name); - } // -// private void setUp(String publicURLPrefix) -// throws Exception { -// -// // get configuration data -// ProxyConfigurationProvider proxyConf = ProxyConfigurationProvider.getInstance(); -// OAProxyParameter oaParam = proxyConf.getOnlineApplicationParameter(publicURLPrefix); -// oaConf = oaParam.getOaConfiguration(); -// System.out.println("Parameterübergabe: " + oaConf.getAuthType()); +//package test.abnahme.P; +//import test.abnahme.AbnahmeTestCase; // -// // get login parameter resolver -// LoginParameterResolverFactory.initialize(); -// lpr = LoginParameterResolverFactory.getLoginParameterResolver(publicURLPrefix); -// } -// public void testP101() throws Exception { -// try { -// // read configuration and set up LoginParameterResolver -// setUp("https://testP101:9443/"); -// if (! oaConf.getAuthType().equals(OAConfiguration.BASIC_AUTH)) -// fail(); -// -// // assemble authentication data -// AuthenticationData authData = new AuthenticationData(); -// authData.setFamilyName("Huber"); -// authData.setGivenName("Hugo"); -// -// // resolve login headers -// Map loginHeaders = lpr.getAuthenticationHeaders(oaConf, authData, CLIENT_IP_ADDRESS, false, ""); -// -// // validate login headers -// assertEquals(1, loginHeaders.keySet().size()); -// System.out.println("Header Authorization: " + loginHeaders.get("Authorization")); -// System.out.println("Decoded UserID:Password " + -// new String(new BASE64Decoder().decodeBuffer(((String)loginHeaders.get("Authorization")).substring(6)))); -// String userIDPassword = "Hugo:Huber"; -// String credentials = Base64Utils.encode(userIDPassword.getBytes()); -// assertEquals("Basic " + credentials, loginHeaders.get("Authorization")); -// System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); -// } -// catch (Exception e) { -// System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); -// throw e; -// } -// -// } -// public void testP102() throws Exception { -// try { -// // read configuration and set up LoginParameterResolver -// setUp("https://testP102:9443/"); -// if (! oaConf.getAuthType().equals(OAConfiguration.PARAM_AUTH)) -// fail(); -// -// // assemble authentication data -// AuthenticationData authData = new AuthenticationData(); -// String DATE_OF_BIRTH = "1963-12-29"; -// String VPK = "kp6hOq6LRAkLtrqm6EvDm6bMwJw="; -// authData.setDateOfBirth(DATE_OF_BIRTH); -// authData.setBPK(VPK); -// -// // resolve login parameters -// Map loginParameters = lpr.getAuthenticationParameters(oaConf, authData, CLIENT_IP_ADDRESS, false, ""); -// -// // validate login headers -// assertEquals(2, loginParameters.keySet().size()); -// System.out.println("Param1: " + loginParameters.get("Param1")); -// System.out.println("Param2: " + loginParameters.get("Param2")); -// assertEquals(DATE_OF_BIRTH, loginParameters.get("Param1")); -// assertEquals(VPK, loginParameters.get("Param2")); -// System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); -// } -// catch (Exception e) { -// System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); -// throw e; -// } -// } -// -// public void testP103() throws Exception { -// try { -// // read configuration and set up LoginParameterResolver -// setUp("https://localhost:9443/"); -// if (! oaConf.getAuthType().equals(OAConfiguration.HEADER_AUTH)) -// fail(); -// -// // assemble authentication data -// AuthenticationData authData = new AuthenticationData(); -// boolean PUBLIC_AUTH = true; -// String BKZ = "FinanzamtWien23Leitstelle"; -// boolean QUAL_CERT = false; -// String STAMMZAHL = "3456789012"; -// authData.setPublicAuthority(PUBLIC_AUTH); -// authData.setPublicAuthorityCode(BKZ); -// authData.setQualifiedCertificate(QUAL_CERT); -// authData.setIdentificationValue(STAMMZAHL); +///** +// * @author Stefan Knirsch +// * @version $Id$ +// * +// */ // -// // resolve login headers -// Map loginHeaders = lpr.getAuthenticationHeaders(oaConf, authData, CLIENT_IP_ADDRESS, false, ""); +//public class Test100LoginParameterResolver extends AbnahmeTestCase { // -// // validate login headers -// assertEquals(5, loginHeaders.keySet().size()); -// System.out.println("Header Param1: " + loginHeaders.get("Param1")); -// System.out.println("Header Param2: " + loginHeaders.get("Param2")); -// System.out.println("Header Param3: " + loginHeaders.get("Param3")); -// System.out.println("Header Param4: " + loginHeaders.get("Param4")); -// System.out.println("Header Param5: " + loginHeaders.get("Param5")); -// assertEquals(String.valueOf(PUBLIC_AUTH), loginHeaders.get("Param1")); -// assertEquals(BKZ, loginHeaders.get("Param2")); -// assertEquals(String.valueOf(QUAL_CERT), loginHeaders.get("Param3")); -// assertEquals(STAMMZAHL, loginHeaders.get("Param4")); -// assertEquals(CLIENT_IP_ADDRESS, loginHeaders.get("Param5")); -// System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); -// } -// catch (Exception e) { -// System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); -// throw e; -// } +//// private static final String CLIENT_IP_ADDRESS = "56.246.75.11"; +//// private OAConfiguration oaConf; +//// private LoginParameterResolver lpr; +//// +// public Test100LoginParameterResolver(String name) { +// super(name); // } -} +//// +//// private void setUp(String publicURLPrefix) +//// throws Exception { +//// +//// // get configuration data +//// ProxyConfigurationProvider proxyConf = ProxyConfigurationProvider.getInstance(); +//// OAProxyParameter oaParam = proxyConf.getOnlineApplicationParameter(publicURLPrefix); +//// oaConf = oaParam.getOaConfiguration(); +//// System.out.println("Parameter�bergabe: " + oaConf.getAuthType()); +//// +//// // get login parameter resolver +//// LoginParameterResolverFactory.initialize(); +//// lpr = LoginParameterResolverFactory.getLoginParameterResolver(publicURLPrefix); +//// } +//// public void testP101() throws Exception { +//// try { +//// // read configuration and set up LoginParameterResolver +//// setUp("https://testP101:9443/"); +//// if (! oaConf.getAuthType().equals(OAConfiguration.BASIC_AUTH)) +//// fail(); +//// +//// // assemble authentication data +//// AuthenticationData authData = new AuthenticationData(); +//// authData.setFamilyName("Huber"); +//// authData.setGivenName("Hugo"); +//// +//// // resolve login headers +//// Map loginHeaders = lpr.getAuthenticationHeaders(oaConf, authData, CLIENT_IP_ADDRESS, false, ""); +//// +//// // validate login headers +//// assertEquals(1, loginHeaders.keySet().size()); +//// System.out.println("Header Authorization: " + loginHeaders.get("Authorization")); +//// System.out.println("Decoded UserID:Password " + +//// new String(new BASE64Decoder().decodeBuffer(((String)loginHeaders.get("Authorization")).substring(6)))); +//// String userIDPassword = "Hugo:Huber"; +//// String credentials = Base64Utils.encode(userIDPassword.getBytes()); +//// assertEquals("Basic " + credentials, loginHeaders.get("Authorization")); +//// System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); +//// } +//// catch (Exception e) { +//// System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); +//// throw e; +//// } +//// +//// } +//// public void testP102() throws Exception { +//// try { +//// // read configuration and set up LoginParameterResolver +//// setUp("https://testP102:9443/"); +//// if (! oaConf.getAuthType().equals(OAConfiguration.PARAM_AUTH)) +//// fail(); +//// +//// // assemble authentication data +//// AuthenticationData authData = new AuthenticationData(); +//// String DATE_OF_BIRTH = "1963-12-29"; +//// String VPK = "kp6hOq6LRAkLtrqm6EvDm6bMwJw="; +//// authData.setDateOfBirth(DATE_OF_BIRTH); +//// authData.setBPK(VPK); +//// +//// // resolve login parameters +//// Map loginParameters = lpr.getAuthenticationParameters(oaConf, authData, CLIENT_IP_ADDRESS, false, ""); +//// +//// // validate login headers +//// assertEquals(2, loginParameters.keySet().size()); +//// System.out.println("Param1: " + loginParameters.get("Param1")); +//// System.out.println("Param2: " + loginParameters.get("Param2")); +//// assertEquals(DATE_OF_BIRTH, loginParameters.get("Param1")); +//// assertEquals(VPK, loginParameters.get("Param2")); +//// System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); +//// } +//// catch (Exception e) { +//// System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); +//// throw e; +//// } +//// } +//// +//// public void testP103() throws Exception { +//// try { +//// // read configuration and set up LoginParameterResolver +//// setUp("https://localhost:9443/"); +//// if (! oaConf.getAuthType().equals(OAConfiguration.HEADER_AUTH)) +//// fail(); +//// +//// // assemble authentication data +//// AuthenticationData authData = new AuthenticationData(); +//// boolean PUBLIC_AUTH = true; +//// String BKZ = "FinanzamtWien23Leitstelle"; +//// boolean QUAL_CERT = false; +//// String STAMMZAHL = "3456789012"; +//// authData.setPublicAuthority(PUBLIC_AUTH); +//// authData.setPublicAuthorityCode(BKZ); +//// authData.setQualifiedCertificate(QUAL_CERT); +//// authData.setIdentificationValue(STAMMZAHL); +//// +//// // resolve login headers +//// Map loginHeaders = lpr.getAuthenticationHeaders(oaConf, authData, CLIENT_IP_ADDRESS, false, ""); +//// +//// // validate login headers +//// assertEquals(5, loginHeaders.keySet().size()); +//// System.out.println("Header Param1: " + loginHeaders.get("Param1")); +//// System.out.println("Header Param2: " + loginHeaders.get("Param2")); +//// System.out.println("Header Param3: " + loginHeaders.get("Param3")); +//// System.out.println("Header Param4: " + loginHeaders.get("Param4")); +//// System.out.println("Header Param5: " + loginHeaders.get("Param5")); +//// assertEquals(String.valueOf(PUBLIC_AUTH), loginHeaders.get("Param1")); +//// assertEquals(BKZ, loginHeaders.get("Param2")); +//// assertEquals(String.valueOf(QUAL_CERT), loginHeaders.get("Param3")); +//// assertEquals(STAMMZAHL, loginHeaders.get("Param4")); +//// assertEquals(CLIENT_IP_ADDRESS, loginHeaders.get("Param5")); +//// System.out.println("-----------------------Testfall " + this.getName() + " erfolgreich abgearbeitet! -----------------------"); +//// } +//// catch (Exception e) { +//// System.err.println("------ FEHLER IN " + this.getName() + ":" + e.getLocalizedMessage()); +//// throw e; +//// } +//// } +//} |