xref: /aosp_15_r20/external/junit-params/apidocs/junitparams/DataMapper.html (revision b2c653efad15baf736c94ef04454e05088f2cbb7)
1*b2c653efSSorin Basca<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2*b2c653efSSorin Basca<!--NewPage-->
3*b2c653efSSorin Basca<HTML>
4*b2c653efSSorin Basca<HEAD>
5*b2c653efSSorin Basca<!-- Generated by javadoc (build 1.6.0_31) on Tue May 15 23:03:17 FET 2012 -->
6*b2c653efSSorin Basca<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
7*b2c653efSSorin Basca<TITLE>
8*b2c653efSSorin BascaDataMapper (JUnitParams 0.5.1-SNAPSHOT API)
9*b2c653efSSorin Basca</TITLE>
10*b2c653efSSorin Basca
11*b2c653efSSorin Basca<META NAME="date" CONTENT="2012-05-15">
12*b2c653efSSorin Basca
13*b2c653efSSorin Basca<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">
14*b2c653efSSorin Basca
15*b2c653efSSorin Basca<SCRIPT type="text/javascript">
16*b2c653efSSorin Bascafunction windowTitle()
17*b2c653efSSorin Basca{
18*b2c653efSSorin Basca    if (location.href.indexOf('is-external=true') == -1) {
19*b2c653efSSorin Basca        parent.document.title="DataMapper (JUnitParams 0.5.1-SNAPSHOT API)";
20*b2c653efSSorin Basca    }
21*b2c653efSSorin Basca}
22*b2c653efSSorin Basca</SCRIPT>
23*b2c653efSSorin Basca<NOSCRIPT>
24*b2c653efSSorin Basca</NOSCRIPT>
25*b2c653efSSorin Basca
26*b2c653efSSorin Basca</HEAD>
27*b2c653efSSorin Basca
28*b2c653efSSorin Basca<BODY BGCOLOR="white" onload="windowTitle();">
29*b2c653efSSorin Basca<HR>
30*b2c653efSSorin Basca
31*b2c653efSSorin Basca
32*b2c653efSSorin Basca<!-- ========= START OF TOP NAVBAR ======= -->
33*b2c653efSSorin Basca<A NAME="navbar_top"><!-- --></A>
34*b2c653efSSorin Basca<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
35*b2c653efSSorin Basca<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
36*b2c653efSSorin Basca<TR>
37*b2c653efSSorin Basca<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
38*b2c653efSSorin Basca<A NAME="navbar_top_firstrow"><!-- --></A>
39*b2c653efSSorin Basca<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
40*b2c653efSSorin Basca  <TR ALIGN="center" VALIGN="top">
41*b2c653efSSorin Basca  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
42*b2c653efSSorin Basca  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
43*b2c653efSSorin Basca  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
44*b2c653efSSorin Basca  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/DataMapper.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
45*b2c653efSSorin Basca  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
46*b2c653efSSorin Basca  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
47*b2c653efSSorin Basca  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
48*b2c653efSSorin Basca  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
49*b2c653efSSorin Basca  </TR>
50*b2c653efSSorin Basca</TABLE>
51*b2c653efSSorin Basca</TD>
52*b2c653efSSorin Basca<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
53*b2c653efSSorin Basca</EM>
54*b2c653efSSorin Basca</TD>
55*b2c653efSSorin Basca</TR>
56*b2c653efSSorin Basca
57*b2c653efSSorin Basca<TR>
58*b2c653efSSorin Basca<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
59*b2c653efSSorin Basca&nbsp;PREV CLASS&nbsp;
60*b2c653efSSorin Basca&nbsp;<A HREF="../junitparams/FileParameters.html" title="annotation in junitparams"><B>NEXT CLASS</B></A></FONT></TD>
61*b2c653efSSorin Basca<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
62*b2c653efSSorin Basca  <A HREF="../index.html?junitparams/DataMapper.html" target="_top"><B>FRAMES</B></A>  &nbsp;
63*b2c653efSSorin Basca&nbsp;<A HREF="DataMapper.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
64*b2c653efSSorin Basca&nbsp;<SCRIPT type="text/javascript">
65*b2c653efSSorin Basca  <!--
66*b2c653efSSorin Basca  if(window==top) {
67*b2c653efSSorin Basca    document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>');
68*b2c653efSSorin Basca  }
69*b2c653efSSorin Basca  //-->
70*b2c653efSSorin Basca</SCRIPT>
71*b2c653efSSorin Basca<NOSCRIPT>
72*b2c653efSSorin Basca  <A HREF="../allclasses-noframe.html"><B>All Classes</B></A>
73*b2c653efSSorin Basca</NOSCRIPT>
74*b2c653efSSorin Basca
75*b2c653efSSorin Basca
76*b2c653efSSorin Basca</FONT></TD>
77*b2c653efSSorin Basca</TR>
78*b2c653efSSorin Basca<TR>
79*b2c653efSSorin Basca<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
80*b2c653efSSorin Basca  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
81*b2c653efSSorin Basca<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
82*b2c653efSSorin BascaDETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
83*b2c653efSSorin Basca</TR>
84*b2c653efSSorin Basca</TABLE>
85*b2c653efSSorin Basca<A NAME="skip-navbar_top"></A>
86*b2c653efSSorin Basca<!-- ========= END OF TOP NAVBAR ========= -->
87*b2c653efSSorin Basca
88*b2c653efSSorin Basca<HR>
89*b2c653efSSorin Basca<!-- ======== START OF CLASS DATA ======== -->
90*b2c653efSSorin Basca<H2>
91*b2c653efSSorin Basca<FONT SIZE="-1">
92*b2c653efSSorin Bascajunitparams</FONT>
93*b2c653efSSorin Basca<BR>
94*b2c653efSSorin BascaInterface DataMapper</H2>
95*b2c653efSSorin Basca<DL>
96*b2c653efSSorin Basca<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../junitparams/internal/IdentityMapper.html" title="class in junitparams.internal">IdentityMapper</A></DD>
97*b2c653efSSorin Basca</DL>
98*b2c653efSSorin Basca<HR>
99*b2c653efSSorin Basca<DL>
100*b2c653efSSorin Basca<DT><PRE>public interface <B>DataMapper</B></DL>
101*b2c653efSSorin Basca</PRE>
102*b2c653efSSorin Basca
103*b2c653efSSorin Basca<P>
104*b2c653efSSorin BascaInterface to be used by FileParameters'ized test methods. If you want to read
105*b2c653efSSorin Basca your own format of data from file, implement the map method appropriately.
106*b2c653efSSorin Basca For CSV files, just skip it.
107*b2c653efSSorin Basca<P>
108*b2c653efSSorin Basca
109*b2c653efSSorin Basca<P>
110*b2c653efSSorin Basca<DL>
111*b2c653efSSorin Basca<DT><B>Author:</B></DT>
112*b2c653efSSorin Basca  <DD>Pawel Lipinski</DD>
113*b2c653efSSorin Basca</DL>
114*b2c653efSSorin Basca<HR>
115*b2c653efSSorin Basca
116*b2c653efSSorin Basca<P>
117*b2c653efSSorin Basca
118*b2c653efSSorin Basca<!-- ========== METHOD SUMMARY =========== -->
119*b2c653efSSorin Basca
120*b2c653efSSorin Basca<A NAME="method_summary"><!-- --></A>
121*b2c653efSSorin Basca<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
122*b2c653efSSorin Basca<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
123*b2c653efSSorin Basca<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
124*b2c653efSSorin Basca<B>Method Summary</B></FONT></TH>
125*b2c653efSSorin Basca</TR>
126*b2c653efSSorin Basca<TR BGCOLOR="white" CLASS="TableRowColor">
127*b2c653efSSorin Basca<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
128*b2c653efSSorin Basca<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>[]</CODE></FONT></TD>
129*b2c653efSSorin Basca<TD><CODE><B><A HREF="../junitparams/DataMapper.html#map(java.io.Reader)">map</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A>&nbsp;reader)</CODE>
130*b2c653efSSorin Basca
131*b2c653efSSorin Basca<BR>
132*b2c653efSSorin Basca&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Maps file contents to parameters.</TD>
133*b2c653efSSorin Basca</TR>
134*b2c653efSSorin Basca</TABLE>
135*b2c653efSSorin Basca&nbsp;
136*b2c653efSSorin Basca<P>
137*b2c653efSSorin Basca
138*b2c653efSSorin Basca<!-- ============ METHOD DETAIL ========== -->
139*b2c653efSSorin Basca
140*b2c653efSSorin Basca<A NAME="method_detail"><!-- --></A>
141*b2c653efSSorin Basca<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
142*b2c653efSSorin Basca<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
143*b2c653efSSorin Basca<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
144*b2c653efSSorin Basca<B>Method Detail</B></FONT></TH>
145*b2c653efSSorin Basca</TR>
146*b2c653efSSorin Basca</TABLE>
147*b2c653efSSorin Basca
148*b2c653efSSorin Basca<A NAME="map(java.io.Reader)"><!-- --></A><H3>
149*b2c653efSSorin Bascamap</H3>
150*b2c653efSSorin Basca<PRE>
151*b2c653efSSorin Basca<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>[] <B>map</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A>&nbsp;reader)</PRE>
152*b2c653efSSorin Basca<DL>
153*b2c653efSSorin Basca<DD>Maps file contents to parameters. In your implementation read the data
154*b2c653efSSorin Basca from the reader. The reader is closed in the framework, so just read it
155*b2c653efSSorin Basca :)
156*b2c653efSSorin Basca
157*b2c653efSSorin Basca While reading transform the data into Object[][], where external
158*b2c653efSSorin Basca dimension are different parameter sets, and internal dimension is the set
159*b2c653efSSorin Basca of params per single test call
160*b2c653efSSorin Basca
161*b2c653efSSorin Basca You can optionally return Object[] with Strings inside, but each String
162*b2c653efSSorin Basca must be a string in the same format as what you would normally pass to
163*b2c653efSSorin Basca &#064;Parameters({})
164*b2c653efSSorin Basca<P>
165*b2c653efSSorin Basca<DD><DL>
166*b2c653efSSorin Basca<DT><B>Parameters:</B><DD><CODE>reader</CODE> -
167*b2c653efSSorin Basca<DT><B>Returns:</B><DD>an array with all parameter sets</DL>
168*b2c653efSSorin Basca</DD>
169*b2c653efSSorin Basca</DL>
170*b2c653efSSorin Basca<!-- ========= END OF CLASS DATA ========= -->
171*b2c653efSSorin Basca<HR>
172*b2c653efSSorin Basca
173*b2c653efSSorin Basca
174*b2c653efSSorin Basca<!-- ======= START OF BOTTOM NAVBAR ====== -->
175*b2c653efSSorin Basca<A NAME="navbar_bottom"><!-- --></A>
176*b2c653efSSorin Basca<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
177*b2c653efSSorin Basca<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
178*b2c653efSSorin Basca<TR>
179*b2c653efSSorin Basca<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
180*b2c653efSSorin Basca<A NAME="navbar_bottom_firstrow"><!-- --></A>
181*b2c653efSSorin Basca<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
182*b2c653efSSorin Basca  <TR ALIGN="center" VALIGN="top">
183*b2c653efSSorin Basca  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
184*b2c653efSSorin Basca  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
185*b2c653efSSorin Basca  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
186*b2c653efSSorin Basca  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/DataMapper.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
187*b2c653efSSorin Basca  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
188*b2c653efSSorin Basca  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
189*b2c653efSSorin Basca  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
190*b2c653efSSorin Basca  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
191*b2c653efSSorin Basca  </TR>
192*b2c653efSSorin Basca</TABLE>
193*b2c653efSSorin Basca</TD>
194*b2c653efSSorin Basca<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
195*b2c653efSSorin Basca</EM>
196*b2c653efSSorin Basca</TD>
197*b2c653efSSorin Basca</TR>
198*b2c653efSSorin Basca
199*b2c653efSSorin Basca<TR>
200*b2c653efSSorin Basca<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
201*b2c653efSSorin Basca&nbsp;PREV CLASS&nbsp;
202*b2c653efSSorin Basca&nbsp;<A HREF="../junitparams/FileParameters.html" title="annotation in junitparams"><B>NEXT CLASS</B></A></FONT></TD>
203*b2c653efSSorin Basca<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
204*b2c653efSSorin Basca  <A HREF="../index.html?junitparams/DataMapper.html" target="_top"><B>FRAMES</B></A>  &nbsp;
205*b2c653efSSorin Basca&nbsp;<A HREF="DataMapper.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
206*b2c653efSSorin Basca&nbsp;<SCRIPT type="text/javascript">
207*b2c653efSSorin Basca  <!--
208*b2c653efSSorin Basca  if(window==top) {
209*b2c653efSSorin Basca    document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>');
210*b2c653efSSorin Basca  }
211*b2c653efSSorin Basca  //-->
212*b2c653efSSorin Basca</SCRIPT>
213*b2c653efSSorin Basca<NOSCRIPT>
214*b2c653efSSorin Basca  <A HREF="../allclasses-noframe.html"><B>All Classes</B></A>
215*b2c653efSSorin Basca</NOSCRIPT>
216*b2c653efSSorin Basca
217*b2c653efSSorin Basca
218*b2c653efSSorin Basca</FONT></TD>
219*b2c653efSSorin Basca</TR>
220*b2c653efSSorin Basca<TR>
221*b2c653efSSorin Basca<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
222*b2c653efSSorin Basca  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
223*b2c653efSSorin Basca<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
224*b2c653efSSorin BascaDETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
225*b2c653efSSorin Basca</TR>
226*b2c653efSSorin Basca</TABLE>
227*b2c653efSSorin Basca<A NAME="skip-navbar_bottom"></A>
228*b2c653efSSorin Basca<!-- ======== END OF BOTTOM NAVBAR ======= -->
229*b2c653efSSorin Basca
230*b2c653efSSorin Basca<HR>
231*b2c653efSSorin BascaCopyright &#169; 2012 <a href="http://pragmatists.pl">Pragmatists</a>. All Rights Reserved.
232*b2c653efSSorin Basca</BODY>
233*b2c653efSSorin Basca</HTML>
234