Friday, 22 August 2008

Java: Display Java code in HTML

It was rather difficult to find a utility for Java code export to HTML but at last I found a free tool called Java Code Export which do a decent job but requires some manual steps after a conversion, why I am not 100% satisfied with this solution. Any tips are welcome in this subject.

For formating testing purposes I publish this tiny Java method for creating random numbers:

     /**

     *

     * @param lowerLimit

     * @param upperLimit

     * @return A random integer number between lowerLimit and upperLimit

     */

    static int createRandomNumberInt (int lowerLimit, int upperLimit)    {

        Random generator = new Random();

        return generator.nextInt (upperLimit-lowerLimit) + lowerLimit;

    }

Wednesday, 13 August 2008

Java: My first Class...

...is ready and seems to work!

My programming experience has envolved some languages over the years and here is a summary:

1984-1990 Basic on Sinclair Spectrum (developing small simple games at home)
1990 Pascal on PC/Windows (small simple programs at high school)
1991 C on Unix and PC/Windows (simple programs at high school)
1991 Assembler (simple robot programs at high scool)
1994- JavaScript (web and test tool utilities at home and at work)
1998-2000 LabView (programs for hardware interaction at work)
2000- VBScript (automation and test tools utilities at work)
2002- SQL (various scripts at work including Store procedure programming)
2002-2006 Loadrunner "C" (performance scripts at work)

and now I can add

2008- Java (automation and test tools at work)

I have read a couple of Java books during my vacation and hopefully I understand a bit more about the OO concept than before as well as the Java syntax.

I have started off with a simple Class for test data utilities and I have rewritten some of my old VBScript functions into Java methods. And so far it works pretty well. One of the major benefits is that I now got an decent IDE in ItelliJ IDEA compared to using QTP's native IDE for VBScript.

My initial goal is to rework my test framework for Web Service testing as there are some powerful utilites available for Java (generate test classes from WSDL for example).