Blog

Posts about technology and arts.

Invoking Testopia XML-RPC or JSON methods using Java

Most TestLink [1] users are aware that there is an external API, maybe for the external API token being displayed in the user profile section. Today after a meeting with Peter Florijn [2], I realized that the same may not be true for Testopia [3] users.

I am quite new to Testopia, and there are many features that I haven’t used yet. But if I understand it correctly, the database is interfaced by several Perl scripts that are, by its turns, exposed as Web Service (most of them). The web services are available via a JSON and a XML-RPC API (what is very useful, TestLink supports supports only XML-RPC).

The communication between different programming languages and the external API’s is accomplished by a client API. In TestLink you have testlink-java-api [4] and testlink-api-java-client [5].

Testopia has a Java client too, available in Testopia source repository [6] and can be used to integrate your existing Java code with Testopia.

How I started in Open Source

I was studying at Mackenzie Presbyterian University when I met Professor Rogerio Brito. Most of my friends were terrified of him. Maybe because of the class name “Structured Programming I”. Or maybe because of what Brito taught us at class.

My degree was in computing, Bachelor in System Information. Although it is related to Computer Science, we don’t have the same classes. In Computer Science you have more math, statistics and even physics, while in System Information you have administration, strategic planning, law and others related to business.

Although Structured Programming had a list of topics, Brito didn’t limit himself to those. Eventually he would try to teach us about algorithms, software complexity, the importance of writing academic papers and explain about Open Source software.

I remember one day we were dismissed before 10PM. I used to run for the bus stop for not being too late at home and cause it could be dangerous lingering on the streets of Consolacao neighborhood by myself, waiting for the bus. But that day I stumbled with Brito near the Professor’s Room.

Writing code to integrate Java projects to Testopia

Peter Florijn and I are writing a Jenkins plug-in to integrate several test tools into Jenkins, something similar to what is done in TestLink plug-in. It’s still an idea being explored, and the whole project is subjected to changes without warning. The code is at https://github.com/kinow/testthemall.

The first tool that we are integrating is not TestLink, but Mozilla Testopia. As part of the process to integrate these tools, many Java API’s to interface the existing external APIs will be created, like it was done in TestLink with TestLink Java API.

Installing Testopia is very easy and straightforward. This was the best guide that I could find, and worked without errors at my Debian Squeeze. I only had to move the directories from /var/www to my home directory (I use my PHP Eclipse workspace as Apache home).

Testopia has a XML-RPC APi, just like TestLink, however it lacks an user friendly documentation and examples. I migrated the Java driver from Ant to Maven, for the sake of commodity. But the XML-RPC server is complaining that I have to log-in before listing the test cases of a test plan.

If you are interested in using Java and Testopia, here’s the link for the java project with Maven support: https://github.com/kinow/testopia-java-driver. I will update the project with examples, more tests and will try to clean up the code. Probably I will use either GitHub pages or a Wiki somewhere to document how to use Testopia and Java.

Stay tuned!

Cheers,

Maven site tips: Maven Fluido Skin and Javadoc class diagrams

I have been using Maven sites for a while, and am very happy with it. I didn't like to have to update my projects after Maven 3, but that was all right, Maven 3 brought many new cool things. However, there were two things that annoyed me: lack of a nice and modern skin, and browsing Javadoc of complex code. The thought of creating a custom Maven skin even crossed my mind, but I never had time to read about it.

But the world is full of good and talented people! Like the guys from 99soft. They created Maven Fluido Skin, and donated it to Apache Software Foundation. It's built on top of Twitter's Bootstrap and available from Maven central repository. In order to use it in your Maven project, all that you have to do is add the following settings into your src/site/site.xml:

<skin>
    <groupId>org.apache.maven.skins</groupId>
    <artifactId>maven-fluido-skin</artifactId>
    <version>1.2.1</version>
</skin>

Here's a list of some projects using Maven Fluido Skin (hopefully, in the near future Apache Commons and other projects will adopt this skin as default too :-)):

Ranges in Apache Commons Functor

This is a long post. So here is a TL;DR:

  • Apache Commons Functor has no Double or Float Range (yet)
  • Apache Commons Functor IntegerRange and LongRange treat the low value as inclusive, and the high value as exclusive. How does that compare to other languages/APIs? (you will have to read to see some comparison)
  • Perl has support for characters ranges, perhaps we could implement it in Functor too?
  • In case we implemented a CharacterRange, it would have to be inclusive for both low and high limits. With 'z' being the last character, there wouldn't have a way to include Z with the current approach. Or we would have to make the CharacterRange a special one. What would go against Liskov Substitution Principle.
  • You can see a comparison table with Apache Commons Functor, other Java API's and other programming languages for ranges clicking here.
  • It would be nice to have a clear distinction in Functor documentation among a Sequence, a Generator and a Range. While I was gathering material for this post, I found places using range, others using sequence, and in Apache Commons Functor, an IntegerRange is a Generator.

Now, if you have some spare time or curiosity, keep reading :-)

Subscribe