Tag

Posts tagged with ‘java’

Building Jenkins with Eclipse and m2e plug-in

kinow @ Sep 20, 2011 17:50:04

Yesterday I finally managed to build Jenkins using Eclipse and m2e plug-in. With Eclipse Indigo release came a new version of the Maven plug-in for Eclipse (former M2Eclipse), m2e. Since I started using Eclipse Indigo and this new plug-in I hadn’t been able to build Jenkins in Eclipse anymore.

I’ve been having a terrible fever and thought that it would be a good thing to stop playing Minecraft for a while and find a way to build Jenkins in Eclipse + m2e :-).

1. Maven Plug-ins execution in project life cycle

The first thing I’ve noticed were the messages regarding the execution of some Maven plug-ins in the project life cycle. m2e delegates the execution of Maven plug-ins to an external executor. As not all Maven plug-ins have an existing executor for m2e you will receive a message similar to “Plugin execution not covered by lifecycle configuration: …”.

( Read more … )

Discussing the flexibility of TAP to cover information generated by TestNG

kinow @ Mar 20, 2011 03:34:05

In today’s post I am expanding the previous one regarding the use of TAP with TestNG. Let’s discuss about the flexibility of TAP to cover information generated by TestNG, more specifically:

  • Expected Exceptions
  • Data Providers
  • Groups
  • Tests that get skipped
  • Dependencies

We will be addressing these bullet points using tap4j, a TAP implementation for Java. The integration between TAP and TestNG is done through the use of TestNG Listeners developed in tap4j project (a big thanks here to Cesar Fernandes de Almeida for all his help).

There are two listeners in tap4j, br.eti.kinoshita.tap4j.ext.testng.TestTAPReporter and br.eti.kinoshita.tap4j.ext.testng.SuiteTAPReporter. The first was created based on org.testng.reporters.TestHTMLReporter and the latter was created based on org.testng.reporters.SuiteHTMLReporter.

In this figure you have testing tools as TAP producers (left) and different types of applications as consumers (right)

( Read more … )

Getting the maximum from TestNG with TAP

kinow @ Mar 10, 2011 01:24:38

Strangely enough, today I decided start to write about TAP (Test Anything Protocol) and received a mail from a Linkedin Group with a white paper about data integration in information systems. Well, let me first explain what is TAP, or Test Anything Protocol. This protocol was created in the beginning of Perl to log test results and is still being used by Perl and other languages (PHPUnit can output TAP too, for instance).

Now, if you already know about TAP and YAML, or if you are like me and like trying things out before reading a long text, then go to the hands on part of this post.

An output in TAP, or a TAP stream, is written in pure text in a human readable way. Like follows:

TAP version 13
1..2
ok 1 Test 1
not ok 2 Missing test parameter: url

( Read more … )

tap4j - A new TAP implementation in Java

kinow @ Oct 12, 2010 09:45:49

A month ago I started a project to help me in my new version of the TestLink Hudson plug-in. The plugin now relies heavily on Apache Maven for test execution. After reading a post on TestLink forum about an automation done using TAP, I googled to learn what that acronym stood for.

TAP is the abbreviation of Test Anything Protocol.It is a protocol to produce information about test execution and used mainly by the Perl community. For instance, you can test your system using PHPUnit, JUnit, Selenium or even a C class and produce what they call a TAP Stream. This stream’s content is like follows:

TAP version 13
1..2
ok 1 Test 1
ok 2

The text above tells us that we are using the version 13 of TAP. That we have 2 tests (1..‘2’) and that both tests were executed without errors. TAP is a human readable text that can be interpreted by a software for audit, report or whatever. Another tool can then parse this TAP Stream and prepare Reports, update Database among other uses (this is what TestLink Hudson plug-in is going to do on its new version ;-).

tap4j is a simple Java implementation of the TAP protocol (sorry to repeat the protocol part of the acronym right after it, but sounds cool :-). The project is built with Java 1.5 and Maven and hosted on SourceForge. The artifacts are published on Maven Central Repository but the jar is also uploaded into SourceForge. Up to now the project has only two members. Apart from me, there is César Fernandes Almeida, a friend from university that is helping me with the ideas, tests and code. But we really need more help, specially from people that know Perl (Harness, Simple, etc) to help us make integration tests using TAP Streams generated by these tools.

The 1.0 version supports Header, Plan, Footer, Test Results, Comments and Bail Out expressions. All these supported elements can be retrieved through the API, even the comments list. Any invalid text is ignored but you can also retrieve this information using the API.

We are already working on a new version, 1.1. This version will support YAML diagnostics, letting you put a whole Exception stack trace on your TAP Stream. Nice uhn? Check how YAML looks like.

file:  foo.t
line:  45
description: an important test
found: this
wanted: that
raw_test: is( "this", "that", "an important test" );
extensions:
    THAC0: 16

Cheers

Jacobe Maven Plugin

kinow @ Sep 29, 2010 16:43:25

When I started working in the TestLink java api with Daniel Padilla, he mentioned in some of his mails a tool called Jacobe. After I googled for this tool I found it in TIOBE‘s website. Jacobe is a tool of TIOBE that beautifies your Java code, according to some rules that you can specify in one configuration file.

This is what Jacobe does, basically.

Jacobe itself is an executable but TIOBE provides an Ant task that lets you call Jacobe from an Ant build file. But wait a minute! What about Maven? Yeah, exactly. Jacobe lacked of Maven support. I talked to the guys from TIOBE and they kindly let me implement a Maven Plugin for Jacobe.

The plugin source code is hosted at SourceForge.net, and you can find a quick Introduction about it in http://maven-jacobe.sourceforge.net/. The maven plugin version 1.0 artifact was released on Wednesday to Sonatype’s release repository and Sonatype already enabled Maven Central Repository synchronization. However it may take some time for them update the repository index.

Cheers.