Donnerstag, 18. März 2010

TwiP JUnit Test with more then one Parameter

Here a example, how a JUnit test which use TwiP, can use more then one test parameter.



See also my previous contribution on TwiP here.

Links:

Dienstag, 9. März 2010

proposal SnakeYAML - Annotation YAML Loader

Andrey posts a comment on my blog post "YAML with snakeyaml" with the following question: "But I recognize a need to help pure Java<->YAML transformations.
Do you have an idea how the API may look like ? (to say just 'as in XStream' does not help much...)"

So here a first shot how a annotation based framework can look like:



here the YAML code:



and here a proposal for the API client code:



Feel free for comments ...

Dienstag, 2. März 2010

TwiP for Parameterized JUnit Tests

The native parameterized JUnit 4.X tests allows only one data set per test. With TwiP you can define one data set per test method, thats cool. Here a example  parameterized JUnit test with TwiP:



What not works in TwiP is the tree navigation (tested only in eclipse), because the mapping between the test tree result and the test methods is done by the name in the result tree. But TwiP add the paramter of the run in the name and then the mapping don't work :-( see the screenshot bellow, when you click on a test method you become a error dialog:



Links:

Montag, 1. März 2010

YAML with snakeyaml

I played a bit around with YAML, here my results. I have used the Java implementation snakeyaml. Unfortunately I have not found a implementation that use Java annotation for mapping between YAML and Java Bean Objects.



The Java bean code, for the configuration:



And here a small test which use snakeyaml to load the YML file:


There is also a cool plugin for YAML editor support in eclipse called yedit, here a screenshot:


Links: