Jelajahi Sumber

Almost forgot this piece of the jaas tests

Ray Krueger 21 tahun lalu
induk
melakukan
e366c65d17

+ 25 - 0
core/src/test/java/org/acegisecurity/providers/jaas/JaasEventCheck.java

@@ -0,0 +1,25 @@
+package net.sf.acegisecurity.providers.jaas;
+
+import net.sf.acegisecurity.providers.jaas.event.JaasAuthenticationFailedEvent;
+import net.sf.acegisecurity.providers.jaas.event.JaasAuthenticationSuccessEvent;
+import org.springframework.context.ApplicationEvent;
+import org.springframework.context.ApplicationListener;
+
+/**
+ * @author Ray Krueger
+ * @version $Id$
+ */
+public class JaasEventCheck implements ApplicationListener {
+
+    JaasAuthenticationFailedEvent failedEvent;
+    JaasAuthenticationSuccessEvent successEvent;
+
+    public void onApplicationEvent(ApplicationEvent event) {
+
+        if (event instanceof JaasAuthenticationFailedEvent)
+            failedEvent = (JaasAuthenticationFailedEvent) event;
+
+        if (event instanceof JaasAuthenticationSuccessEvent)
+            successEvent = (JaasAuthenticationSuccessEvent) event;
+    }
+}