Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
FitNesseRoot.files.testResults.RestFixtureTests.IssueFixes.Issue174.20160517141814_1_0_0_0.xml Maven / Gradle / Ivy
<?xml version="1.0"?>
<testResults>
<FitNesseVersion>v20151230</FitNesseVersion>
<rootPath>RestFixtureTests.IssueFixes.Issue174</rootPath>
<result>
<counts>
<right>7</right>
<wrong>0</wrong>
<ignores>0</ignores>
<exceptions>0</exceptions>
</counts>
<date>2016-05-17T14:18:14+01:00</date>
<runTimeInMillis>71</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"><span class="pass">smartrics.rest.test.fitnesse.fixture.HttpServerFixture</span></td>
</tr>
<tr class="slimRowColor0">
<td>check</td>
<td>is started</td>
<td><span class="pass">true</span></td>
</tr>
<tr class="slimRowColor9">
<td colspan="3"><span class="pass">reset resources database</span></td>
</tr>
</table>
</div>
</div>
<br/><h3><a href="https://github.com/smartrics/RestFixture/issues/174">Issue #174</a> Using multiple fixtures together</h3>
<br/>The issue reports that symbols can't be shared across fixtures when <a href="RestFixture">.RestFixture</a> is used.<br/><br/>This fixture is a decision table simply used to define four different values in the slim shared map of symbols.<br/>The fixture class allows setting a value and then getting it back:<br/><pre>
public class DecisionFixtureTest {
private String value;
public void setValue(String value) {
this.value = value;
}
public String value() {
return value;
}
}
</pre>
<br/><br/>In this case we define two symbols for URIs (one success and one fail) and two symbols for return code.<br/><br/><table>
<tr>
<td colspan="2"><span class="pass">decision fixture test</span></td>
</tr>
<tr>
<td>value</td>
<td>value?</td>
</tr>
<tr>
<td>/resources/0</td>
<td>$foundResourceUri&lt;-[/resources/0]</td>
</tr>
<tr>
<td>200</td>
<td>$successCode&lt;-[200]</td>
</tr>
<tr>
<td>/resources/99</td>
<td>$notFoundResourceUri&lt;-[/resources/99]</td>
</tr>
<tr>
<td>404</td>
<td>$notFoundCode&lt;-[404]</td>
</tr>
</table>
<br/><br/>Symbols defined in the above table are then used in rest fixture. This demonstrates that <a href="RestFixture">.RestFixture</a> accepts symbols and can resolve them.<br/><br/><table>
<tr class="slimRowTitle">
<td><span class="pass">Table: Rest Fixture</span></td>
<td><a href="http://localhost:9876">http://localhost:9876</a></td>
<td colspan="3"></td>
</tr>
<tr class="slimRowColor0">
<td>GET</td>
<td><div><a href='http://localhost:9876/resources/0'>/resources/0</a></div></td>
<td><span class="pass"><div>200</div></span></td>
<td><div>Set-Cookie&nbsp;:&nbsp;JID="ABC.${a.y}";<br/>Content-Type&nbsp;:&nbsp;application/xml;charset=ISO-8859-1<br/>Content-Length&nbsp;:&nbsp;183<br/>Server&nbsp;:&nbsp;Jetty(6.0.2)</div></td>
<td><div>&lt;resource&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;name&gt;a&nbsp;funky&nbsp;name&lt;/name&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;data&gt;an&nbsp;important&nbsp;message&lt;/data&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;nstag&nbsp;xmlns:ns1='http://smartrics/ns1'&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ns1:number&gt;3&lt;/ns1:number&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/nstag&gt;<br/>&lt;/resource&gt;</div></td>
</tr>
<tr class="slimRowColor1">
<td>let</td>
<td>ok_status_code</td>
<td>js</td>
<td><div>response.statusCode</div></td>
<td><div>200</div></td>
</tr>
<tr class="slimRowColor0">
<td>GET</td>
<td><div><a href='http://localhost:9876/resources/99'>/resources/99</a></div></td>
<td><span class="pass"><div>404</div></span></td>
<td><div>Set-Cookie&nbsp;:&nbsp;JID="ABC.${a.y}";<br/>Content-Length&nbsp;:&nbsp;0<br/>Server&nbsp;:&nbsp;Jetty(6.0.2)</div></td>
<td><div>no-body</div></td>
</tr>
<tr class="slimRowColor1">
<td>let</td>
<td>not_found_status_code</td>
<td>js</td>
<td><div>response.statusCode</div></td>
<td><div>404</div></td>
</tr>
</table>
<br/>The fixture above then defines - via "let" command - two more symbols: "ok_status_code" and "not_found_status_code". The two symbols are re-used in a new instaance of the decision fixture test below<br/><br/><table>
<tr>
<td colspan="2"><span class="pass">decision fixture test</span></td>
</tr>
<tr>
<td>value</td>
<td>value?</td>
</tr>
<tr>
<td>$ok_status_code</td>
<td><span class="pass">200</span></td>
</tr>
<tr>
<td>$not_found_status_code</td>
<td><span class="pass">404</span></td>
</tr>
</table>
<br/></content>
<relativePageName>Issue174</relativePageName>
<instructions>
<instructionResult>
<instruction>{id='scriptTable_0_0', instruction='make', instanceName='scriptTableActor', className='smartrics.rest.test.fitnesse.fixture.HttpServerFixture', args=[]}</instruction>
<slimResult>pass(smartrics.rest.test.fitnesse.fixture.HttpServerFixture)</slimResult>
<expectation>
<status>pass</status>
<instructionId>scriptTable_0_0</instructionId>
<col>1</col>
<row>0</row>
<type>ConstructionExpectation</type>
<evaluationMessage>smartrics.rest.test.fitnesse.fixture.HttpServerFixture</evaluationMessage>
</expectation>
</instructionResult>
<instructionResult>
<instruction>{id='scriptTable_0_1', instruction='call', instanceName='scriptTableActor', methodName='isStarted', args=[]}</instruction>
<slimResult>pass(true)</slimResult>
<expectation>
<status>pass</status>
<instructionId>scriptTable_0_1</instructionId>
<col>2</col>
<row>1</row>
<type>ReturnedValueExpectation</type>
<evaluationMessage>true</evaluationMessage>
</expectation>
</instructionResult>
<instructionResult>
<instruction>{id='scriptTable_0_2', instruction='call', instanceName='scriptTableActor', methodName='resetResourcesDatabase', args=[]}</instruction>
<slimResult>pass()</slimResult>
<expectation>
<status>pass</status>
<instructionId>scriptTable_0_2</instructionId>
<col>0</col>
<row>2</row>
<type>ScriptActionExpectation</type>
</expectation>
</instructionResult>
<instructionResult>
<instruction>{id='decisionTable_1_0', instruction='make', instanceName='decisionTable_1', className='DecisionFixtureTest', args=[]}</instruction>
<slimResult>pass(decision fixture test)</slimResult>
<expectation>
<status>pass</status>
<instructionId>decisionTable_1_0</instructionId>
<col>0</col>
<row>0</row>
<type>ConstructionExpectation</type>
<evaluationMessage>decision fixture test</evaluationMessage>
</expectation>
</instructionResult>
<instructionResult>
<instruction>{id='decisionTable_1_4', instruction='call', instanceName='decisionTable_1', methodName='setValue', args=[/resources/0]}</instruction>
<slimResult></slimResult>
<expectation>
<instructionId>decisionTable_1_4</instructionId>
<col>0</col>
<row>2</row>
<type>VoidReturnExpectation</type>
</expectation>
</instructionResult>
<instructionResult>
<instruction>{id='decisionTable_1_6', instruction='callAndAssign', symbolName='foundResourceUri', instanceName='decisionTable_1', methodName='value', args=[]}</instruction>
<slimResult>$foundResourceUri<-[/resources/0]</slimResult>
<expectation>
<instructionId>decisionTable_1_6</instructionId>
<col>1</col>
<row>2</row>
<type>SymbolAssignmentExpectation</type>
<evaluationMessage>$foundResourceUri<-[/resources/0]</evaluationMessage>
</expectation>
</instructionResult>
<instructionResult>
<instruction>{id='decisionTable_1_8', instruction='call', instanceName='decisionTable_1', methodName='setValue', args=[200]}</instruction>
<slimResult></slimResult>
<expectation>
<instructionId>decisionTable_1_8</instructionId>
<col>0</col>
<row>3</row>
<type>VoidReturnExpectation</type>
</expectation>
</instructionResult>
<instructionResult>
<instruction>{id='decisionTable_1_10', instruction='callAndAssign', symbolName='successCode', instanceName='decisionTable_1', methodName='value', args=[]}</instruction>
<slimResult>$successCode<-[200]</slimResult>
<expectation>
<instructionId>decisionTable_1_10</instructionId>
<col>1</col>
<row>3</row>
<type>SymbolAssignmentExpectation</type>
<evaluationMessage>$successCode<-[200]</evaluationMessage>
</expectation>
</instructionResult>
<instructionResult>
<instruction>{id='decisionTable_1_12', instruction='call', instanceName='decisionTable_1', methodName='setValue', args=[/resources/99]}</instruction>
<slimResult></slimResult>
<expectation>
<instructionId>decisionTable_1_12</instructionId>
<col>0</col>
<row>4</row>
<type>VoidReturnExpectation</type>
</expectation>
</instructionResult>
<instructionResult>
<instruction>{id='decisionTable_1_14', instruction='callAndAssign', symbolName='notFoundResourceUri', instanceName='decisionTable_1', methodName='value', args=[]}</instruction>
<slimResult>$notFoundResourceUri<-[/resources/99]</slimResult>
<expectation>
<instructionId>decisionTable_1_14</instructionId>
<col>1</col>
<row>4</row>
<type>SymbolAssignmentExpectation</type>
<evaluationMessage>$notFoundResourceUri<-[/resources/99]</evaluationMessage>
</expectation>
</instructionResult>
<instructionResult>
<instruction>{id='decisionTable_1_16', instruction='call', instanceName='decisionTable_1', methodName='setValue', args=[404]}</instruction>
<slimResult></slimResult>
<expectation>
<instructionId>decisionTable_1_16</instructionId>
<col>0</col>
<row>5</row>
<type>VoidReturnExpectation</type>
</expectation>
</instructionResult>
<instructionResult>
<instruction>{id='decisionTable_1_18', instruction='callAndAssign', symbolName='notFoundCode', instanceName='decisionTable_1', methodName='value', args=[]}</instruction>
<slimResult>$notFoundCode<-[404]</slimResult>
<expectation>
<instructionId>decisionTable_1_18</instructionId>
<col>1</col>
<row>5</row>
<type>SymbolAssignmentExpectation</type>
<evaluationMessage>$notFoundCode<-[404]</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>pass(Table: Rest Fixture)</slimResult>
<expectation>
<status>pass</status>
<instructionId>tableTable_2_0</instructionId>
<col>0</col>
<row>0</row>
<type>ConstructionExpectation</type>
<evaluationMessage>Table: Rest Fixture</evaluationMessage>
</expectation>
</instructionResult>
<instructionResult>
<instruction>{id='tableTable_2_1', instruction='call', instanceName='tableTable_2', methodName='doTable', args=[[[GET, $foundResourceUri, $successCode, , ], [let, ok_status_code, js, response.statusCode, ], [GET, $notFoundResourceUri, $notFoundCode, , ], [let, not_found_status_code, js, response.statusCode, ]]]}</instruction>
<slimResult>pass()</slimResult>
<expectation>
<status>pass</status>
<instructionId>tableTable_2_1</instructionId>
<type>TableTableExpectation</type>
</expectation>
</instructionResult>
<instructionResult>
<instruction>{id='decisionTable_3_0', instruction='make', instanceName='decisionTable_3', className='DecisionFixtureTest', args=[]}</instruction>
<slimResult>pass(decision fixture test)</slimResult>
<expectation>
<status>pass</status>
<instructionId>decisionTable_3_0</instructionId>
<col>0</col>
<row>0</row>
<type>ConstructionExpectation</type>
<evaluationMessage>decision fixture test</evaluationMessage>
</expectation>
</instructionResult>
<instructionResult>
<instruction>{id='decisionTable_3_4', instruction='call', instanceName='decisionTable_3', methodName='setValue', args=[$ok_status_code]}</instruction>
<slimResult></slimResult>
<expectation>
<instructionId>decisionTable_3_4</instructionId>
<col>0</col>
<row>2</row>
<type>VoidReturnExpectation</type>
</expectation>
</instructionResult>
<instructionResult>
<instruction>{id='decisionTable_3_6', instruction='call', instanceName='decisionTable_3', methodName='value', args=[]}</instruction>
<slimResult>pass(200)</slimResult>
<expectation>
<status>pass</status>
<instructionId>decisionTable_3_6</instructionId>
<col>1</col>
<row>2</row>
<type>ReturnedValueExpectation</type>
<evaluationMessage>200</evaluationMessage>
</expectation>
</instructionResult>
<instructionResult>
<instruction>{id='decisionTable_3_8', instruction='call', instanceName='decisionTable_3', methodName='setValue', args=[$not_found_status_code]}</instruction>
<slimResult></slimResult>
<expectation>
<instructionId>decisionTable_3_8</instructionId>
<col>0</col>
<row>3</row>
<type>VoidReturnExpectation</type>
</expectation>
</instructionResult>
<instructionResult>
<instruction>{id='decisionTable_3_10', instruction='call', instanceName='decisionTable_3', methodName='value', args=[]}</instruction>
<slimResult>pass(404)</slimResult>
<expectation>
<status>pass</status>
<instructionId>decisionTable_3_10</instructionId>
<col>1</col>
<row>3</row>
<type>ReturnedValueExpectation</type>
<evaluationMessage>404</evaluationMessage>
</expectation>
</instructionResult>
</instructions>
</result>
<finalCounts>
<right>1</right>
<wrong>0</wrong>
<ignores>0</ignores>
<exceptions>0</exceptions>
</finalCounts>
<totalRunTimeInMillis>71</totalRunTimeInMillis>
</testResults>