
FitNesseRoot.files.testResults.RestFixtureTests.LetTests.20160224235240_0_0_0_1.xml Maven / Gradle / Ivy
<?xml version="1.0"?> <testResults> <FitNesseVersion>v20150424</FitNesseVersion> <rootPath>RestFixtureTests.LetTests</rootPath> <result> <counts> <right>0</right> <wrong>0</wrong> <ignores>0</ignores> <exceptions>22</exceptions> </counts> <runTimeInMillis>85</runTimeInMillis> <content><div class="collapsible closed"><ul><li><a href='#' class='expandall'>Expand</a></li><li><a href='#' class='collapseall'>Collapse</a></li></ul> <p class="title">Included page: <a href="RestFixtureTests.SetUp">.RestFixtureTests.SetUp</a> <a href="RestFixtureTests.SetUp?edit&amp;redirectToReferer=true&amp;redirectAction=" class="edit">(edit)</a></p> <div><table> <tr class="slimRowTitle"> <td>script</td> <td colspan="2">http server fixture <span class="error">Could not invoke constructor for HttpServerFixture[0]</span></td> </tr> <tr class="slimRowColor0"> <td>check</td> <td>is started</td> <td>true <span class="error">The instance scriptTableActor.isStarted. does not exist</span></td> </tr> <tr class="slimRowColor9"> <td colspan="3">reset resources database <span class="error">The instance scriptTableActor.resetResourcesDatabase. does not exist</span></td> </tr> </table> </div> </div> <br/>Usages of LET (See also <a href="RestFixtureTests.PostTests">PostTests</a> for more examples) <br/><br/><i>LET used to extract values from header, using regular expressions</i><br/><br/><table> <tr class="slimRowTitle"> <td>Table: Rest Fixture <span class="error">Could not invoke constructor for RestFixture[1]</span></td> <td colspan="4"><a href="http://localhost:9876">http://localhost:9876</a></td> </tr> <tr class="slimRowColor0"> <td>setBody</td> <td colspan="4">&lt;resource&gt;&lt;name&gt;Bill&lt;/name&gt;&lt;data&gt;Some data on Bill&lt;/data&gt;&lt;/resource&gt;</td> </tr> <tr class="slimRowColor1"> <td>POST</td> <td>/resources/</td> <td>201</td> <td></td> <td>no-body</td> </tr> <tr class="slimRowColor0"> <td>let</td> <td>id</td> <td>header</td> <td>Location:/resources/(.+)</td> <td></td> </tr> </table> <br/>The regex is applied to each header. On the first match the first group is extracted and<br/>assigned as value to the label <i>id</i>.<br/><br/>Labels are global and can be shared across rest fixture instances.<br/><br/><i>LET used to extract values from XML body via XPath</i><br/><i>Values are re-usable across instances of RestFixture</i> <br/><br/>Here follows an usage of the previously extracted <i>id</i>.<br/>This example also shows how to use let to extract data from the XML body of a response using XPath.<br/><br/><table> <tr class="slimRowTitle"> <td>Table: Rest Fixture <span class="error">Could not invoke constructor for RestFixture[1]</span></td> <td colspan="4"><a href="http://localhost:9876">http://localhost:9876</a></td> </tr> <tr class="slimRowColor0"> <td>GET</td> <td>/resources/%id%</td> <td>200</td> <td></td> <td> /resource/name[text()='Bill']<br/> /resource/data[text()='Some data on Bill'] </td> </tr> <tr class="slimRowColor1"> <td>let</td> <td>name</td> <td>body</td> <td>/resource/name/text()</td> <td></td> </tr> </table> <br/>...or from a JSON body<br/><br/><table> <tr class="slimRowTitle"> <td>Table: Rest Fixture <span class="error">Could not invoke constructor for RestFixture[1]</span></td> <td colspan="4"><a href="http://localhost:9876">http://localhost:9876</a></td> </tr> <tr class="slimRowColor0"> <td>GET</td> <td>/resources/1.json</td> <td>200</td> <td>Content-Type : application/json</td> <td> jsonbody.resource.name=='a funky name' <br/> jsonbody.resource.data=='an important message' </td> </tr> <tr class="slimRowColor1"> <td>let</td> <td>name</td> <td>body</td> <td>/resource/name/text()</td> <td></td> </tr> </table> <br/><div class="collapsible"><ul><li><a href='#' class='expandall'>Expand</a></li><li><a href='#' class='collapseall'>Collapse</a></li></ul> <p class="title">Note</p> <div>Label values can be accessed from code using <b>new Variables().get("labelname");</b><br/></div> </div> <br/><i>LET resolves names from Fixture Symbol map if not found in the local map</i><br/><br/>LetTestSupport allows to get/set values in the Fixture Symbol map<br/><br/><br/><table> <tr class="slimRowTitle"> <td>script</td> <td>smartrics.rest.test.fitnesse.fixture.LetTestSupport <span class="error">Could not invoke constructor for smartrics.rest.test.fitnesse.fixture.LetTestSupport[0]</span></td> </tr> <tr class="slimRowColor5"> <td>assign <span class="error">The instance scriptTableActor.assign. does not exist</span></td> <td>/resources</td> </tr> <tr class="slimRowColor5"> <td>$resType= <span class="error">The instance scriptTableActor.value. does not exist</span></td> <td>value</td> </tr> </table> <br/><div class="collapsible"><ul><li><a href='#' class='expandall'>Expand</a></li><li><a href='#' class='collapseall'>Collapse</a></li></ul> <p class="title">Note</p> <div>Look at the source code of this page to see that the resource URI<br/>for the GET method below is defined as <b>%resType%/%id%</b><br/></div> </div> <br/><table> <tr class="slimRowTitle"> <td>Table: Rest Fixture <span class="error">Could not invoke constructor for RestFixture[1]</span></td> <td colspan="4"><a href="http://localhost:9876">http://localhost:9876</a></td> </tr> <tr class="slimRowColor0"> <td>GET</td> <td>%resType%/%id%</td> <td>200</td> <td></td> <td></td> </tr> <tr class="slimRowColor1"> <td>let</td> <td>theName</td> <td>body</td> <td>/resource/name/text()</td> <td></td> </tr> </table> <br/><table> <tr class="slimRowTitle"> <td>script</td> <td colspan="2">smartrics.rest.test.fitnesse.fixture.LetTestSupport <span class="error">Could not invoke constructor for smartrics.rest.test.fitnesse.fixture.LetTestSupport[0]</span></td> </tr> <tr class="slimRowColor5"> <td>assign <span class="error">The instance scriptTableActor.assign. does not exist</span></td> <td colspan="2">$theName</td> </tr> <tr class="slimRowColor0"> <td>check</td> <td>value</td> <td>Bill <span class="error">The instance scriptTableActor.value. does not exist</span></td> </tr> </table> <br/>Other fixtures can set a value in the symbol map with <i>Fixture.setSymbol</i>.<br/>The RestFixture<a title="create page" href="RestFixtureTests.RestFixture?edit&amp;nonExistent=true">[?]</a> can then pick them up<br/><br/>This fixture sets <i>symbolName=/resources</i>...<br/><br/><br/><table> <tr class="slimRowTitle"> <td>script</td> <td>smartrics.rest.test.fitnesse.fixture.LetTestSupport <span class="error">Could not invoke constructor for smartrics.rest.test.fitnesse.fixture.LetTestSupport[0]</span></td> </tr> <tr class="slimRowColor5"> <td>assign <span class="error">The instance scriptTableActor.assign. does not exist</span></td> <td>/resources</td> </tr> <tr class="slimRowColor5"> <td>$aNameOfASymbol= <span class="error">The instance scriptTableActor.value. does not exist</span></td> <td>value</td> </tr> </table> <br/>... then the value is used by the RestFixture<br/><table> <tr class="slimRowTitle"> <td>Table: Rest Fixture <span class="error">Could not invoke constructor for RestFixture[1]</span></td> <td colspan="4"><a href="http://localhost:9876">http://localhost:9876</a></td> </tr> <tr class="slimRowColor0"> <td>GET</td> <td>%aNameOfASymbol%/%id%</td> <td>200</td> <td></td> <td></td> </tr> </table> <br/></content> <relativePageName>LetTests</relativePageName> <instructions> <instructionResult> <instruction>{id='scriptTable_0_0', instruction='make', instanceName='scriptTableActor', className='HttpServerFixture', args=[]}</instruction> <slimResult></slimResult> <expectation> <status>error</status> <instructionId>scriptTable_0_0</instructionId> <type>ConstructionExpectation</type> <evaluationMessage>Could not invoke constructor for HttpServerFixture[0]</evaluationMessage> </expectation> </instructionResult> <instructionResult> <instruction>{id='scriptTable_0_1', instruction='call', instanceName='scriptTableActor', methodName='isStarted', args=[]}</instruction> <slimResult></slimResult> <expectation> <status>error</status> <instructionId>scriptTable_0_1</instructionId> <type>ReturnedValueExpectation</type> <evaluationMessage>The instance scriptTableActor.isStarted. does not exist</evaluationMessage> </expectation> </instructionResult> <instructionResult> <instruction>{id='scriptTable_0_2', instruction='call', instanceName='scriptTableActor', methodName='resetResourcesDatabase', args=[]}</instruction> <slimResult></slimResult> <expectation> <status>error</status> <instructionId>scriptTable_0_2</instructionId> <type>ScriptActionExpectation</type> <evaluationMessage>The instance scriptTableActor.resetResourcesDatabase. does not exist</evaluationMessage> </expectation> </instructionResult> <instructionResult> <instruction>{id='tableTable_1_0', instruction='make', instanceName='tableTable_1', className='RestFixture', args=[<a href="http://localhost:9876">http://localhost:9876</a>]}</instruction> <slimResult></slimResult> <expectation> <status>error</status> <instructionId>tableTable_1_0</instructionId> <type>ConstructionExpectation</type> <evaluationMessage>Could not invoke constructor for RestFixture[1]</evaluationMessage> </expectation> </instructionResult> <instructionResult> <instruction>{id='tableTable_1_1', instruction='call', instanceName='tableTable_1', methodName='doTable', args=[[[setBody, <resource><name>Bill</name><data>Some data on Bill</data></resource>], [POST, /resources/, 201, , no-body], [let, id, header, Location:/resources/(.+), ]]]}</instruction> <slimResult></slimResult> <expectation> <status>error</status> <instructionId>tableTable_1_1</instructionId> <type>TableTableExpectation</type> <evaluationMessage>The instance tableTable_1.doTable. does not exist</evaluationMessage> </expectation> </instructionResult> <instructionResult> <instruction>{id='tableTable_2_0', instruction='make', instanceName='tableTable_2', className='RestFixture', args=[<a href="http://localhost:9876">http://localhost:9876</a>]}</instruction> <slimResult></slimResult> <expectation> <status>error</status> <instructionId>tableTable_2_0</instructionId> <type>ConstructionExpectation</type> <evaluationMessage>Could not invoke constructor for RestFixture[1]</evaluationMessage> </expectation> </instructionResult> <instructionResult> <instruction>{id='tableTable_2_1', instruction='call', instanceName='tableTable_2', methodName='doTable', args=[[[GET, /resources/%id%, 200, , /resource/name[text()='Bill']<br/> /resource/data[text()='Some data on Bill'] ], [let, name, body, /resource/name/text(), ]]]}</instruction> <slimResult></slimResult> <expectation> <status>error</status> <instructionId>tableTable_2_1</instructionId> <type>TableTableExpectation</type> <evaluationMessage>The instance tableTable_2.doTable. does not exist</evaluationMessage> </expectation> </instructionResult> <instructionResult> <instruction>{id='tableTable_3_0', instruction='make', instanceName='tableTable_3', className='RestFixture', args=[<a href="http://localhost:9876">http://localhost:9876</a>]}</instruction> <slimResult></slimResult> <expectation> <status>error</status> <instructionId>tableTable_3_0</instructionId> <type>ConstructionExpectation</type> <evaluationMessage>Could not invoke constructor for RestFixture[1]</evaluationMessage> </expectation> </instructionResult> <instructionResult> <instruction>{id='tableTable_3_1', instruction='call', instanceName='tableTable_3', methodName='doTable', args=[[[GET, /resources/1.json, 200, Content-Type : application/json, jsonbody.resource.name=='a funky name' <br/> jsonbody.resource.data=='an important message' ], [let, name, body, /resource/name/text(), ]]]}</instruction> <slimResult></slimResult> <expectation> <status>error</status> <instructionId>tableTable_3_1</instructionId> <type>TableTableExpectation</type> <evaluationMessage>The instance tableTable_3.doTable. does not exist</evaluationMessage> </expectation> </instructionResult> <instructionResult> <instruction>{id='scriptTable_4_0', instruction='make', instanceName='scriptTableActor', className='smartrics.rest.test.fitnesse.fixture.LetTestSupport', args=[]}</instruction> <slimResult></slimResult> <expectation> <status>error</status> <instructionId>scriptTable_4_0</instructionId> <type>ConstructionExpectation</type> <evaluationMessage>Could not invoke constructor for smartrics.rest.test.fitnesse.fixture.LetTestSupport[0]</evaluationMessage> </expectation> </instructionResult> <instructionResult> <instruction>{id='scriptTable_4_1', instruction='call', instanceName='scriptTableActor', methodName='assign', args=[/resources]}</instruction> <slimResult></slimResult> <expectation> <status>error</status> <instructionId>scriptTable_4_1</instructionId> <type>ScriptActionExpectation</type> <evaluationMessage>The instance scriptTableActor.assign. does not exist</evaluationMessage> </expectation> </instructionResult> <instructionResult> <instruction>{id='scriptTable_4_2', instruction='callAndAssign', symbolName='resType', instanceName='scriptTableActor', methodName='value', args=[]}</instruction> <slimResult></slimResult> <expectation> <status>error</status> <instructionId>scriptTable_4_2</instructionId> <type>SymbolAssignmentExpectation</type> <evaluationMessage>The instance scriptTableActor.value. does not exist</evaluationMessage> </expectation> </instructionResult> <instructionResult> <instruction>{id='tableTable_5_0', instruction='make', instanceName='tableTable_5', className='RestFixture', args=[<a href="http://localhost:9876">http://localhost:9876</a>]}</instruction> <slimResult></slimResult> <expectation> <status>error</status> <instructionId>tableTable_5_0</instructionId> <type>ConstructionExpectation</type> <evaluationMessage>Could not invoke constructor for RestFixture[1]</evaluationMessage> </expectation> </instructionResult> <instructionResult> <instruction>{id='tableTable_5_1', instruction='call', instanceName='tableTable_5', methodName='doTable', args=[[[GET, %resType%/%id%, 200, , ], [let, theName, body, /resource/name/text(), ]]]}</instruction> <slimResult></slimResult> <expectation> <status>error</status> <instructionId>tableTable_5_1</instructionId> <type>TableTableExpectation</type> <evaluationMessage>The instance tableTable_5.doTable. does not exist</evaluationMessage> </expectation> </instructionResult> <instructionResult> <instruction>{id='scriptTable_6_0', instruction='make', instanceName='scriptTableActor', className='smartrics.rest.test.fitnesse.fixture.LetTestSupport', args=[]}</instruction> <slimResult></slimResult> <expectation> <status>error</status> <instructionId>scriptTable_6_0</instructionId> <type>ConstructionExpectation</type> <evaluationMessage>Could not invoke constructor for smartrics.rest.test.fitnesse.fixture.LetTestSupport[0]</evaluationMessage> </expectation> </instructionResult> <instructionResult> <instruction>{id='scriptTable_6_1', instruction='call', instanceName='scriptTableActor', methodName='assign', args=[$theName]}</instruction> <slimResult></slimResult> <expectation> <status>error</status> <instructionId>scriptTable_6_1</instructionId> <type>ScriptActionExpectation</type> <evaluationMessage>The instance scriptTableActor.assign. does not exist</evaluationMessage> </expectation> </instructionResult> <instructionResult> <instruction>{id='scriptTable_6_2', instruction='call', instanceName='scriptTableActor', methodName='value', args=[]}</instruction> <slimResult></slimResult> <expectation> <status>error</status> <instructionId>scriptTable_6_2</instructionId> <type>ReturnedValueExpectation</type> <evaluationMessage>The instance scriptTableActor.value. does not exist</evaluationMessage> </expectation> </instructionResult> <instructionResult> <instruction>{id='scriptTable_7_0', instruction='make', instanceName='scriptTableActor', className='smartrics.rest.test.fitnesse.fixture.LetTestSupport', args=[]}</instruction> <slimResult></slimResult> <expectation> <status>error</status> <instructionId>scriptTable_7_0</instructionId> <type>ConstructionExpectation</type> <evaluationMessage>Could not invoke constructor for smartrics.rest.test.fitnesse.fixture.LetTestSupport[0]</evaluationMessage> </expectation> </instructionResult> <instructionResult> <instruction>{id='scriptTable_7_1', instruction='call', instanceName='scriptTableActor', methodName='assign', args=[/resources]}</instruction> <slimResult></slimResult> <expectation> <status>error</status> <instructionId>scriptTable_7_1</instructionId> <type>ScriptActionExpectation</type> <evaluationMessage>The instance scriptTableActor.assign. does not exist</evaluationMessage> </expectation> </instructionResult> <instructionResult> <instruction>{id='scriptTable_7_2', instruction='callAndAssign', symbolName='aNameOfASymbol', instanceName='scriptTableActor', methodName='value', args=[]}</instruction> <slimResult></slimResult> <expectation> <status>error</status> <instructionId>scriptTable_7_2</instructionId> <type>SymbolAssignmentExpectation</type> <evaluationMessage>The instance scriptTableActor.value. does not exist</evaluationMessage> </expectation> </instructionResult> <instructionResult> <instruction>{id='tableTable_8_0', instruction='make', instanceName='tableTable_8', className='RestFixture', args=[<a href="http://localhost:9876">http://localhost:9876</a>]}</instruction> <slimResult></slimResult> <expectation> <status>error</status> <instructionId>tableTable_8_0</instructionId> <type>ConstructionExpectation</type> <evaluationMessage>Could not invoke constructor for RestFixture[1]</evaluationMessage> </expectation> </instructionResult> <instructionResult> <instruction>{id='tableTable_8_1', instruction='call', instanceName='tableTable_8', methodName='doTable', args=[[[GET, %aNameOfASymbol%/%id%, 200, , ]]]}</instruction> <slimResult></slimResult> <expectation> <status>error</status> <instructionId>tableTable_8_1</instructionId> <type>TableTableExpectation</type> <evaluationMessage>The instance tableTable_8.doTable. does not exist</evaluationMessage> </expectation> </instructionResult> </instructions> </result> <finalCounts> <right>0</right> <wrong>0</wrong> <ignores>0</ignores> <exceptions>1</exceptions> </finalCounts> <totalRunTimeInMillis>85</totalRunTimeInMillis> </testResults>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy