Monthly Archive for August, 2004

Getting mplayer to work in Fedora Core 2

Having just installed Fedora Core 2 on my home machine, I wanted to get mplayer working. They do have RPMs for FC2, but event though they installed ok, mplayer hangs during playback.

Then, I found this great HOW-TO, and I want you all to sing along. :)
Wonderfully clear writing, check it out!

http://www.mjmwired.net/resources/mplayer-fedora.shtml

Testing with spring

As I noted in my previous entry, I wish to use create when I test, but update when I deploy.

Now, I have created a second applicationContextForTest.xml file, that just defines the beans I wish to override, and in my unittests (this is actually done in a superclass), I just add that file to the end of the array of files to search. Now, I can override any values in my setup, and use that override only for testing. Works like a charm! =)

I just wish I could do the same with struts-config.xml, and StrutsTestCase, but no such luck yet. I do however have a copy of the fil, named struts-configForTest.xml that I use instead of the original file, but it’s just not as clean.

If/when StrutsTestCase starts supporting using more than one struts-config, I should be home-free though. Maybe I should look into doing this myself (or I could generate the second file using Ant).

Hibernate testing…

So, I was testing Spring and Hibernate a bit, and I stumbled into an issue.

When I restart Tomcat, Hibernate deletes all my rows from the database at startup (or actually drops the tables and recreates them). Seems you need to set the hibernate.hbm2ddl.auto property to update if you wish to keep data between sessions.

This was what I wanted. Now I just need to use another database for testing, or else I fill my database with testdata on each jUnit run. :) Any thoughts on this?

If you are using Spring, here’s the relevant section:



		
	


			com/mycompany/model/ModelObject.hbm.xml
		
	


net.sf.hibernate.dialect.MySQLDialect
update