Change classes to use PortMapperImpl and PortResolverImpl by default.

This commit is contained in:
Ben Alex 2004-04-28 00:10:56 +00:00
parent c641c445a0
commit b61c05ff89
8 changed files with 21 additions and 13 deletions

View File

@ -19,6 +19,7 @@ import net.sf.acegisecurity.AccessDeniedException;
import net.sf.acegisecurity.AuthenticationException;
import net.sf.acegisecurity.ui.AbstractProcessingFilter;
import net.sf.acegisecurity.util.PortResolver;
import net.sf.acegisecurity.util.PortResolverImpl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -100,7 +101,7 @@ public class SecurityEnforcementFilter implements Filter, InitializingBean {
private AuthenticationEntryPoint authenticationEntryPoint;
private FilterSecurityInterceptor filterSecurityInterceptor;
private PortResolver portResolver;
private PortResolver portResolver = new PortResolverImpl();
//~ Methods ================================================================

View File

@ -16,7 +16,9 @@
package net.sf.acegisecurity.securechannel;
import net.sf.acegisecurity.util.PortMapper;
import net.sf.acegisecurity.util.PortMapperImpl;
import net.sf.acegisecurity.util.PortResolver;
import net.sf.acegisecurity.util.PortResolverImpl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -52,8 +54,8 @@ public class RetryWithHttpEntryPoint implements InitializingBean,
//~ Instance fields ========================================================
private PortMapper portMapper;
private PortResolver portResolver;
private PortMapper portMapper = new PortMapperImpl();
private PortResolver portResolver = new PortResolverImpl();
//~ Methods ================================================================

View File

@ -16,7 +16,9 @@
package net.sf.acegisecurity.securechannel;
import net.sf.acegisecurity.util.PortMapper;
import net.sf.acegisecurity.util.PortMapperImpl;
import net.sf.acegisecurity.util.PortResolver;
import net.sf.acegisecurity.util.PortResolverImpl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -52,8 +54,8 @@ public class RetryWithHttpsEntryPoint implements InitializingBean,
//~ Instance fields ========================================================
private PortMapper portMapper;
private PortResolver portResolver;
private PortMapper portMapper = new PortMapperImpl();
private PortResolver portResolver = new PortResolverImpl();
//~ Methods ================================================================

View File

@ -17,7 +17,9 @@ package net.sf.acegisecurity.ui.webapp;
import net.sf.acegisecurity.intercept.web.AuthenticationEntryPoint;
import net.sf.acegisecurity.util.PortMapper;
import net.sf.acegisecurity.util.PortMapperImpl;
import net.sf.acegisecurity.util.PortResolver;
import net.sf.acegisecurity.util.PortResolverImpl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -63,8 +65,8 @@ public class AuthenticationProcessingFilterEntryPoint
//~ Instance fields ========================================================
private PortMapper portMapper;
private PortResolver portResolver;
private PortMapper portMapper = new PortMapperImpl();
private PortResolver portResolver = new PortResolverImpl();
private String loginFormUrl;
private boolean forceHttps = false;

View File

@ -233,6 +233,7 @@ public class SecurityEnforcementFilterTests extends TestCase {
false, false));
filter.setAuthenticationEntryPoint(new MockAuthenticationEntryPoint(
"/login.jsp"));
filter.setPortResolver(null);
try {
filter.afterPropertiesSet();

View File

@ -45,7 +45,7 @@ public class RetryWithHttpEntryPointTests extends TestCase {
public void testDetectsMissingPortMapper() throws Exception {
RetryWithHttpEntryPoint ep = new RetryWithHttpEntryPoint();
ep.setPortResolver(new MockPortResolver(80, 443));
ep.setPortMapper(null);
try {
ep.afterPropertiesSet();
@ -57,7 +57,7 @@ public class RetryWithHttpEntryPointTests extends TestCase {
public void testDetectsMissingPortResolver() throws Exception {
RetryWithHttpEntryPoint ep = new RetryWithHttpEntryPoint();
ep.setPortMapper(new PortMapperImpl());
ep.setPortResolver(null);
try {
ep.afterPropertiesSet();

View File

@ -45,7 +45,7 @@ public class RetryWithHttpsEntryPointTests extends TestCase {
public void testDetectsMissingPortMapper() throws Exception {
RetryWithHttpsEntryPoint ep = new RetryWithHttpsEntryPoint();
ep.setPortResolver(new MockPortResolver(80, 443));
ep.setPortMapper(null);
try {
ep.afterPropertiesSet();
@ -57,7 +57,7 @@ public class RetryWithHttpsEntryPointTests extends TestCase {
public void testDetectsMissingPortResolver() throws Exception {
RetryWithHttpsEntryPoint ep = new RetryWithHttpsEntryPoint();
ep.setPortMapper(new PortMapperImpl());
ep.setPortResolver(null);
try {
ep.afterPropertiesSet();

View File

@ -60,7 +60,7 @@ public class AuthenticationProcessingFilterEntryPointTests extends TestCase {
public void testDetectsMissingPortMapper() throws Exception {
AuthenticationProcessingFilterEntryPoint ep = new AuthenticationProcessingFilterEntryPoint();
ep.setLoginFormUrl("xxx");
ep.setPortResolver(new MockPortResolver(80, 443));
ep.setPortMapper(null);
try {
ep.afterPropertiesSet();
@ -73,7 +73,7 @@ public class AuthenticationProcessingFilterEntryPointTests extends TestCase {
public void testDetectsMissingPortResolver() throws Exception {
AuthenticationProcessingFilterEntryPoint ep = new AuthenticationProcessingFilterEntryPoint();
ep.setLoginFormUrl("xxx");
ep.setPortMapper(new PortMapperImpl());
ep.setPortResolver(null);
try {
ep.afterPropertiesSet();