Archive for 'Code'

I hate it when that happens …

29 May 2009

Some mornings, it just doesn’t pay to gnaw through those leather straps. [INFO] Scanning for projects… [INFO] ———————————————————————— [INFO] Building core [INFO] task-segment: [site] [INFO] ———————————————————————— [INFO] artifact org.codehaus.mojo:dashboard-maven-plugin: checking for updates from central [INFO] artifact org.codehaus.mojo:dashboard-maven-plugin: checking for updates from snapshots [INFO] ———————————————————————— [ERROR] FATAL ERROR [INFO] ———————————————————————— [INFO] java.lang.IllegalArgumentException: protocol = http host [...]

Stand-alone Spring application runner

6 May 2009

Today I had to do something a little different, which was to create a number of stand-alone applications that ran outside of a web container to manipulate various files and tables in a batch mode. I wanted to leverage some existing components, which were all built to have their dependencies resolved by Spring, so I [...]

Testing Tools: Even more servlet tests

2 May 2009

For today’s servlet test, I decided to take on the LookupTablePropertyJavascriptServlet, which is a rather strange, single-purpose servlet that produces a Javascript file needed for the Look-up Table entry edit page. This servlet uses the values in the global dataType look-up table to produce a script that looks something like this: // generated by “org.restafarian.core.servlets.impl.LookupTablePropertyJavascriptServlet” [...]

Testing Tools: More servlet tests

30 April 2009

Now that I had a couple of “read-only” JSON servlet tests under my belt, I decided to take on something just a tad more complex, so I chose the LookupTableEntrySelectListServlet as the target of my next servlet test. This servlet produces the XML output consumed by the Ajax data picker for a specific Look-up Table. [...]

Testing Tools: LookupTableEntryJsonServletTest

26 April 2009

Continuing with my strategy of taking on small, incremental steps in this process of setting up a servlet testing framework, I cloned our successful LookupTableJsonServletTest to create a similar test case, the new LookupTableEntryJsonServletTest. The major difference between the LookupTableJsonServlet and the LookupTableEntryJsonServlet is that the LookupTableJsonServlet returns data for all tables and the LookupTableEntryJsonServlet [...]

Testing Tools: LookupTableJsonServletTest

25 April 2009

Now that we have created the BaseServletTestCase, the DeleteMethodWebRequest, and the GenericSpringTestServlet, we finally have enough parts and pieces in place to actually build our first test case to test out one of our REST servlets. Since our chosen target, the LookupTableJsonServlet, is a Spring-injected servlet, we will use the Spring bean variation of the [...]

Testing Tools: GenericSpringTestServlet

25 April 2009

For my first attempt at writing a servlet test, I decided to test the LookupTableJsonServlet, which produces a list of all Look-up Tables in JSON format. I selected this one for two reasons: 1) it only supports the GET method, so I try out the default implementations of the other three HTTP methods handled by [...]

Testing Tools: DeleteMethodWebRequest

25 April 2009

Once I started to clone the GET method test to create similar tests for the PUT. POST, and DELETE methods, I discovered that there was a GetMethodWebRequest, a PutMethodWebRequest, and a PostMethodWebRequest, but no DeleteMethodWebRequest. That seemed a little odd to me, since all four are pretty standard methods in a REST environment, but it [...]

Testing Tools: BaseServletTestCase

23 April 2009

Since all of our REST servlets can trace their ancestry back to the RestServletBase, which supports the four basic HTTP methods of GET, PUT, POST, and DELETE, I wanted to create a base servlet test case that would test those same four HTTP methods. That seemed simple enough to do, so I started the new [...]

DAO Refactoring: Finishing up with Approval

18 April 2009

Now that we have the RequestForApprovalServlet and the RequestForApprovalSelectorServlet refactored to use the new RequestForApprovalManager, Spring, and Java 1.5, we need to make a few changes to the web app’s web.xml file and add in some Spring configuration and property files in order for all of this to work. The first thing that we need [...]

« Previous PageNext Page »