Archive for 'Code'

Look-up Tables: Service configuration

4 June 2009

Yesterday, I tossed out a copy of my new LookupTableService without going into much detail about the use of the service or how to go about setting it up. Today, I’d like to correct that and add a little context to the story. Basically, I wanted to be able to get to table entries, not […]

Look-up Tables: LookupTableService

3 June 2009

Most of my usage of the Look-up Table service that we created has been on the client side of things, but ocassionally, I will have a need to reference a look-up table back on the server, or in a stand-alone batch job. To accommodate that, I could utilize the HttpClient library and access the data […]

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 […]

« Previous PageNext Page »