summaryrefslogtreecommitdiff
path: root/eaaf_core
diff options
context:
space:
mode:
Diffstat (limited to 'eaaf_core')
-rw-r--r--eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/DummyAuthManager.java26
-rw-r--r--eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyProtocolAuthService.java42
-rw-r--r--eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/TestRequestImpl.java25
-rw-r--r--eaaf_core/src/test/resources/SpringTest-context_authManager.xml47
4 files changed, 134 insertions, 6 deletions
diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/DummyAuthManager.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/DummyAuthManager.java
new file mode 100644
index 00000000..368a1915
--- /dev/null
+++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/DummyAuthManager.java
@@ -0,0 +1,26 @@
+package at.gv.egiz.eaaf.core.impl.idp.auth;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import at.gv.egiz.eaaf.core.api.IRequest;
+import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext;
+import at.gv.egiz.eaaf.core.api.idp.slo.ISLOInformationContainer;
+import at.gv.egiz.eaaf.core.exceptions.EAAFException;
+import at.gv.egiz.eaaf.core.impl.idp.controller.protocols.RequestImpl;
+
+public class DummyAuthManager extends AbstractAuthenticationManager {
+
+ @Override
+ public ISLOInformationContainer performSingleLogOut(HttpServletRequest httpReq, HttpServletResponse httpResp,
+ IRequest pendingReq, String internalSSOId) throws EAAFException {
+ return null;
+ }
+
+ @Override
+ protected void populateExecutionContext(ExecutionContext executionContext, RequestImpl pendingReq,
+ HttpServletRequest httpReq) throws EAAFException {
+
+ }
+
+}
diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyProtocolAuthService.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyProtocolAuthService.java
new file mode 100644
index 00000000..a50e92cb
--- /dev/null
+++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyProtocolAuthService.java
@@ -0,0 +1,42 @@
+package at.gv.egiz.eaaf.core.impl.idp.module.test;
+
+import java.io.IOException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import at.gv.egiz.eaaf.core.api.IRequest;
+import at.gv.egiz.eaaf.core.api.idp.auth.services.IProtocolAuthenticationService;
+import at.gv.egiz.eaaf.core.exceptions.EAAFException;
+
+public class DummyProtocolAuthService implements IProtocolAuthenticationService {
+
+ @Override
+ public void performAuthentication(HttpServletRequest req, HttpServletResponse resp, IRequest pendingReq)
+ throws IOException, EAAFException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void finalizeAuthentication(HttpServletRequest req, HttpServletResponse resp, IRequest pendingReq)
+ throws EAAFException, IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void buildProtocolSpecificErrorResponse(Throwable throwable, HttpServletRequest req,
+ HttpServletResponse resp, IRequest pendingReq) throws IOException, EAAFException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void handleErrorNoRedirect(Throwable throwable, HttpServletRequest req, HttpServletResponse resp,
+ boolean writeExceptionToStatisticLog) throws IOException, EAAFException {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/TestRequestImpl.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/TestRequestImpl.java
index 25e2d6a1..b6679f2e 100644
--- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/TestRequestImpl.java
+++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/TestRequestImpl.java
@@ -45,6 +45,8 @@ public class TestRequestImpl implements IRequest {
private ISPConfiguration spConfig = null;
private final Map<String, Object> storage = new HashMap<String, Object>();
private String transactionId = null;
+ private String pendingReqId = null;
+ private String authURL = null;
/* (non-Javadoc)
* @see at.gv.egovernment.moa.id.moduls.IRequest#requestedModule()
@@ -130,8 +132,7 @@ public class TestRequestImpl implements IRequest {
*/
@Override
public String getAuthURL() {
- // TODO Auto-generated method stub
- return null;
+ return this.authURL;
}
/* (non-Javadoc)
@@ -139,8 +140,10 @@ public class TestRequestImpl implements IRequest {
*/
@Override
public String getAuthURLWithOutSlash() {
- // TODO Auto-generated method stub
- return null;
+ if (this.authURL != null && this.authURL.endsWith("/"))
+ return this.authURL.substring(0, this.authURL.length()-1);
+ else
+ return this.authURL;
}
/* (non-Javadoc)
@@ -227,8 +230,7 @@ public class TestRequestImpl implements IRequest {
@Override
public String getPendingRequestId() {
- // TODO Auto-generated method stub
- return null;
+ return this.pendingReqId;
}
@Override
@@ -302,6 +304,17 @@ public class TestRequestImpl implements IRequest {
public void setTransactionId(String transactionId) {
this.transactionId = transactionId;
}
+
+ public void setPendingReqId(String pendingReqId) {
+ this.pendingReqId = pendingReqId;
+ }
+
+ public void setAuthURL(String authURL) {
+ this.authURL = authURL;
+ }
+
+
+
diff --git a/eaaf_core/src/test/resources/SpringTest-context_authManager.xml b/eaaf_core/src/test/resources/SpringTest-context_authManager.xml
new file mode 100644
index 00000000..b8eef11f
--- /dev/null
+++ b/eaaf_core/src/test/resources/SpringTest-context_authManager.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:tx="http://www.springframework.org/schema/tx"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
+ http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
+
+ <bean id="TestAuthenticationDataBuilder"
+ class="at.gv.egiz.eaaf.core.impl.idp.auth.TestAuthenticationDataBuilder"/>
+
+ <bean id="dummyAuthManager"
+ class="at.gv.egiz.eaaf.core.impl.idp.auth.DummyAuthManager" />
+
+ <bean id="dummyRevisionLogger"
+ class="at.gv.egiz.eaaf.core.impl.logging.DummyRevisionsLogger" />
+
+ <bean id="DummyProtocolAuthService"
+ class="at.gv.egiz.eaaf.core.impl.idp.module.test.DummyProtocolAuthService" />
+
+ <bean id="DummyTransactionStorage"
+ class="at.gv.egiz.eaaf.core.impl.idp.process.spring.test.DummyTransactionStorage" />
+
+ <bean id="DummyStatusMessager"
+ class="at.gv.egiz.eaaf.core.impl.logging.DummyStatusMessager" />
+
+ <bean id="springElAwareExpressionEvaluator"
+ class="at.gv.egiz.eaaf.core.impl.idp.process.spring.SpringExpressionEvaluator" />
+
+ <bean id="processEngine"
+ class="at.gv.egiz.eaaf.core.impl.idp.process.ProcessEngineImpl">
+ <property name="transitionConditionExpressionEvaluator" ref="springElAwareExpressionEvaluator" />
+ </bean>
+
+ <bean id="ProcessInstanceStoreage"
+ class="at.gv.egiz.eaaf.core.impl.idp.process.dao.ProcessInstanceStoreDAOImpl"/>
+
+ <bean id="RequestStorage"
+ class="at.gv.egiz.eaaf.core.impl.idp.auth.RequestStorage"/>
+
+ <bean id="simplePendingRequestIdGenerationStrategy"
+ class="at.gv.egiz.eaaf.core.impl.utils.SimplePendingRequestIdGenerationStrategy" />
+
+</beans>