Monthly Archives: June 2006

Since [trunk][trunk] went 2.0 there have been an extensive amount of failing unit tests. Many of them is because Wicket 2.0 is going to handle things differently which means some of the tests needs to be rewritten/changed to match the new behaviors. These are actually the hardest tests to fix, because they require some knowhow of the specific test.

Some of the tests fails because the ordering of the attributes when added to a tag from Wicket has changed. So all the diff tests which compares the output generated with a static html file now fails. The solution here is quite simple: Just create new static html files for comparison.

Last there were some tests that failed because you can’t add components to parent, which isn’t backed in a Markup file. Many tests just used a dummy page, with no .html file and therefore no matching wicket:id’s for the components added to that page. The solution for this is to have html files which matches the component tree in the tests. Luckily many of the tests had the exact same component hierachy (namely a Page with one component on it), so it didn’t require a new .html file for every one of them.

Yesterday I [fixed][patch] all the failing tests of the last type. I just hate failing unit tests ;-)

[trunk]: http://svn.sourceforge.net/viewcvs.cgi/wicket/trunk/
[patch]: http://svn.sourceforge.net/viewcvs.cgi/wicket?rev=6274&view=rev

I have begun extending the WicketTester to ease the testing of AJAX enabled Wicket applications
My first [patch][revision] extends the clickLink method into accepting clicks on
an AjaxLink. The method then invokes the onClick method on the AjaxLink.

This is a good way to simulate that a user clicks on an AjaxLink. At [Avaleo][avaleo] we use this
method a lot when testing that the flow is correct etc.

The next patch is going to be about actually testing that a component is added to an AjaxRequestTarget
when an AjaxEvent is fired. More on that later…

[revision]: http://svn.sourceforge.net/viewcvs.cgi/wicket?rev=6254&view=rev
[avaleo]: http://www.avaleo.net/

I have added a [patch][revision] for [Wicket 2.0][trunk] which introduces a [ClientEvent enum][clientevent]
for specifying which event on the client should fire the event.

So where you in 1.2 would write something like this:

...
Label label = new Label("label", "This is my label");
label.add(new AjaxEventBehavior("onclick") {
	public void onEvent(AjaxRequestTarget target) {
		// Do your stuff here.
	}
});
...

You now write this:

...
Label lavel = new Label(parent, "label", "This is my label");
label.add(new AjaxEventBehavior(ClientEvent.CLICK) {
	public void onEvent(AjaxRequestTarget target) {
		// Do your stuff here.
	}
});

Which eliminates the problem with misspelling the event name (like “onclck”, “click” or “onclicked”).

[revision]: http://svn.sourceforge.net/viewcvs.cgi/wicket?rev=6243&view=rev
[trunk]: http://svn.sourceforge.net/viewcvs.cgi/wicket/trunk/wicket/
[clientevent]: http://svn.sourceforge.net/viewcvs.cgi/wicket/trunk/wicket/src/java/wicket/ajax/ClientEvent.java?view=markup

I’ve just configured my new server, which are already running my [personal][billen] [websites] as well as my [girlfriend's][signestaunerdk] [websites][runawaybridedk].

The new server is a AMD64 3200+ with 2×250GB SATA discs configured in RAID1 (mirror). I also bought a 1GB RAM block, but either it’s damaged or else it simply don’t fit together with my ASUS A8N-VM. So right now I’ve only installed 512MB in it.

I have installed Ubuntu Server on it (of cause ;-) ), but it wasn’t as straight forward as I’ve hoped. The installer was ok for configuring the software raid, but for some reason it wouldn’t install grub on the harddisk. I had to manually do that and it was also then I found out that the installer hadn’t created a /boot/grub/menu.lst. But that was easy to create using update-grub.

But after that everything just worked perfectly (after the RAID partitions had been scrubbed)

If you are actually reading this post it also means that the new server is up’n'running and accesible from The Internet.

[billen]: http://billen.dk/
: http://i.billen.dk/
[signestaunerdk]: http://signestauner.dk/
[runawaybridedk]: http://runawaybride.dk/

After having got the [docking station][dock] and a [19" external monitor][monitor] at [my work][avaleo], I tried to find a way to have a dual-head setup with Xinerama. Though Ubuntu is very cool, it didn’t really know what it was that I wanted when I attached the external monitor to it. And because there ain’t any graphical interfaces to configure [X.org][xorg] in these directions I had to do it myself.

To begin with I tried to have the xserver figure out the best resolution, depth etc. which it normally does just fine. But I think it can’t cope with my 15.4″ laptop screen together with my 19″ external monitor. So strongly inspired by a [somewhat similar setup][dellsetup] I found out that I had to set it all myself. So below you can see my full /etc/X11/xorg.conf file.

# Please note the Xinerama option.
Section "ServerLayout"
	Identifier     "Dual-Head Setup"
	Screen      0  "Screen 1" 0 0
	Screen         "Screen 2" LeftOf "Screen 1"
	InputDevice    "Generic Keyboard"
	InputDevice    "Configured Mouse"
	Option         "Xinerama" "On"
	Option         "Clone"    "Off"
EndSection

Section "InputDevice"
	Identifier  "Generic Keyboard"
	Driver      "kbd"
	Option	    "CoreKeyboard"
	Option	    "XkbRules" "xorg"
	Option	    "XkbModel" "pc105"
	Option	    "XkbLayout" "dk"
EndSection

# This configures both the trackpoint mouse and my external USB mouse.
Section "InputDevice"
	Identifier  "Configured Mouse"
	Driver      "mouse"
	Option	    "CorePointer"
	Option	    "Device" "/dev/input/mice"
	Option	    "Protocol" "ExplorerPS/2"
	Option	    "Emulate3Buttons" "true"
EndSection

Section "Files"
	FontPath     "/usr/share/X11/fonts/misc"
	FontPath     "/usr/share/X11/fonts/cyrillic"
	FontPath     "/usr/share/X11/fonts/100dpi/:unscaled"
	FontPath     "/usr/share/X11/fonts/75dpi/:unscaled"
	FontPath     "/usr/share/X11/fonts/Type1"
	FontPath     "/usr/share/X11/fonts/100dpi"
	FontPath     "/usr/share/X11/fonts/75dpi"
	FontPath     "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "Module"
	Load  "i2c"
	Load  "bitmap"
	Load  "ddc"
	Load  "dri"
	Load  "extmod"
	Load  "freetype"
	Load  "glx"
	Load  "int10"
	Load  "type1"
	Load  "vbe"
EndSection

# Laptop LCD
Section "Monitor"
	Identifier   "Laptop LCD"
	Option	     "VendorName" "ATI Proprietary Driver"
	Option	     "ModelName" "Generic Autodetecting Monitor"
	Option	     "DPMS" "true"
	DisplaySize  331 207
	Modeline     "1680x1050"  122.00  1680 1712 1776 1904  1050 1051 1054 1066
EndSection

# Samsung TFT
Section "Monitor"
	Identifier   "Samsung 920N"
	Option	     "VendorName" "ATI Proprietary Driver"
	Option	     "ModelName" "Generic Autodetecting Monitor"
	Option	     "DPMS" "true"
	DisplaySize  376 301
	HorizSync    30-81
	VertRefresh  56-75
	ModeLine     "1280x1024" 108.00 1280 1328 1440 1688 1024 1025 1028 1066
EndSection

Section "Device"
	Identifier	"R600 for Laptop LCD"
	Driver		"fglrx"
	BusID       "PCI:1:0:0"
EndSection

Section "Device"
	Identifier  "R600 for Samsung 920N"
	Driver      "fglrx"
	BusID       "PCI:1:0:0"
	Screen      1
EndSection

Section "Screen"
	Identifier "Screen 1"
	Device     "R600 for Laptop LCD"
	Monitor    "Laptop LCD"
	DefaultDepth     24
	# The modes is important to set else it won't work
	SubSection "Display"
		Modes     "1680x1050"
		Depth     24
	EndSubSection
EndSection

Section "Screen"
	Identifier "Screen 2"
	Device     "R600 for Samsung 920N"
	Monitor    "Samsung 920N"
	DefaultDepth     24
	# The modes is important to set else it won't work
	SubSection "Display"
		Modes     "1280x1024"
		Depth     24
	EndSubSection
EndSection

Section "DRI"
	Mode         0666
EndSection

[avaleo]: http://www.avaleo.net
[dock]: http://www-131.ibm.com/webapp/wcs/stores/servlet/ProductDisplay?catalogId=-840&storeId=10000001&langId=-1&dualCurrId=73&categoryId=2581897&productId=4611686018425101091
[monitor]: http://www.samsung.com/Products/Monitor/LCD_Analog/LS19MJAKBZXAA.asp
[xorg]: http://www.x.org/
[dellsetup]: http://rdo.homelinux.org/ubuntu-linux-on-a-dell-latitude-d610/

[Finally the Dapper Drake has been set loose.][dapper]

I have as usual reinstalled my laptop using the final cd. This time though I tried the desktop install cd, where you install Ubuntu from a live cd. It’s actually a cool experience to be able to surf the internet while the installer is working in the background. And it didn’t actually take much longer than a normal install. Other distributions installers take ages to load (try [SuSE][suse] f.ex.), so compared to the Ubuntu livecd installer it actually seems slower because you can’t do anything while it installs.

I haven’t been testing all features yet (does sleep work again etc.) but I sure will do it.

[dapper]: http://www.ubuntu.com/
[suse]: http://www.opensuse.org/