Integrate FitNesse into Unity

Here’s a short how-to on creating a unity’s launcher to start, stop and open FitNesse.


First thing to do is download the FitNesse jar file from the download page and save it with +x permissions where you want to execute it from.

Then, you need to create a fitnesse.desktop file in ~/.local/share/applications with the execution permissions (+x) and the  following content:
[Desktop Entry]
Name=FitNesse
Comment=The fully integrated standalone wiki and acceptance test framework.
Exec=/usr/local/lib/atdd/fitnesse.sh
Icon=/usr/local/lib/atdd/FitNesseLogo.gif
Terminal=false
Type=Application
StartupNotify=true
X-Ayatana-Desktop-Shortcuts=OpenNewTab;ShutDown
[OpenNewTab Shortcut Group]
Name=Open In Firefox
Exec=firefox -new-tab http://localhost:8081
TargetEnvironment=Unity
[ShutDown Shortcut Group]
Name=Shut Down
Exec=/usr/local/lib/atdd/fitnesse-shutdown.sh
TargetEnvironment=Unity

This creates the launcher and some right-click options. The “/usr/local/lib/atdd” path is where the FitNesse jar is and the image for the icon is FitNesse’s logo. The fitnesse.sh and fitnesse-shutdown.sh files are a few bash commands to start and stop FitNesse, shown below for completeness. Once this file is ready, open the ~/.local/share/applications folder and drag the fitnesse.deskop file and drop it into the unity panel. And that’s it to get your customized launcher.

fitnesse.sh

#!/bin/bash
fitnesse_home="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
port="8081"
clear
echo "Starting FitNesse in port $port"
echo "FitNesse home is $fitnesse_home"
echo "..."
java -jar $fitnesse_home/fitnesse.jar -p $port

fitnesse-shutdown.sh
#!/bin/bash
fitnesse_home="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
port="8081"
clear
echo "Shutting down FitNesse in port $port"
echo "..."
java -cp $fitnesse_home/fitnesse.jar fitnesse.Shutdown -p $port

Reference:

ask ubuntu, question 13758

Desktop file specification extension

Starting and stopping FitNesse

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s