Bent Andre Solheim Blog

Monday, February 27, 2006

CSS Magic

My guess is that this demo of a css frame shows a layout many web pages could use. Check it out! The content and design is not particularily good, but the technique is really interesting.

Sunday, February 26, 2006

JUnit 4.0 finally out

OK, I know it has been available a while already, but I have not been able to take it for a spin before recently.

Some of the focus of the new release is to make testing even easier. To achieve that, JUnit leverages some of the new features of Java 5, like annotations. There has been a lot of flaming about this - that you have to use Java 5 to be able to use the new features - but personally I think it's great (and necessary; I think JUnit would have lost its large group of users to alternatives like TestNG if they hadn't done something). You no longer have to inherit from TestCase, which makes testing protected functions easier (just let the Test class inherit from the class under test), and using annotations for denoting tests lets you use your own naming convention for tests (don't know if that really is a good idea or not), and lets any class contain tests. There are also other annotations that can been used to declare setUp functions, and setUp functions on the class level (a new feature in JUnit 4).

There are a couple of issues that may be a show stopper if you want to use JUnit 4. The first, as mentioned above, is that the new features requires Java 5 (although all 3.8.1 tests will still run). Now, keep in mind that Java 5 is only required for the runtime that runs the tests, so you can develop your production code for java 1.4 or 1.3 or whatever, and develop and run your tests on Java 5. The second issue is that Eclipse (and I'm sure other IDEs) does not have integrated support for running annotated tests as of 3.1.2. You have to go bleeding edge (>3.2 M2) to get that.

Dispite the discussion around the new JUnit, my conclusion so far is that an update is certainly worth it - if you can.

Thursday, February 23, 2006

Maven 2 - Profiles and Artifact Names - The Solution

As my mail on the maven-users list remained unanswered, I contacted the guys on the maven irc channel (irc.codehaus.org#maven) about the problem. Tryve Laugstøl was very helpful and answered my question quickly and accurately. His Blog Entry, was right on;

the trick is to use the classifier property of the maven-jar-plugin and maven-war-plugin:

<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>test</classifier>
</configuration>
</execution>
</executions>
</plugin>

(and similar for the war plugin)
This will append the classifier value to the artifact file name. Just what I needed! :)

Note; you will need the very latest war plugin build to get classifier support.

Maven 2 - Profiles and Artifact Names

We are using Maven2 big time on all our new projects now, and are in the process of converting our old projects from Maven1. For the most part this has gone pretty well - although we have had some issues with buggy plugins. However, lately I have had a requirement that I have not been able to find a solution to;

I have a web app that I need to build for deployment on different tomcat instances (production and test). To achieve this I use profiles; I use different properties files depending on the profile that was used for building. This works great.

Now, the problem I have is that in addition to deploying to a tomcat instance, I also would like to deploy the generated war file to our artifact repository;

mvn -Pprod deploy

This also works great, but a new requirement is that we want one artifact in the repository for the test environment and one for production. This is where the problem arises. Although I am able to use the property in each profile to set the name of the war file that ends up in the target folder, this does not affect the name that is used on the artifact when it is deployed to the repository using "mvn -Pprod deploy". The effect is that we are not able to distinguish the artifacts in the repository that was built using the test profile from those built using the production profile.

And now for a question to my dear readers; do you guys know if it is possible to alter the name of the artifact that ends up in the repository based on the profile that was used when deploying it? If not, does anybody have a tip to how I can go about achieving what we want in other ways? I thought about using different repositories for test and production, but this seems sub-optimal.

Love to have a tip on this one! ;)

Monday, February 20, 2006

Web Developer Toolbar & Menu for Opera

I recently found a toolbar for Opera for making web development easier. It's got a lot of features, but currently I've found myself using the "Open in IE", and "Open in FireFox" buttons the most.

Anyway, check the toolbar out. It may be usefull to you aswell;

http://nontroppo.org/wiki/WebDevToolbar

Sunday, February 12, 2006

Ruby on Rails hosting follow up

I'm still looking for a good Rails host. I have not rushed this decision - as you might have noticed. Got a nice tip on a comment of my previous post about this subject, but have not decided yet. It looks like there are many people in the same boat, so I will observe the community a bit longer.

If you are like me, this post may be of interest; Rails web host recommendations. A lot more comments on this post than on mine - please help me figure out why that is! ;)

Maybe FireFox is the "right" browser afterall

I have been a die-hard Opera fan for quite a while now. I just love the browser experience; the integrated RSS reader, mouse gestures, tabs and super-fast rendering. But no matter how hard it aces in my heart, I have to admit that FireFox really looks powerful - especially for developers. Though I can't list most of the developer-centric add-ons I have seen in the past from the top of my head, I know they exist. And knowing that many future web applications will include tons of javascript coding and debugging, plugins that help this process will make developers of next generation web applications more productive.

Okay, my point; check out FireBug. I might just be what you are looking for. Javascript debugging made amazing.

Looks like I just may have to go and install FireFox soon.

Friday, February 10, 2006

Moving my klog

I will be moving this klog to solheimweb.com. From now on, you can access it from http://solheimweb.com/klog. Hope to see you there!

c64s.com

I have never really understood why applets didn't hit harder than they did. They solve lots of problems that we are struggeling with even today, 10 years after they arrived. Oh, well... I guess they still might return with vengeance. My guess is that they will.

With a vengeance or not; the Commodore 64 is back by means of Java Applets! Stepping right up as the favourite candidate for Bent André Site of the Year 2006, the site c64s.com is built around a Java implementation of the C64. In addition they have uploaded and made available tons of classic games such as Giana Sistes, Bubble Bobble, Bomb Jack, Commando and lots more! They even provide screenshots of the games, so finding and playing your favorite game is super easy - right there in your browser...

Ready for a few moments of nostalgia?

Wednesday, February 08, 2006

UMLet

A few days ago I came across this super simple UML diagram editor. It's called UMLet and runs as a stand-alone application, or as an Eclipse plugin. One of the things that makes the application super simple is its approach to diagram editing. Each diagram element can be edited as text. It can aslo export diagrams as EPS and other image formats. First impression is that this is an excellent tool for early design drafts. Have a look!