junitparams
Interface DataMapper

All Known Implementing Classes:
IdentityMapper

public interface DataMapper

Interface to be used by FileParameters'ized test methods. If you want to read your own format of data from file, implement the map method appropriately. For CSV files, just skip it.

Author:
Pawel Lipinski

Method Summary
 Object[] map(Reader reader)
          Maps file contents to parameters.
 

Method Detail

map

Object[] map(Reader reader)
Maps file contents to parameters. In your implementation read the data from the reader. The reader is closed in the framework, so just read it :) While reading transform the data into Object[][], where external dimension are different parameter sets, and internal dimension is the set of params per single test call You can optionally return Object[] with Strings inside, but each String must be a string in the same format as what you would normally pass to @Parameters({})

Parameters:
reader -
Returns:
an array with all parameter sets


Copyright © 2012 Pragmatists. All Rights Reserved.