quality@glassfish.java.net

Using Netbeans to Write and Run SQE ant-based tests !!

From: Judy Tang <Judy.J.Tang_at_Sun.COM>
Date: Fri, 27 Oct 2006 14:59:39 -0700

Thanks Varun for sending this email. I am so happy to read it and I
would like to
give you a big support. The more people use NB, the more testing it gets.

Here is the Sun internal link where for those of you can access the link
you can find
out where to download the NB and how to install and start the NB.

http://appserver-sqe.red.iplanet.com/twiki/bin/view/SQEAdmin90/HowToTestPlugin

Here is the NetBeans web site to download the NB: http://www.netbeans.org/

Thanks,
Judy
Varun Rupela wrote:

> please see inline....
>
> Varun Rupela wrote:
>
>> Hi:
>>
>> Use cool IDE features like auto-completion, refactoring when writing
>> java code and even build files, and also run the ant targets from
>> within Netbeans !! Here's how to do it (using a template NB free-form
>> project)
>>
>> SETUP
>> 1. Either add SPS_HOME, S1AS_HOME to the system environment and Start
>> Netbeans from command line
>> OR add SPS_HOME, S1AS_HOME to the netbeans start script and use the
>> NB icon to Start Netbeans.
>> (These environment variables are required to resolve references like
>> ${env.SPS_HOME} in our workspace)
>> 2. Update <netbeans-install>/etc/netbeans.conf to include location of
>> s1as.home and sps.home like this:
>> netbeans_default_options="-J-Ds1as.home=\"/home/emvy/glassfish\"
>> -J-Dsps.home=\"/home/emvy/workspace/appserver-sqe\"
>> -J-Dswing.aatext=true -J-Xms128m -J-Xmx512m -J-XX:PermSize=64m
>> -J-XX:MaxPermSize=160m -J-ea -J-Dapple.laf.useScreenMenuBar=true"
>
> please use this instead -
> netbeans_default_options="-J-Ds1as.home=$S1AS_HOME
> -J-Dsps.home=$SPS_HOME -J-Dswing.aatext=true -J-Xms128m -J-Xmx512m
> -J-XX:PermSize=64m -J-XX:MaxPermSize=160m -J-ea
> -J-Dapple.laf.useScreenMenuBar=true"
>
>> (This is required to get src files, with references to java ee APIs
>> or reporter, to compile). Note that these variables are referred to
>> in the project templates nbproject/project.xml file (see below for
>> location of template) and are used for the Java Source Classpath.
>> 3. Checkout SPS_HOME/pe/util/netbeans-templates
>>
>> WRITE TESTS
>> 1. In Netbeans, Open Project Folder (ctrl+shft+o)
>> SPS_HOME/pe/util/netbeans-templates/basic-project
>> 2. In Projects window - Right click on project
>> "basic-project-template", and select copy. Give appropriate name,
>> location and click <Copy>.
>> 3. Begin Writing your Test in the new project (put client classes in
>> src/client; entities in src/entities; make changes to the build.xml
>> file as desired; create descriptor dir etc). You can of course create
>> a package hierarchy under the client and entities packages. Enjoy the
>> NB features !!
>> 4. To Run ant targets from inside Netbeans - right click on project
>> folder in the project window and just select the appropriate ant target.
>>
>> YOU CAN DO MORE:
>> 1. Add Custom Ant Target and link them with the right-click menu. For
>> that - right-click on the project; select properties; select category
>> "Build and Run" and add to the Custom Menu Items. You can choose any
>> ant targets from your build file and even from the sqe-common.xml file.
>> (Please ensure that your tests build file has !DOCTYPE entries
>> looking like this
>> <!ENTITY commonSetup SYSTEM
>> "../../../../build-config/sqe-common.xml">; basically without the
>> "file" key word.)
>> 2. Add more templates for your own modules - Copy this basic project
>> template, customize it; create a templates dir for your own module
>> under SPS_HOME/pe/util/netbeans-template and begin checking in
>> templates for the various kinds of tests you have.
>>
>> Thanks.
>>
>> Varun. Sony.
>
>