This example uses a
FileAlterationListener to monitor file changes. It is simple to implement.
The code for the project can be found here: file-monitor
FileAlterationListener to monitor file changes. It is simple to implement.
@WebFilter servlet filters. The tests that I had used a lot of mocks, but really just left me unsatisfied. It was not a real world production solution. How would they "really" behave in the actual server environment. I had been using Arquillian to do some testing of our CDI layer, and decided to try it on filters.@ManagedBean. I am not sure what glue I sniffed for that one (it didn't work...), and using @Inject (that didn't work either... more glue).HttpServletRequest and HttpServletResponse after the filter processed it. There are a couple of annotations @BeforeServlet and @AfterServlet that helped me with checking my filters. There are no before and after filter annotations though. That would have made life easier.
web.xml file to provide additional flexibility like overriding annotations.
@WebFilter that modifies HttpServletRequest attributes, and HttpServletResponse headers. The filter should be tested in isolation, and in a real container to examine the real-world response. The tests should be able to be run on a variety of containers with no modification to the test code.
web.xml. The second set of examples demonstrate dynamic web.xml generation, and overriding. Here are some code snippets from the project.