Archive for April, 2008

It’s fairly common to have your continuous integration tool running on the same machine that has your source code repository. It’s also fairly common to have your development server running on that same machine as well. But what if you don’t?

At my workplace we use Hudson for continuous integration (and anyone who’s read my blog knows I’m a big fan) and Subversion (which is also awesome) for source code management. These both run on the same machine. We also use JBoss as our web/app server, but on different machines, including the web server set up for development testing. We wanted to do automatic deployment to our development JBoss upon successful completion of a build.

Read the rest of this entry »

Comments No Comments »

At my workplace we’ve started writing JUnit tests to monitor our systems and the systems of the other departements. One unit test pings all the servers we talk to or administer; one does an HTTP get from all the web servers we run, as well as the servers whose web services we call; another test does a quick query against all the databases we hit. We’ve set these JUnit tests up in Hudson to run every ten minutes; one failed test makes the project go unstable, and we get notifications by email and get on top of problems before the other departments notice it. They have their own monitoring software, which is pretty good, but we aren’t given access to it, and this way we get independent confirmation of what they are checking on.

We got this idea from something similar we did at a client of mine in a previous gig. To do cascading delete referential integrity, the DBA’s needed* to use a delete trigger. Well, any time they made a change to the underlying table, they had to take the trigger off, make the change, then put the trigger back. Guess how often they remembered to put the trigger back. Anyway, we got so tired of them forgetting this and having to fix stuff all the time, that we wrote a unit test to make sure that deletes always cascaded like they were supposed to. Anytime they didn’t, we knew they dropped the trigger, and we got on the phone and fussed at them.

So, on the agenda for our suite are other neat things, such as connecting to our Dev, QA, and Prod databases, grabbing the metadata, and looking for subtle differences like missing indexes from one environment or another. We plan to make sure that the JBoss configuration files (such as connection pool definitions, system properties, JVM memory settings, etc) match what we have saved a copy of so we can tell if someone changes the server’s configuration without telling us about it. We’ll check Java versions, OS versions, etc. Anything that is external to our apps that can affect the success of those apps, we’ll make tests for it. We’ll have executable documentation of our assumptions.

After all, the real purpose of a JUnit test is to assert that something is true; and if it’s not, you’ve got a problem. Nothing says that what you assert to be true has to be the behavior of code — it could be almost anything.

*I seriously doubt that they had to do it that way, but that was the way they insisted on doing it.

Comments No Comments »

I’ve started introducing Apache JMeter at my workplace as a tool for automatic functional and load testing of Web Services. This is the first of what I plan to be the first of a multi-part series on setting up JMeter, developing tests for it, and incorporating its output as part of an overall strategy for testing our code as it moves through the lifecycle.

A bit about JMeter

At the JMeter site, they define JMeter as “…a 100% pure Java desktop application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions.” One of the other types of applications it can test is a Web Service - which of course is not terribly different from testing a regular web application.
Read the rest of this entry »

Comments 1 Comment »

Andy Glover’s company Stelligent has a great article about Selenium on their corporate blog - definitely worth a read.

Comments No Comments »

Here is a powerpoint presentation I once did for a joint conference of the Hampton Roads Oracle User Group and Greater Richmond Oracle User Group.  The presentation goes over how you can use DBCP to add connection pooling to your application, and how to hook up your application to use JDBC connection pools provided by your application server via JNDI.

Also available is a partial Eclipse project with sample code - but it is truly partial. To execute the code, you’ll need to add in client jars for your app server and set up a database to work with.

Comments No Comments »

Ever since GotDotNet shut down, it’s become very difficult to find a copy of the .NET Web Service Studio 2.0.

So, as a public service, I am providing it for download free of charge here.

If you’re not familiar with it, here is a blurb from the readme and a screenshot:

.NET Webservice Studio is a tool to invoke webmethods interactively. The user can provide a WSDL endpoint. On clicking button Get the tool fetches the WSDL, generates .NET proxy from the WSDL and displays the list of methods available. The user can choose any method and provide the required input parameters. On clicking Invoke the SOAP request is sent to the server and the response is parsed to display the return value.

This tool is meant for webservice implementers to test their webservices without having to write the client code. This could also be used to access other webservices whose WSDL endpoint is known.

wsstudio2.0.jpg

Comments 9 Comments »