All Downloads are FREE. Search and download functionalities are using the official Maven repository.

FitNesseRoot.files.testResults.RestFixtureTests.LetTestsV2.20160309222010_1_0_0_0.xml Maven / Gradle / Ivy

<?xml version="1.0"?>
<testResults>
  <FitNesseVersion>v20150424</FitNesseVersion>
  <rootPath>RestFixtureTests.LetTestsV2</rootPath>
    <result>
    <counts>
      <right>20</right>
      <wrong>0</wrong>
      <ignores>0</ignores>
      <exceptions>0</exceptions>
    </counts>
   <runTimeInMillis>114</runTimeInMillis>
    <content>&lt;div class="collapsible closed"&gt;&lt;ul&gt;&lt;li&gt;&lt;a href='#' class='expandall'&gt;Expand&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href='#' class='collapseall'&gt;Collapse&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
	&lt;p class="title"&gt;Included page: &lt;a href="RestFixtureTests.SetUp"&gt;.RestFixtureTests.SetUp&lt;/a&gt; &lt;a href="RestFixtureTests.SetUp?edit&amp;amp;redirectToReferer=true&amp;amp;redirectAction=" class="edit"&gt;(edit)&lt;/a&gt;&lt;/p&gt;
	&lt;div&gt;&lt;table&gt;
	&lt;tr class="slimRowTitle"&gt;
		&lt;td&gt;script&lt;/td&gt;
		&lt;td colspan="2"&gt;&lt;span class="pass"&gt;smartrics.rest.test.fitnesse.fixture.HttpServerFixture&lt;/span&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor0"&gt;
		&lt;td&gt;check&lt;/td&gt;
		&lt;td&gt;is started&lt;/td&gt;
		&lt;td&gt;&lt;span class="pass"&gt;true&lt;/span&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor9"&gt;
		&lt;td colspan="3"&gt;&lt;span class="pass"&gt;reset resources database&lt;/span&gt;&lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br/&gt;LET can use now the full power of JavaScript to extract data from the last response parts. The additions&lt;br/&gt;to support the new JavaScript extensions will not break the existing RestFixture API.&lt;br/&gt;&lt;br/&gt;The JavaScript extensions can be used to process more effectively JSON &lt;i&gt;Content-Type&lt;/i&gt;s.&lt;br/&gt;&lt;br/&gt;&lt;i&gt;LET can access the Fitnesse Symbols map to extract data previously stored&lt;/i&gt;&lt;br/&gt;&lt;br/&gt;If the context of the let context is &lt;i&gt;js&lt;/i&gt; the expression is evaluated as a javascript string. The value assigned&lt;br/&gt;to the let label is the result of the evaluation of the content in the expression cell.&lt;br/&gt;&lt;br/&gt;For example:&lt;br/&gt;&lt;br/&gt;&lt;table&gt;
	&lt;tr class="slimRowTitle"&gt;
		&lt;td&gt;&lt;span class="pass"&gt;Table: Rest Fixture&lt;/span&gt;&lt;/td&gt;
		&lt;td colspan="4"&gt;&lt;a href="http://localhost:9876"&gt;http://localhost:9876&lt;/a&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor0"&gt;
		&lt;td&gt;let&lt;/td&gt;
		&lt;td&gt;message&lt;/td&gt;
		&lt;td&gt;js&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;'Hello,&amp;nbsp;World!'&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;span class="pass"&gt;&lt;div&gt;Hello,&amp;nbsp;World!&lt;/div&gt;&lt;/span&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor1"&gt;
		&lt;td&gt;let&lt;/td&gt;
		&lt;td&gt;sum&lt;/td&gt;
		&lt;td&gt;js&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;'2&amp;nbsp;+&amp;nbsp;5&amp;nbsp;=&amp;nbsp;'&amp;nbsp;+&amp;nbsp;(2&amp;nbsp;+&amp;nbsp;5)&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;span class="pass"&gt;&lt;div&gt;2&amp;nbsp;+&amp;nbsp;5&amp;nbsp;=&amp;nbsp;7&lt;/div&gt;&lt;/span&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor0"&gt;
		&lt;td&gt;let&lt;/td&gt;
		&lt;td&gt;two_expressions&lt;/td&gt;
		&lt;td&gt;js&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;a=1;&lt;br/&gt;'a&amp;nbsp;is&amp;nbsp;'&amp;nbsp;+&amp;nbsp;a&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;span class="pass"&gt;&lt;div&gt;a&amp;nbsp;is&amp;nbsp;1&lt;/div&gt;&lt;/span&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor1"&gt;
		&lt;td&gt;let&lt;/td&gt;
		&lt;td&gt;json_expr&lt;/td&gt;
		&lt;td&gt;js&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;&lt;br/&gt;json&amp;nbsp;=&amp;nbsp;{&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"widget":&amp;nbsp;{&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"debug":&amp;nbsp;"on",&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"window":&amp;nbsp;{&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"title":&amp;nbsp;"Sample&amp;nbsp;Konfabulator&amp;nbsp;Widget",&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"name":&amp;nbsp;"main_window",&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"width":&amp;nbsp;500,&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"height":&amp;nbsp;500&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;},&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"image":&amp;nbsp;{&amp;nbsp;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"src":&amp;nbsp;"Images/Sun.png",&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"name":&amp;nbsp;"sun1",&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"hOffset":&amp;nbsp;250,&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"vOffset":&amp;nbsp;250,&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"alignment":&amp;nbsp;"center"&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;},&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"text":&amp;nbsp;{&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"data":&amp;nbsp;"Click&amp;nbsp;Here",&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"size":&amp;nbsp;36,&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"style":&amp;nbsp;"bold",&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"name":&amp;nbsp;"text1",&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"hOffset":&amp;nbsp;250,&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"vOffset":&amp;nbsp;100,&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"alignment":&amp;nbsp;"center",&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"onMouseUp":&amp;nbsp;"sun1.opacity&amp;nbsp;=&amp;nbsp;(sun1.opacity&amp;nbsp;/&amp;nbsp;100)&amp;nbsp;*&amp;nbsp;90;"&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br/&gt;};&lt;br/&gt;json.widget.image.src&lt;br/&gt;&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;span class="pass"&gt;&lt;div&gt;Images/Sun.png&lt;/div&gt;&lt;/span&gt;&lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;br/&gt;(Example courtesy of &lt;a href="http://json.org/example.html)"&gt;http://json.org/example.html)&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;It's also possible to access the FitNesse symbols map. The scope where expression is evaluated contains the &lt;br/&gt;'symbols' object &lt;br/&gt;&lt;br/&gt;&lt;table&gt;
	&lt;tr class="slimRowTitle"&gt;
		&lt;td&gt;&lt;span class="pass"&gt;Table: Rest Fixture&lt;/span&gt;&lt;/td&gt;
		&lt;td colspan="4"&gt;&lt;a href="http://localhost:9876"&gt;http://localhost:9876&lt;/a&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor0"&gt;
		&lt;td&gt;setBody&lt;/td&gt;
		&lt;td colspan="4"&gt;&amp;lt;resource&amp;gt;&amp;lt;name&amp;gt;Bill&amp;lt;/name&amp;gt;&amp;lt;data&amp;gt;Some data on Bill&amp;lt;/data&amp;gt;&amp;lt;/resource&amp;gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor1"&gt;
		&lt;td&gt;POST&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;&lt;a href='http://localhost:9876/resources/'&gt;/resources/&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;span class="pass"&gt;&lt;div&gt;201&lt;/div&gt;&lt;/span&gt;&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;Location&amp;nbsp;:&amp;nbsp;/resources/2&lt;br/&gt;Content-Length&amp;nbsp;:&amp;nbsp;0&lt;br/&gt;Server&amp;nbsp;:&amp;nbsp;Jetty(6.0.2)&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;span class="pass"&gt;&lt;div&gt;no-body&lt;/div&gt;&lt;/span&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor0"&gt;
		&lt;td&gt;let&lt;/td&gt;
		&lt;td&gt;id&lt;/td&gt;
		&lt;td&gt;header&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;Location:/resources/(.+)&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;2&lt;/div&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor1"&gt;
		&lt;td&gt;let&lt;/td&gt;
		&lt;td&gt;id_string&lt;/td&gt;
		&lt;td&gt;js&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;'The&amp;nbsp;id&amp;nbsp;is:&amp;nbsp;'&amp;nbsp;+&amp;nbsp;symbols.get('id')&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;span class="pass"&gt;&lt;div&gt;The&amp;nbsp;id&amp;nbsp;is:&amp;nbsp;2&lt;/div&gt;&lt;/span&gt;&lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;br/&gt;&lt;br/&gt;The scope also contains the 'response' object, populated with the data from the last Rest response executed&lt;br/&gt;&lt;br/&gt;For example&lt;br/&gt;&lt;br/&gt;&lt;table&gt;
	&lt;tr class="slimRowTitle"&gt;
		&lt;td&gt;&lt;span class="pass"&gt;Table: Rest Fixture&lt;/span&gt;&lt;/td&gt;
		&lt;td colspan="4"&gt;&lt;a href="http://localhost:9876"&gt;http://localhost:9876&lt;/a&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor0"&gt;
		&lt;td&gt;GET&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;&lt;a href='http://localhost:9876/resources/1'&gt;/resources/1&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;span class="pass"&gt;&lt;div&gt;200&lt;/div&gt;&lt;/span&gt;&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;Set-Cookie&amp;nbsp;:&amp;nbsp;JID="ABC.${a.y}";&lt;br/&gt;Content-Type&amp;nbsp;:&amp;nbsp;application/xml;charset=ISO-8859-1&lt;br/&gt;Content-Length&amp;nbsp;:&amp;nbsp;77&lt;br/&gt;Server&amp;nbsp;:&amp;nbsp;Jetty(6.0.2)&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;{&amp;nbsp;"resource"&amp;nbsp;:&amp;nbsp;{&amp;nbsp;"name"&amp;nbsp;:&amp;nbsp;"a&amp;nbsp;funky&amp;nbsp;name",&amp;nbsp;"data"&amp;nbsp;:&amp;nbsp;"an&amp;nbsp;important&amp;nbsp;message"&amp;nbsp;}&amp;nbsp;}&lt;/div&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor1"&gt;
		&lt;td&gt;let&lt;/td&gt;
		&lt;td&gt;body_value&lt;/td&gt;
		&lt;td&gt;js&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;response.body&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;{&amp;nbsp;"resource"&amp;nbsp;:&amp;nbsp;{&amp;nbsp;"name"&amp;nbsp;:&amp;nbsp;"a&amp;nbsp;funky&amp;nbsp;name",&amp;nbsp;"data"&amp;nbsp;:&amp;nbsp;"an&amp;nbsp;important&amp;nbsp;message"&amp;nbsp;}&amp;nbsp;}&lt;/div&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor0"&gt;
		&lt;td&gt;setBody&lt;/td&gt;
		&lt;td colspan="4"&gt;&amp;lt;resource&amp;gt;&amp;lt;name&amp;gt;Bill&amp;lt;/name&amp;gt;&amp;lt;data&amp;gt;Some data on Bill&amp;lt;/data&amp;gt;&amp;lt;/resource&amp;gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor1"&gt;
		&lt;td&gt;POST&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;&lt;a href='http://localhost:9876/resources/'&gt;/resources/&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;span class="pass"&gt;&lt;div&gt;201&lt;/div&gt;&lt;/span&gt;&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;Location&amp;nbsp;:&amp;nbsp;/resources/3&lt;br/&gt;Content-Length&amp;nbsp;:&amp;nbsp;0&lt;br/&gt;Server&amp;nbsp;:&amp;nbsp;Jetty(6.0.2)&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;span class="pass"&gt;&lt;div&gt;no-body&lt;/div&gt;&lt;/span&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor0"&gt;
		&lt;td&gt;let&lt;/td&gt;
		&lt;td&gt;status_code_value&lt;/td&gt;
		&lt;td&gt;js&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;response.statusCode&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;201&lt;/div&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor1"&gt;
		&lt;td&gt;let&lt;/td&gt;
		&lt;td&gt;status_text_value&lt;/td&gt;
		&lt;td&gt;js&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;response.statusText&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;Created&lt;/div&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor0"&gt;
		&lt;td&gt;let&lt;/td&gt;
		&lt;td&gt;c_len&lt;/td&gt;
		&lt;td&gt;js&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;response.header0('Content-Length')&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;span class="pass"&gt;&lt;div&gt;0&lt;/div&gt;&lt;/span&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor1"&gt;
		&lt;td&gt;let&lt;/td&gt;
		&lt;td&gt;loc_again&lt;/td&gt;
		&lt;td&gt;js&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;response.header('Location',&amp;nbsp;0)&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;/resources/3&lt;/div&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor0"&gt;
		&lt;td&gt;let&lt;/td&gt;
		&lt;td&gt;h_size&lt;/td&gt;
		&lt;td&gt;js&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;response.headerListSize('Location')&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;span class="pass"&gt;&lt;div&gt;1&lt;/div&gt;&lt;/span&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor1"&gt;
		&lt;td&gt;let&lt;/td&gt;
		&lt;td&gt;all_h_size&lt;/td&gt;
		&lt;td&gt;js&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;response.headersSize()&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;3&lt;/div&gt;&lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;br/&gt;A particoular case is when the response is JSON (Content-Type : application/json). In such case, the property &lt;b&gt;jsonbody&lt;/b&gt;&lt;br/&gt;contains the JSON object that can be accessed using the dot notation. For example&lt;br/&gt;&lt;br/&gt;&lt;table&gt;
	&lt;tr class="slimRowTitle"&gt;
		&lt;td&gt;&lt;span class="pass"&gt;Table: Rest Fixture&lt;/span&gt;&lt;/td&gt;
		&lt;td colspan="4"&gt;&lt;a href="http://localhost:9876"&gt;http://localhost:9876&lt;/a&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor0"&gt;
		&lt;td&gt;GET&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;&lt;a href='http://localhost:9876/resources/1.json'&gt;/resources/1.json&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;span class="pass"&gt;&lt;div&gt;200&lt;/div&gt;&lt;/span&gt;&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;Set-Cookie&amp;nbsp;:&amp;nbsp;JID="ABC.${a.y}";&lt;br/&gt;Content-Type&amp;nbsp;:&amp;nbsp;application/json;charset=ISO-8859-1&lt;br/&gt;Content-Length&amp;nbsp;:&amp;nbsp;77&lt;br/&gt;Server&amp;nbsp;:&amp;nbsp;Jetty(6.0.2)&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;{&amp;nbsp;"resource"&amp;nbsp;:&amp;nbsp;{&amp;nbsp;"name"&amp;nbsp;:&amp;nbsp;"a&amp;nbsp;funky&amp;nbsp;name",&amp;nbsp;"data"&amp;nbsp;:&amp;nbsp;"an&amp;nbsp;important&amp;nbsp;message"&amp;nbsp;}&amp;nbsp;}&lt;/div&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor1"&gt;
		&lt;td&gt;let&lt;/td&gt;
		&lt;td&gt;body_value&lt;/td&gt;
		&lt;td&gt;js&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;response.jsonbody&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;[object&amp;nbsp;Object]&lt;/div&gt;&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class="slimRowColor0"&gt;
		&lt;td&gt;let&lt;/td&gt;
		&lt;td&gt;body_value&lt;/td&gt;
		&lt;td&gt;js&lt;/td&gt;
		&lt;td&gt;&lt;div&gt;response.jsonbody.resource.name&lt;/div&gt;&lt;/td&gt;
		&lt;td&gt;&lt;span class="pass"&gt;&lt;div&gt;a&amp;nbsp;funky&amp;nbsp;name&lt;/div&gt;&lt;/span&gt;&lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;br/&gt;</content>
    <relativePageName>LetTestsV2</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='tableTable_1_0', instruction='make', instanceName='tableTable_1', className='RestFixture', args=[&lt;a href="http://localhost:9876"&gt;http://localhost:9876&lt;/a&gt;]}</instruction>
        <slimResult>pass(Table: Rest Fixture)</slimResult>
                <expectation>
                    <status>pass</status>
                    <instructionId>tableTable_1_0</instructionId>
                    <col>0</col>
                              <row>0</row>
                    <type>ConstructionExpectation</type>
                                        <evaluationMessage>Table: Rest Fixture</evaluationMessage>
                  </expectation>
              </instructionResult>
            <instructionResult>
        <instruction>{id='tableTable_1_1', instruction='call', instanceName='tableTable_1', methodName='doTable', args=[[[let, message, js, 'Hello, World!', Hello, World!], [let, sum, js, '2 + 5 = ' + (2 + 5), 2 + 5 = 7], [let, two_expressions, js, a=1;
'a is ' + a, a is 1], [let, json_expr, js, 
json = {
    "widget": {
        "debug": "on",
        "window": {
            "title": "Sample Konfabulator Widget",
            "name": "main_window",
            "width": 500,
            "height": 500
        },
        "image": { 
            "src": "Images/Sun.png",
            "name": "sun1",
            "hOffset": 250,
            "vOffset": 250,
            "alignment": "center"
        },
        "text": {
            "data": "Click Here",
            "size": 36,
            "style": "bold",
            "name": "text1",
            "hOffset": 250,
            "vOffset": 100,
            "alignment": "center",
            "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
        }
    }
};
json.widget.image.src
, Images/Sun.png]]]}</instruction>
        <slimResult>pass()</slimResult>
                <expectation>
                    <status>pass</status>
                    <instructionId>tableTable_1_1</instructionId>
                              <type>TableTableExpectation</type>
                                      </expectation>
              </instructionResult>
            <instructionResult>
        <instruction>{id='tableTable_2_0', instruction='make', instanceName='tableTable_2', className='RestFixture', args=[&lt;a href="http://localhost:9876"&gt;http://localhost:9876&lt;/a&gt;]}</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=[[[setBody, &lt;resource&gt;&lt;name&gt;Bill&lt;/name&gt;&lt;data&gt;Some data on Bill&lt;/data&gt;&lt;/resource&gt;], [POST, /resources/, 201, , no-body], [let, id, header, Location:/resources/(.+), ], [let, id_string, js, 'The id is: ' + symbols.get('id'), The id is: %id%]]]}</instruction>
        <slimResult>pass()</slimResult>
                <expectation>
                    <status>pass</status>
                    <instructionId>tableTable_2_1</instructionId>
                              <type>TableTableExpectation</type>
                                      </expectation>
              </instructionResult>
            <instructionResult>
        <instruction>{id='tableTable_3_0', instruction='make', instanceName='tableTable_3', className='RestFixture', args=[&lt;a href="http://localhost:9876"&gt;http://localhost:9876&lt;/a&gt;]}</instruction>
        <slimResult>pass(Table: Rest Fixture)</slimResult>
                <expectation>
                    <status>pass</status>
                    <instructionId>tableTable_3_0</instructionId>
                    <col>0</col>
                              <row>0</row>
                    <type>ConstructionExpectation</type>
                                        <evaluationMessage>Table: Rest Fixture</evaluationMessage>
                  </expectation>
              </instructionResult>
            <instructionResult>
        <instruction>{id='tableTable_3_1', instruction='call', instanceName='tableTable_3', methodName='doTable', args=[[[GET, /resources/1, 200, , ], [let, body_value, js, response.body, ], [setBody, &lt;resource&gt;&lt;name&gt;Bill&lt;/name&gt;&lt;data&gt;Some data on Bill&lt;/data&gt;&lt;/resource&gt;], [POST, /resources/, 201, , no-body], [let, status_code_value, js, response.statusCode, ], [let, status_text_value, js, response.statusText, ], [let, c_len, js, response.header0('Content-Length'), 0], [let, loc_again, js, response.header('Location', 0), ], [let, h_size, js, response.headerListSize('Location'), 1], [let, all_h_size, js, response.headersSize(), ]]]}</instruction>
        <slimResult>pass()</slimResult>
                <expectation>
                    <status>pass</status>
                    <instructionId>tableTable_3_1</instructionId>
                              <type>TableTableExpectation</type>
                                      </expectation>
              </instructionResult>
            <instructionResult>
        <instruction>{id='tableTable_4_0', instruction='make', instanceName='tableTable_4', className='RestFixture', args=[&lt;a href="http://localhost:9876"&gt;http://localhost:9876&lt;/a&gt;]}</instruction>
        <slimResult>pass(Table: Rest Fixture)</slimResult>
                <expectation>
                    <status>pass</status>
                    <instructionId>tableTable_4_0</instructionId>
                    <col>0</col>
                              <row>0</row>
                    <type>ConstructionExpectation</type>
                                        <evaluationMessage>Table: Rest Fixture</evaluationMessage>
                  </expectation>
              </instructionResult>
            <instructionResult>
        <instruction>{id='tableTable_4_1', instruction='call', instanceName='tableTable_4', methodName='doTable', args=[[[GET, /resources/1.json, 200, , ], [let, body_value, js, response.jsonbody, ], [let, body_value, js, response.jsonbody.resource.name, a funky name]]]}</instruction>
        <slimResult>pass()</slimResult>
                <expectation>
                    <status>pass</status>
                    <instructionId>tableTable_4_1</instructionId>
                              <type>TableTableExpectation</type>
                                      </expectation>
              </instructionResult>
          </instructions>
      </result>
    <finalCounts>
    <right>1</right>
    <wrong>0</wrong>
    <ignores>0</ignores>
    <exceptions>0</exceptions>
  </finalCounts>
  <totalRunTimeInMillis>115</totalRunTimeInMillis>
</testResults>





© 2015 - 2024 Weber Informatics LLC | Privacy Policy