Setting up your
Faban Development
Environment using the NetBeans® IDE
Integrated Development Environments (IDE) are getting
increased
popularity in the Java developer community. Whether you want to develop
a new Faban benchmark or integrate an existing benchmark by developing
harness hooks, likely you'll want to use your favorite IDE for such
development tasks. Instead of developing everything from scratch, the
Faban server and bundle distributions provide sample code and projects
that are very suitable to be used as templates for your new project. It
also contains standard build scripts to help you build and test your
project even better.
This document describes how you would set up the NetBeans IDE
to
work with projects following the Faban template.
1. Download and Install NetBeans IDE
This process is documented from NetBeans 5.0 and NetBeans 5.5.
However, it may as well work with other versions of NetBeans.
(Solaris) $ gunzip -c faban-server-xxxxxx.tar.gz | tar
xvf -
(Linux) $ tar xvf
faban-server-xxxxxx.tar.gz
(Win32) You'll need to find a utility
to untar
gzipped tar files for now.
This will create a directory named "faban" at your current
working directory.
We will refer to the Faban installation directory as
$FABAN_HOME
from now on.
3. Create your Faban project
The sample project contains the project structure you'll want
to
use to develop a Faban benchmark. It also includes build
scripts
that should be appropriate for the majority of Faban projects. Use the
following steps to copy the sample project and create your own project.
Locate your project directory. Note that this should not be
the
same as or under $FABAN_HOME.
On Win32, use Windows Explorer to copy the web1 directory
tree
to your project location and rename it to your preferred name.
We'll refer to your project directory (such as
myfabanproject) as $PROJECT_HOME.
4. Start NetBeans
Use the launcher in your GUI or start Netbeans from the
command line:
$ $NETBEANS_HOME/bin/netbeans &
It might take a few seconds or a few minutes to startup
Netbeans,
depending on the system you're running on. But finally the Netbeans UI
should show up on your desktop.
5. Configure Netbeans to know the Faban library
From the "Tools" menu on the menu bar, select "Library
Manager."
The library manager dialog box will pop up.
Click the "New Library..." button on the buttom left of the
dialog box. A new library dialog box will pop up.
In the "Library Name" field, enter "Faban."
Select "Class Libraries" from the "Library Type" field.
Click the "OK" button.
Select the "Classpath" tab.
Click the "Add JAR/Folder..." button.
Browse and select all jar files from the $FABAN_HOME/lib
directory, then click the "Add JAR/Folder" button.
Select the "Sources" tab.
Click the "Add JAR/Folder..." button.
Browse and select the $FABAN_HOME/src.zip file, then click
the
"Add JAR/Folder" button.
Select the "Javadoc" tab.
Click the "Add JAR/Folder..." button.
Browse and select the $FABAN_HOME/javadocs.zip file, then
click
the "Add JAR/Folder" button.
Press "OK" to confirm your addition of the Faban library.
6. Create a new project in NetBeans
From the "File" menu on the menu bar, select "New
Project..." A
"New Project" dialog box will pop up.
In the "Categories" box, select "General."
In the "Projects" box, select "Java Project with Existing
Ant
Script.
Click the "Next >" button.
In the "Location" field, enter your $PROJECT_HOME or click
brows
and select your $PROJECT_HOME directory.
All other fields in this screen will get filled in
automatically.
The "Project Name" field wil show "Faban Benchmark". Change
it to
reflect your benchmark project name.
Click the "Next >" button. The next screen will show
the build
and run options.
The build and run options shown on the next screen are
already
set properly. Click ent "Next >" button to go to the "Select
Package
Folders" screen.
For the source package folders, click on "Add Folder..."
Select the src folder and press "Open."
Leave the test package folders blank.
Click the "Next >" button to go to the classpath
screen.
Click "Add JAR/Folder..." to select the JAR files used in
the
classpath.
Navigate the file browser to the $FABAN_HOME/lib directory,
select all jar files in this directory.
Click the "Open" button to add these files to the classpath.
Click the "Finish" button to create the project. Your new
benchmark project should be added to NetBeans' "Projects" tab.
7. Configuring you new NetBeans project
In the "Projects" tab (on the left of the IDE), right click
on
the new project's name and select "Properties" from the bottom of the
popup menu.
In the "Categories" box on the left, select "Output."
Click the "Add JAR/Folder..." button and select
$PROJECT_HOME/build/classes. Click "Open" to finish selection.
In the "Categories" box on the left, select "Build and Run."
At the "Custom Menu Items" table at the bottom, click "Add."
In the "Ant Target" column, pull down the list and select
"deploy."
In the "Label" column, double click and type in "Deploy
Project",
press the tab key.
Click the "OK" button accept the settings and finish
configuring
your NetBeans project.
8. Configure your build.properties file
Select the "Files" tab on the left window in the NetBeans
IDE.
Expand your new project to see the files it contains.
Double-click on "build.properties" and Netbeans will open
the
file in the editor window.
Edit the file as follows:
Set the "bench.shortname" property to the short name of
your
benchmark. Spaces are not allowed here.
Set the "faban.home" property to $FABAN_HOME on your
development
system.
Set the "faban.url" property to point to your test system.
For
example, if your test system name is "foo", set faban.url to
"http://foo:9980/". If your development and test system is the same,
just set it to "http://localhost:9980". The default Faban
port is 9980.