Posts

Showing posts from January, 2009

Cargo-itest open source project

I recently started an open source project called cargo-itest. This was started up because when I worked on several projects I needed to create integration tests for them which all had similarities. I was previously doing it with the maven2 cargo plug-in but wasn't really fond of it because it most of the times didn't work and when it worked it stopped working after editing the configuration. In other words it was very unstable. This initiated me to start to use the java API of Cargo instead of the maven plugin. By using the java API it already removes the dependency from your build system in this case Maven. Having no dependency on the build system gives you a couple of advantages: You can run it in any IDE that supports JUnit. You can switch easily to another build system without changing your tests and test configuration. These are general advantages of just using the API but also part of using my open source project cargo-itest. This project enables you to easily start creat...

Specify context name in Tomcat

When developing web applications that are distributed as WAR files running in Tomcat most of the times you want to be able to specify the context name to a nicer name than Tomcat provides by default. Which is the name of the WAR file itself. When i.e. you are keeping the version within the name of the WAR this will result in some weird name like myapp-1.2. This is most of the times not what you want. Most of the times you want a nice context name like myapp without the version in it. According to the Tomcat documentation you can do it in 3 ways: Edit the server.xml Add a context.xml to the $CATALINA_HOME/conf/Catalina/localhost with the name of your context. Add a context.xml to your META-INF directory in your WAR file The first two options just work fine only the last one doesn't do the job for you for some reason. Personally the second option is the best option since it's not intrusive to your application and also not to Tomcat since you leave the server.xml alone. This way y...