简体   繁体   中英

Pass values from fitnesse test data table to dbfit query

I want to get sql query which is to be passed in dbfit dynamically. I used columnfixture for this. I can set the query from my java fixture as variable in my fit test table but when I tried passing the same variable to dbfit it just consider that as a string than a variable. Below is my code.

!path lib/*.jar
!|dbfit.MySqlTest|

|set option|bind symbols|true|



!|fixture.GetSQLPojo|
|url|=getSQLQuery()|
|giturl| query | <--- this gives the value returned from custom fixture


!|Connect|jdbc connection|

!|Query|<<query| <--- here when i tried using the variable it wasn't working
|a|b|c|d|
|14|x|null|y|

so can anyone tell me how to pass variable from test data table to dbfit. I am a newbie to fitnesse and db fit pardon me if it a silly question or something. Was breaking my head for almost one day with this. Thanks in advance.

Update----

I have used symbolutil.setsymbols to save my SQL and when I can get the SQL by doing like this <

该符号应以前缀为: not <<

!|Query|:query|

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM