-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix regression after configuration refactoring (#51)
Configuration parameters in both web.xml and Spring configuration are used now Fix #46
- Loading branch information
1 parent
2d22aaf
commit 82ae1dc
Showing
4 changed files
with
79 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 0 additions & 29 deletions
29
src/test/java/com/hazelcast/wm/test/spring/FilterConfigStub.java
This file was deleted.
Oops, something went wrong.
50 changes: 50 additions & 0 deletions
50
src/test/java/com/hazelcast/wm/test/spring/MapBasedFilterConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.hazelcast.wm.test.spring; | ||
|
||
import javax.servlet.FilterConfig; | ||
import javax.servlet.ServletContext; | ||
import java.util.Enumeration; | ||
import java.util.HashMap; | ||
import java.util.Iterator; | ||
import java.util.Map; | ||
|
||
public class MapBasedFilterConfig implements FilterConfig { | ||
private final ServletContext emptyServletContext = new ServletContextStub(); | ||
private final Map<String, String> parameters = new HashMap<String, String>(); | ||
|
||
@Override | ||
public String getFilterName() { | ||
return "filter-1"; | ||
} | ||
|
||
@Override | ||
public ServletContext getServletContext() { | ||
return emptyServletContext; | ||
} | ||
|
||
@Override | ||
public String getInitParameter(String name) { | ||
return parameters.get(name); | ||
} | ||
|
||
@Override | ||
public Enumeration<String> getInitParameterNames() { | ||
return new Enumeration<String>() { | ||
|
||
private Iterator<String> iterator = parameters.keySet().iterator(); | ||
|
||
@Override | ||
public boolean hasMoreElements() { | ||
return iterator.hasNext(); | ||
} | ||
|
||
@Override | ||
public String nextElement() { | ||
return iterator.next(); | ||
} | ||
}; | ||
} | ||
|
||
public void setParameter(String paramName, String paramValue) { | ||
parameters.put(paramName, paramValue); | ||
} | ||
} |