Commit c60f541d authored by Vivek's avatar Vivek

renderjs_interfaces: syntax update.

parent 01d900a2
...@@ -130,8 +130,8 @@ ...@@ -130,8 +130,8 @@
</dd>\n </dd>\n
<dt>method3</dt>\n <dt>method3</dt>\n
<dd>description of method3</dd>\n <dd>description of method3</dd>\n
<dl></dl> \n <dl></dl>\n
</dl> \n </dl>\n
</body>\n </body>\n
</html> </html>
...@@ -270,7 +270,7 @@ ...@@ -270,7 +270,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>944.23279.6717.16810</string> </value> <value> <string>944.38727.13625.36864</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -288,7 +288,7 @@ ...@@ -288,7 +288,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1437729072.46</float> <float>1438006894.41</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
<dl>\n <dl>\n
<dt>testmethod1</dt>\n <dt>testmethod1</dt>\n
<dd>description of testmethod1</dd>\n <dd>description of testmethod1</dd>\n
<dl></dl> \n <dl></dl>\n
<dt>testmethod2</dt>\n <dt>testmethod2</dt>\n
<dd>description of testmethod2</dd>\n <dd>description of testmethod2</dd>\n
<dl>\n <dl>\n
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
<dt data-parameter-required="optional">param2</dt>\n <dt data-parameter-required="optional">param2</dt>\n
<dd>description of param2</dd>\n <dd>description of param2</dd>\n
</dl>\n </dl>\n
</dl> \n </dl>\n
</body>\n </body>\n
</html> </html>
...@@ -270,7 +270,7 @@ ...@@ -270,7 +270,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>944.22909.64597.48196</string> </value> <value> <string>944.38727.37060.50432</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -288,7 +288,7 @@ ...@@ -288,7 +288,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1437729093.91</float> <float>1438006945.77</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -132,8 +132,8 @@ ...@@ -132,8 +132,8 @@
</dd>\n </dd>\n
<dt>method3</dt>\n <dt>method3</dt>\n
<dd>description of method3</dd>\n <dd>description of method3</dd>\n
<dl></dl> \n <dl></dl>\n
</dl> \n </dl>\n
</body>\n </body>\n
</html> </html>
...@@ -272,7 +272,7 @@ ...@@ -272,7 +272,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>944.38747.4525.18602</string> </value> <value> <string>944.38763.51422.46455</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -290,7 +290,7 @@ ...@@ -290,7 +290,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1437730636.54</float> <float>1438007018.31</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
\n \n
<!--Missing <dl></dl> tag for arguments--> \n <!--Missing <dl></dl> tag for arguments--> \n
\n \n
</dl> \n </dl>\n
</body>\n </body>\n
</html> </html>
...@@ -272,7 +272,7 @@ ...@@ -272,7 +272,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>944.38751.9712.8123</string> </value> <value> <string>944.38763.45191.41369</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -290,7 +290,7 @@ ...@@ -290,7 +290,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1437730590.39</float> <float>1438007084.42</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -132,8 +132,8 @@ ...@@ -132,8 +132,8 @@
</dd>\n </dd>\n
<dt>method3</dt>\n <dt>method3</dt>\n
<dd>description of method3</dd>\n <dd>description of method3</dd>\n
<dl></dl> \n <dl></dl>\n
</dl> \n </dl>\n
</body>\n </body>\n
</html> </html>
...@@ -272,7 +272,7 @@ ...@@ -272,7 +272,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>944.38754.38729.21589</string> </value> <value> <string>944.38763.48521.43639</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -290,7 +290,7 @@ ...@@ -290,7 +290,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1437730820.31</float> <float>1438007104.6</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -112,9 +112,6 @@ ...@@ -112,9 +112,6 @@
<title>I-Demo</title>\n <title>I-Demo</title>\n
<meta name="viewport" content="width=device-width, initial-scale=1" />\n <meta name="viewport" content="width=device-width, initial-scale=1" />\n
<link rel="stylesheet" href="jquerymobile.css">\n <link rel="stylesheet" href="jquerymobile.css">\n
\n
<link rel="http://www.renderjs.org/rel/interface" href="demo_interface1.html">\n
<link rel="http://www.renderjs.org/rel/interface" href="demo_interface2.html">\n
\n \n
<!-- renderjs -->\n <!-- renderjs -->\n
<script src="rsvp.js" type="text/javascript"></script>\n <script src="rsvp.js" type="text/javascript"></script>\n
...@@ -323,7 +320,7 @@ ...@@ -323,7 +320,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>944.43289.51727.28569</string> </value> <value> <string>944.43346.53030.10871</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -341,7 +338,7 @@ ...@@ -341,7 +338,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1438006248.54</float> <float>1438073929.05</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
\n \n
var INTERFACE_GADGET_URL = "./gadget_interfaces.html",\n var INTERFACE_GADGET_URL = "./gadget_interfaces.html",\n
INTERFACE_GADGET_SCOPE = "interface";\n INTERFACE_GADGET_SCOPE = "interface";\n
\n \n
rJS(window)\n rJS(window)\n
.ready(function (g) {\n .ready(function (g) {\n
g.props = {};\n g.props = {};\n
...@@ -326,7 +326,7 @@ ...@@ -326,7 +326,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>944.43061.11797.41233</string> </value> <value> <string>944.43062.44277.6144</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -344,7 +344,7 @@ ...@@ -344,7 +344,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1437989200.53</float> <float>1438007247.03</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
var VERIFY_GADGET_SCOPE = "verify_gadget";\n var VERIFY_GADGET_SCOPE = "verify_gadget";\n
\n \n
function getVerifyGadget(gadget_url, interface_gadget) {\n function getVerifyGadget(gadget_url, interface_gadget) {\n
//to declare and get the gadget to be verified.\n //to declare and get the gadget to be verified.\n
return new RSVP.Queue()\n return new RSVP.Queue()\n
.push(function () {\n .push(function () {\n
return interface_gadget.declareGadget(gadget_url, {\n return interface_gadget.declareGadget(gadget_url, {\n
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
}\n }\n
\n \n
function verifyInterfaceDefinition(interface_url) {\n function verifyInterfaceDefinition(interface_url) {\n
//to verify if interface definition follows the correct template.\n //to verify if interface definition follows the correct template.\n
return RSVP.Queue()\n return RSVP.Queue()\n
.push(function () {\n .push(function () {\n
return jQuery.get(interface_url);\n return jQuery.get(interface_url);\n
...@@ -179,12 +179,13 @@ ...@@ -179,12 +179,13 @@
dl_list = doc.getElementsByTagName(\'dl\'),\n dl_list = doc.getElementsByTagName(\'dl\'),\n
next_element = dl_list[0].firstElementChild,\n next_element = dl_list[0].firstElementChild,\n
method_len = dl_list.length - 1,\n method_len = dl_list.length - 1,\n
defer = RSVP.defer();\n defer = RSVP.defer(),\n
i;\n
if (dl_list[0].childElementCount !== 3*method_len) {\n if (dl_list[0].childElementCount !== 3*method_len) {\n
throw new Error("Interface Definition Incorrect.");\n throw new Error("Interface Definition Incorrect.");\n
} \n }\n
try {\n try {\n
for (var i=0; i<method_len; i+=1) {\n for (i = 0; i < method_len; i += 1) {\n
if ((!next_element || next_element.localName.toLowerCase() !== \'dt\') ||\n if ((!next_element || next_element.localName.toLowerCase() !== \'dt\') ||\n
(!(next_element = next_element.nextElementSibling) || next_element.localName.toLowerCase() !== \'dd\') ||\n (!(next_element = next_element.nextElementSibling) || next_element.localName.toLowerCase() !== \'dd\') ||\n
(!(next_element = next_element.nextElementSibling) || next_element.localName.toLowerCase() !== \'dl\')) {\n (!(next_element = next_element.nextElementSibling) || next_element.localName.toLowerCase() !== \'dl\')) {\n
...@@ -194,8 +195,9 @@ ...@@ -194,8 +195,9 @@
throw new Error("Interface Definition Incorrect.");\n throw new Error("Interface Definition Incorrect.");\n
}\n }\n
var argument_len = next_element.getElementsByTagName(\'dt\').length,\n var argument_len = next_element.getElementsByTagName(\'dt\').length,\n
next_child_element = next_element.firstElementChild;\n next_child_element = next_element.firstElementChild,\n
for (var j=0; j<argument_len; j+=1) {\n j;\n
for (j = 0; j < argument_len; j += 1) {\n
if ((!next_child_element || next_child_element.localName.toLowerCase() !== \'dt\') ||\n if ((!next_child_element || next_child_element.localName.toLowerCase() !== \'dt\') ||\n
(!(next_child_element = next_child_element.nextElementSibling) || next_child_element.localName.toLowerCase() !== \'dd\')) {\n (!(next_child_element = next_child_element.nextElementSibling) || next_child_element.localName.toLowerCase() !== \'dd\')) {\n
throw new Error("Interface Definition Incorrect.");\n throw new Error("Interface Definition Incorrect.");\n
...@@ -207,13 +209,13 @@ ...@@ -207,13 +209,13 @@
defer.resolve("Success");\n defer.resolve("Success");\n
} catch(error) {\n } catch(error) {\n
defer.reject(error);\n defer.reject(error);\n
} \n }\n
return defer.promise;\n return defer.promise;\n
});\n });\n
}\n }\n
\n \n
function verifyInterfaceDeclaration(interface_url, declared_interface_list) {\n function verifyInterfaceDeclaration(interface_url, declared_interface_list) {\n
//to verify if gadget declares the interface.\n //to verify if gadget declares the interface.\n
var defer = RSVP.defer();\n var defer = RSVP.defer();\n
try {\n try {\n
if (declared_interface_list.indexOf(interface_url) > -1) {\n if (declared_interface_list.indexOf(interface_url) > -1) {\n
...@@ -228,7 +230,7 @@ ...@@ -228,7 +230,7 @@
}\n }\n
\n \n
function verifyAllMethod(interface_method_list, gadget_method_list) {\n function verifyAllMethod(interface_method_list, gadget_method_list) {\n
//to verify all methods of gadget and interface.\n //to verify all methods of gadget and interface.\n
var defer = RSVP.defer();\n var defer = RSVP.defer();\n
return RSVP.Queue()\n return RSVP.Queue()\n
.push(function() {\n .push(function() {\n
...@@ -247,15 +249,16 @@ ...@@ -247,15 +249,16 @@
}\n }\n
\n \n
function verifyAllMethodDeclared(interface_method_list, gadget_method_list) {\n function verifyAllMethodDeclared(interface_method_list, gadget_method_list) {\n
//to verify if all the interface methods are declared by the gadget.\n //to verify if all the interface methods are declared by the gadget.\n
var defer = RSVP.defer(),\n var defer = RSVP.defer(),\n
gadget_method_name_list = gadget_method_list,\n gadget_method_name_list = gadget_method_list,\n
interface_method_name_list = [];\n interface_method_name_list = [],\n
for (var i=0; i<interface_method_list.length; i+=1) {\n i, j;\n
for (i = 0; i < interface_method_list.length; i += 1) {\n
interface_method_name_list.push(interface_method_list[i].name);\n interface_method_name_list.push(interface_method_list[i].name);\n
}\n }\n
try {\n try {\n
for (var j=0; j<interface_method_name_list.length; j+=1) {\n for (j = 0; j < interface_method_name_list.length; j += 1) {\n
if(gadget_method_name_list.indexOf(interface_method_name_list[j]) < 0) {\n if(gadget_method_name_list.indexOf(interface_method_name_list[j]) < 0) {\n
throw new Error("All methods are not declared.");\n throw new Error("All methods are not declared.");\n
}\n }\n
...@@ -268,19 +271,21 @@ ...@@ -268,19 +271,21 @@
}\n }\n
\n \n
function verifyAllMethodSignature(interface_method_list, gadget_method_list) {\n function verifyAllMethodSignature(interface_method_list, gadget_method_list) {\n
//to verify if all the declared methods match the signature of the interface methods.\n //to verify if all the declared methods match the signature of the interface methods.\n
var defer = RSVP.defer(),\n var defer = RSVP.defer(),\n
interface_method_dict = {},\n interface_method_dict = {},\n
gadget_method_name_list = [],\n gadget_method_name_list = [],\n
index;\n index,\n
for(var i=0; i<interface_method_list.length; i+=1) {\n item,\n
i, j;\n
for(i = 0; i < interface_method_list.length; i += 1) {\n
interface_method_dict[interface_method_list[i].name] = interface_method_list[i];\n interface_method_dict[interface_method_list[i].name] = interface_method_list[i];\n
}\n }\n
for(var j=0; j<gadget_method_list.length; j+=1) {\n for(j = 0; j < gadget_method_list.length; j += 1) {\n
gadget_method_name_list.push(gadget_method_list[j].name);\n gadget_method_name_list.push(gadget_method_list[j].name);\n
}\n }\n
try {\n try {\n
for(var item in interface_method_dict) {\n for(item in interface_method_dict) {\n
index = gadget_method_name_list.lastIndexOf(item);\n index = gadget_method_name_list.lastIndexOf(item);\n
if(!verifyMethodSignature(interface_method_dict[item], gadget_method_list[index])) {\n if(!verifyMethodSignature(interface_method_dict[item], gadget_method_list[index])) {\n
throw new Error("All methods signature do not match.");\n throw new Error("All methods signature do not match.");\n
...@@ -294,12 +299,13 @@ ...@@ -294,12 +299,13 @@
}\n }\n
\n \n
function verifyMethodSignature(interface_method, gadget_method) {\n function verifyMethodSignature(interface_method, gadget_method) {\n
//to verify if two methods have the same signature\n //to verify if two methods have the same signature\n
var max_arg_len = interface_method.argument_list.length,\n var max_arg_len = interface_method.argument_list.length,\n
min_arg_len = 0;\n min_arg_len = 0,\n
i;\n
if (max_arg_len) {\n if (max_arg_len) {\n
var argument_list = interface_method.argument_list;\n var argument_list = interface_method.argument_list;\n
for (var i=0; i<argument_list.length; i+=1) {\n for (i = 0; i < argument_list.length; i += 1) {\n
if (argument_list[i].required) {\n if (argument_list[i].required) {\n
min_arg_len += 1;\n min_arg_len += 1;\n
}\n }\n
...@@ -350,25 +356,27 @@ ...@@ -350,25 +356,27 @@
dt_list = doc.getElementsByTagName(\'dt\'),\n dt_list = doc.getElementsByTagName(\'dt\'),\n
dd_list = doc.getElementsByTagName(\'dd\'),\n dd_list = doc.getElementsByTagName(\'dd\'),\n
method_len = dl_list.length - 1,\n method_len = dl_list.length - 1,\n
dt_count = 0, \n dt_count = 0,\n
dl_count = 1;\n dl_count = 1,\n
i;\n
interface_data.name = doc.getElementsByTagName(\'h1\')[0].innerText;\n interface_data.name = doc.getElementsByTagName(\'h1\')[0].innerText;\n
interface_data.description = doc.getElementsByTagName(\'h3\')[0].innerText;\n interface_data.description = doc.getElementsByTagName(\'h3\')[0].innerText;\n
for (var i=0; i<method_len; i+=1) {\n for (i = 0; i < method_len; i += 1) {\n
var method = {\n var method = {\n
name: dt_list[dt_count].innerText,\n name: dt_list[dt_count].innerText,\n
description: dd_list[dt_count].innerText,\n description: dd_list[dt_count].innerText,\n
argument_list: []\n argument_list: []\n
},\n },\n
argument_len = dl_list[dl_count].getElementsByTagName(\'dt\').length;\n argument_len = dl_list[dl_count].getElementsByTagName(\'dt\').length,\n
j;\n
dt_count += 1;\n dt_count += 1;\n
dl_count += 1;\n dl_count += 1;\n
for (var j=0; j<argument_len; j+=1) {\n for (j = 0; j < argument_len; j += 1) {\n
var argument_item = {\n var argument_item = {\n
name: dt_list[dt_count].innerText,\n name: dt_list[dt_count].innerText,\n
description: dd_list[dt_count].innerText,\n description: dd_list[dt_count].innerText,\n
required: dt_list[dt_count].getAttribute("data-parameter-required") === "optional" ? false:true,\n required: dt_list[dt_count].getAttribute("data-parameter-required") === "optional" ? false:true,\n
type: dt_list[dt_count].getAttribute("data-parameter-type")\n type: dt_list[dt_count].getAttribute("data-parameter-type")\n
};\n };\n
dt_count += 1;\n dt_count += 1;\n
method.argument_list.push(argument_item);\n method.argument_list.push(argument_item);\n
...@@ -438,15 +446,17 @@ ...@@ -438,15 +446,17 @@
})\n })\n
.push(function (declared_interface_list) {\n .push(function (declared_interface_list) {\n
var interface_url,\n var interface_url,\n
result_list = [];\n result_list = [],\n
for (var item in declared_interface_list) {\n item;\n
for (item in declared_interface_list) {\n
interface_url = declared_interface_list[item];\n interface_url = declared_interface_list[item];\n
result_list.push(interface_gadget.verifyGadgetInterfaceImplementation(gadget_url, interface_url));\n result_list.push(interface_gadget.verifyGadgetInterfaceImplementation(gadget_url, interface_url));\n
}\n }\n
return RSVP.all(result_list);\n return RSVP.all(result_list);\n
})\n })\n
.push(function(result_list) {\n .push(function(result_list) {\n
for(var item in result_list) {\n var item;\n
for(item in result_list) {\n
if (!result_list[item]) {\n if (!result_list[item]) {\n
throw new Error("Interface Implementation Failure.");\n throw new Error("Interface Implementation Failure.");\n
}\n }\n
...@@ -596,7 +606,7 @@ ...@@ -596,7 +606,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>944.43313.24628.20019</string> </value> <value> <string>944.46238.52656.22988</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -614,7 +624,7 @@ ...@@ -614,7 +624,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1438006033.5</float> <float>1438180072.6</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -130,8 +130,8 @@ ...@@ -130,8 +130,8 @@
</dd>\n </dd>\n
<dt>method3</dt>\n <dt>method3</dt>\n
<dd>description of method3</dd>\n <dd>description of method3</dd>\n
<dl></dl> \n <dl></dl>\n
</dl> \n </dl>\n
</body>\n </body>\n
</html> </html>
...@@ -270,7 +270,7 @@ ...@@ -270,7 +270,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>944.23279.6717.16810</string> </value> <value> <string>944.38727.13625.36864</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -288,7 +288,7 @@ ...@@ -288,7 +288,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1437729072.46</float> <float>1438006894.41</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
<dl>\n <dl>\n
<dt>testmethod1</dt>\n <dt>testmethod1</dt>\n
<dd>description of testmethod1</dd>\n <dd>description of testmethod1</dd>\n
<dl></dl> \n <dl></dl>\n
<dt>testmethod2</dt>\n <dt>testmethod2</dt>\n
<dd>description of testmethod2</dd>\n <dd>description of testmethod2</dd>\n
<dl>\n <dl>\n
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
<dt data-parameter-required="optional">param2</dt>\n <dt data-parameter-required="optional">param2</dt>\n
<dd>description of param2</dd>\n <dd>description of param2</dd>\n
</dl>\n </dl>\n
</dl> \n </dl>\n
</body>\n </body>\n
</html> </html>
...@@ -270,7 +270,7 @@ ...@@ -270,7 +270,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>944.22909.64597.48196</string> </value> <value> <string>944.38727.37060.50432</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -288,7 +288,7 @@ ...@@ -288,7 +288,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1437729093.91</float> <float>1438006945.77</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -132,8 +132,8 @@ ...@@ -132,8 +132,8 @@
</dd>\n </dd>\n
<dt>method3</dt>\n <dt>method3</dt>\n
<dd>description of method3</dd>\n <dd>description of method3</dd>\n
<dl></dl> \n <dl></dl>\n
</dl> \n </dl>\n
</body>\n </body>\n
</html> </html>
...@@ -272,7 +272,7 @@ ...@@ -272,7 +272,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>944.38747.4525.18602</string> </value> <value> <string>944.38763.51422.46455</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -290,7 +290,7 @@ ...@@ -290,7 +290,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1437730636.54</float> <float>1438007018.31</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
\n \n
<!--Missing <dl></dl> tag for arguments--> \n <!--Missing <dl></dl> tag for arguments--> \n
\n \n
</dl> \n </dl>\n
</body>\n </body>\n
</html> </html>
...@@ -272,7 +272,7 @@ ...@@ -272,7 +272,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>944.38751.9712.8123</string> </value> <value> <string>944.38763.45191.41369</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -290,7 +290,7 @@ ...@@ -290,7 +290,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1437730590.39</float> <float>1438007084.42</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -132,8 +132,8 @@ ...@@ -132,8 +132,8 @@
</dd>\n </dd>\n
<dt>method3</dt>\n <dt>method3</dt>\n
<dd>description of method3</dd>\n <dd>description of method3</dd>\n
<dl></dl> \n <dl></dl>\n
</dl> \n </dl>\n
</body>\n </body>\n
</html> </html>
...@@ -272,7 +272,7 @@ ...@@ -272,7 +272,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>944.38754.38729.21589</string> </value> <value> <string>944.38763.48521.43639</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -290,7 +290,7 @@ ...@@ -290,7 +290,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1437730820.31</float> <float>1438007104.6</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
var VERIFY_GADGET_SCOPE = "verify_gadget";\n var VERIFY_GADGET_SCOPE = "verify_gadget";\n
\n \n
function getVerifyGadget(gadget_url, interface_gadget) {\n function getVerifyGadget(gadget_url, interface_gadget) {\n
//to declare and get the gadget to be verified.\n //to declare and get the gadget to be verified.\n
return new RSVP.Queue()\n return new RSVP.Queue()\n
.push(function () {\n .push(function () {\n
return interface_gadget.declareGadget(gadget_url, {\n return interface_gadget.declareGadget(gadget_url, {\n
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
}\n }\n
\n \n
function verifyInterfaceDefinition(interface_url) {\n function verifyInterfaceDefinition(interface_url) {\n
//to verify if interface definition follows the correct template.\n //to verify if interface definition follows the correct template.\n
return RSVP.Queue()\n return RSVP.Queue()\n
.push(function () {\n .push(function () {\n
return jQuery.get(interface_url);\n return jQuery.get(interface_url);\n
...@@ -179,12 +179,13 @@ ...@@ -179,12 +179,13 @@
dl_list = doc.getElementsByTagName(\'dl\'),\n dl_list = doc.getElementsByTagName(\'dl\'),\n
next_element = dl_list[0].firstElementChild,\n next_element = dl_list[0].firstElementChild,\n
method_len = dl_list.length - 1,\n method_len = dl_list.length - 1,\n
defer = RSVP.defer();\n defer = RSVP.defer(),\n
i;\n
if (dl_list[0].childElementCount !== 3*method_len) {\n if (dl_list[0].childElementCount !== 3*method_len) {\n
throw new Error("Interface Definition Incorrect.");\n throw new Error("Interface Definition Incorrect.");\n
} \n }\n
try {\n try {\n
for (var i=0; i<method_len; i+=1) {\n for (i = 0; i < method_len; i += 1) {\n
if ((!next_element || next_element.localName.toLowerCase() !== \'dt\') ||\n if ((!next_element || next_element.localName.toLowerCase() !== \'dt\') ||\n
(!(next_element = next_element.nextElementSibling) || next_element.localName.toLowerCase() !== \'dd\') ||\n (!(next_element = next_element.nextElementSibling) || next_element.localName.toLowerCase() !== \'dd\') ||\n
(!(next_element = next_element.nextElementSibling) || next_element.localName.toLowerCase() !== \'dl\')) {\n (!(next_element = next_element.nextElementSibling) || next_element.localName.toLowerCase() !== \'dl\')) {\n
...@@ -194,8 +195,9 @@ ...@@ -194,8 +195,9 @@
throw new Error("Interface Definition Incorrect.");\n throw new Error("Interface Definition Incorrect.");\n
}\n }\n
var argument_len = next_element.getElementsByTagName(\'dt\').length,\n var argument_len = next_element.getElementsByTagName(\'dt\').length,\n
next_child_element = next_element.firstElementChild;\n next_child_element = next_element.firstElementChild,\n
for (var j=0; j<argument_len; j+=1) {\n j;\n
for (j = 0; j < argument_len; j += 1) {\n
if ((!next_child_element || next_child_element.localName.toLowerCase() !== \'dt\') ||\n if ((!next_child_element || next_child_element.localName.toLowerCase() !== \'dt\') ||\n
(!(next_child_element = next_child_element.nextElementSibling) || next_child_element.localName.toLowerCase() !== \'dd\')) {\n (!(next_child_element = next_child_element.nextElementSibling) || next_child_element.localName.toLowerCase() !== \'dd\')) {\n
throw new Error("Interface Definition Incorrect.");\n throw new Error("Interface Definition Incorrect.");\n
...@@ -207,13 +209,13 @@ ...@@ -207,13 +209,13 @@
defer.resolve("Success");\n defer.resolve("Success");\n
} catch(error) {\n } catch(error) {\n
defer.reject(error);\n defer.reject(error);\n
} \n }\n
return defer.promise;\n return defer.promise;\n
});\n });\n
}\n }\n
\n \n
function verifyInterfaceDeclaration(interface_url, declared_interface_list) {\n function verifyInterfaceDeclaration(interface_url, declared_interface_list) {\n
//to verify if gadget declares the interface.\n //to verify if gadget declares the interface.\n
var defer = RSVP.defer();\n var defer = RSVP.defer();\n
try {\n try {\n
if (declared_interface_list.indexOf(interface_url) > -1) {\n if (declared_interface_list.indexOf(interface_url) > -1) {\n
...@@ -228,7 +230,7 @@ ...@@ -228,7 +230,7 @@
}\n }\n
\n \n
function verifyAllMethod(interface_method_list, gadget_method_list) {\n function verifyAllMethod(interface_method_list, gadget_method_list) {\n
//to verify all methods of gadget and interface.\n //to verify all methods of gadget and interface.\n
var defer = RSVP.defer();\n var defer = RSVP.defer();\n
return RSVP.Queue()\n return RSVP.Queue()\n
.push(function() {\n .push(function() {\n
...@@ -247,15 +249,16 @@ ...@@ -247,15 +249,16 @@
}\n }\n
\n \n
function verifyAllMethodDeclared(interface_method_list, gadget_method_list) {\n function verifyAllMethodDeclared(interface_method_list, gadget_method_list) {\n
//to verify if all the interface methods are declared by the gadget.\n //to verify if all the interface methods are declared by the gadget.\n
var defer = RSVP.defer(),\n var defer = RSVP.defer(),\n
gadget_method_name_list = gadget_method_list,\n gadget_method_name_list = gadget_method_list,\n
interface_method_name_list = [];\n interface_method_name_list = [],\n
for (var i=0; i<interface_method_list.length; i+=1) {\n i, j;\n
for (i = 0; i < interface_method_list.length; i += 1) {\n
interface_method_name_list.push(interface_method_list[i].name);\n interface_method_name_list.push(interface_method_list[i].name);\n
}\n }\n
try {\n try {\n
for (var j=0; j<interface_method_name_list.length; j+=1) {\n for (j = 0; j < interface_method_name_list.length; j += 1) {\n
if(gadget_method_name_list.indexOf(interface_method_name_list[j]) < 0) {\n if(gadget_method_name_list.indexOf(interface_method_name_list[j]) < 0) {\n
throw new Error("All methods are not declared.");\n throw new Error("All methods are not declared.");\n
}\n }\n
...@@ -268,19 +271,21 @@ ...@@ -268,19 +271,21 @@
}\n }\n
\n \n
function verifyAllMethodSignature(interface_method_list, gadget_method_list) {\n function verifyAllMethodSignature(interface_method_list, gadget_method_list) {\n
//to verify if all the declared methods match the signature of the interface methods.\n //to verify if all the declared methods match the signature of the interface methods.\n
var defer = RSVP.defer(),\n var defer = RSVP.defer(),\n
interface_method_dict = {},\n interface_method_dict = {},\n
gadget_method_name_list = [],\n gadget_method_name_list = [],\n
index;\n index,\n
for(var i=0; i<interface_method_list.length; i+=1) {\n item,\n
i, j;\n
for(i = 0; i < interface_method_list.length; i += 1) {\n
interface_method_dict[interface_method_list[i].name] = interface_method_list[i];\n interface_method_dict[interface_method_list[i].name] = interface_method_list[i];\n
}\n }\n
for(var j=0; j<gadget_method_list.length; j+=1) {\n for(j = 0; j < gadget_method_list.length; j += 1) {\n
gadget_method_name_list.push(gadget_method_list[j].name);\n gadget_method_name_list.push(gadget_method_list[j].name);\n
}\n }\n
try {\n try {\n
for(var item in interface_method_dict) {\n for(item in interface_method_dict) {\n
index = gadget_method_name_list.lastIndexOf(item);\n index = gadget_method_name_list.lastIndexOf(item);\n
if(!verifyMethodSignature(interface_method_dict[item], gadget_method_list[index])) {\n if(!verifyMethodSignature(interface_method_dict[item], gadget_method_list[index])) {\n
throw new Error("All methods signature do not match.");\n throw new Error("All methods signature do not match.");\n
...@@ -294,12 +299,13 @@ ...@@ -294,12 +299,13 @@
}\n }\n
\n \n
function verifyMethodSignature(interface_method, gadget_method) {\n function verifyMethodSignature(interface_method, gadget_method) {\n
//to verify if two methods have the same signature\n //to verify if two methods have the same signature\n
var max_arg_len = interface_method.argument_list.length,\n var max_arg_len = interface_method.argument_list.length,\n
min_arg_len = 0;\n min_arg_len = 0,\n
i;\n
if (max_arg_len) {\n if (max_arg_len) {\n
var argument_list = interface_method.argument_list;\n var argument_list = interface_method.argument_list;\n
for (var i=0; i<argument_list.length; i+=1) {\n for (i = 0; i < argument_list.length; i += 1) {\n
if (argument_list[i].required) {\n if (argument_list[i].required) {\n
min_arg_len += 1;\n min_arg_len += 1;\n
}\n }\n
...@@ -350,25 +356,27 @@ ...@@ -350,25 +356,27 @@
dt_list = doc.getElementsByTagName(\'dt\'),\n dt_list = doc.getElementsByTagName(\'dt\'),\n
dd_list = doc.getElementsByTagName(\'dd\'),\n dd_list = doc.getElementsByTagName(\'dd\'),\n
method_len = dl_list.length - 1,\n method_len = dl_list.length - 1,\n
dt_count = 0, \n dt_count = 0,\n
dl_count = 1;\n dl_count = 1,\n
i;\n
interface_data.name = doc.getElementsByTagName(\'h1\')[0].innerText;\n interface_data.name = doc.getElementsByTagName(\'h1\')[0].innerText;\n
interface_data.description = doc.getElementsByTagName(\'h3\')[0].innerText;\n interface_data.description = doc.getElementsByTagName(\'h3\')[0].innerText;\n
for (var i=0; i<method_len; i+=1) {\n for (i = 0; i < method_len; i += 1) {\n
var method = {\n var method = {\n
name: dt_list[dt_count].innerText,\n name: dt_list[dt_count].innerText,\n
description: dd_list[dt_count].innerText,\n description: dd_list[dt_count].innerText,\n
argument_list: []\n argument_list: []\n
},\n },\n
argument_len = dl_list[dl_count].getElementsByTagName(\'dt\').length;\n argument_len = dl_list[dl_count].getElementsByTagName(\'dt\').length,\n
j;\n
dt_count += 1;\n dt_count += 1;\n
dl_count += 1;\n dl_count += 1;\n
for (var j=0; j<argument_len; j+=1) {\n for (j = 0; j < argument_len; j += 1) {\n
var argument_item = {\n var argument_item = {\n
name: dt_list[dt_count].innerText,\n name: dt_list[dt_count].innerText,\n
description: dd_list[dt_count].innerText,\n description: dd_list[dt_count].innerText,\n
required: dt_list[dt_count].getAttribute("data-parameter-required") === "optional" ? false:true,\n required: dt_list[dt_count].getAttribute("data-parameter-required") === "optional" ? false:true,\n
type: dt_list[dt_count].getAttribute("data-parameter-type")\n type: dt_list[dt_count].getAttribute("data-parameter-type")\n
};\n };\n
dt_count += 1;\n dt_count += 1;\n
method.argument_list.push(argument_item);\n method.argument_list.push(argument_item);\n
...@@ -438,15 +446,17 @@ ...@@ -438,15 +446,17 @@
})\n })\n
.push(function (declared_interface_list) {\n .push(function (declared_interface_list) {\n
var interface_url,\n var interface_url,\n
result_list = [];\n result_list = [],\n
for (var item in declared_interface_list) {\n item;\n
for (item in declared_interface_list) {\n
interface_url = declared_interface_list[item];\n interface_url = declared_interface_list[item];\n
result_list.push(interface_gadget.verifyGadgetInterfaceImplementation(gadget_url, interface_url));\n result_list.push(interface_gadget.verifyGadgetInterfaceImplementation(gadget_url, interface_url));\n
}\n }\n
return RSVP.all(result_list);\n return RSVP.all(result_list);\n
})\n })\n
.push(function(result_list) {\n .push(function(result_list) {\n
for(var item in result_list) {\n var item;\n
for(item in result_list) {\n
if (!result_list[item]) {\n if (!result_list[item]) {\n
throw new Error("Interface Implementation Failure.");\n throw new Error("Interface Implementation Failure.");\n
}\n }\n
...@@ -596,7 +606,7 @@ ...@@ -596,7 +606,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>944.43313.24628.20019</string> </value> <value> <string>944.46238.52656.22988</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -614,7 +624,7 @@ ...@@ -614,7 +624,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1438006033.5</float> <float>1438180072.6</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>renderjs_interface_test.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>interface_test_gadget</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<title>Test renderJS</title>\n
<meta name="viewport" content="width=device-width, height=device-height"/>\n
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\n
<link rel="stylesheet" href="qunit.css" type="text/css" media="screen"/>\n
<script src="rsvp.js" type="text/javascript"></script>\n
<script src="qunit.js" type="text/javascript"></script>\n
<script src="renderjs.js" type="text/javascript"></script>\n
<script src="sinon.js" type="text/javascript"></script>\n
<script src="URI.js"></script> \n
<script src="jquery.js" type="text/javascript"></script>\n
<script src="gadget_interfaces.js" type="text/javascript"></script>\n
<script src="renderjs_interface_test.js" type="text/javascript"></script>\n
</head>\n
<body>\n
<h1 id="qunit-header">QUnit renderJS test suite</h1>\n
<h2 id="qunit-banner"></h2>\n
<div id="qunit-testrunner-toolbar"></div>\n
<h2 id="qunit-userAgent"></h2>\n
<ol id="qunit-tests"></ol>\n
<div id="qunit-fixture">test markup, will be hidden</div>\n
</body>\n
</html>
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>RenderJS Interface Test</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope1</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1437140868.06</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>944.43373.5814.17749</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1438007842.34</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>empty</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1437137904.81</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
...@@ -138,11 +138,10 @@ ...@@ -138,11 +138,10 @@
.push(function(result) {\n .push(function(result) {\n
equal(result, true, "verify correctly implemented gadget test - expected true - success");\n equal(result, true, "verify correctly implemented gadget test - expected true - success");\n
});\n });\n
\n
});\n });\n
\n \n
module("RJSMissingInterfaceDeclarationTest");\n module("RJSMissingInterfaceDeclarationTest");\n
\n \n
test("verify missing interface declaration gadget test", function() {\n test("verify missing interface declaration gadget test", function() {\n
var gadget_url = "./interface_test_missing_interface_declaration_gadget.html",\n var gadget_url = "./interface_test_missing_interface_declaration_gadget.html",\n
interface_url = "https://softinst60317.host.vifib.net/erp5/web_site_module/interface_test/demo_interface1.html";\n interface_url = "https://softinst60317.host.vifib.net/erp5/web_site_module/interface_test/demo_interface1.html";\n
...@@ -156,11 +155,10 @@ ...@@ -156,11 +155,10 @@
.push(function(result) {\n .push(function(result) {\n
equal(result, false, "verify missing interface declaration gadget test - expected false - success");\n equal(result, false, "verify missing interface declaration gadget test - expected false - success");\n
});\n });\n
\n
});\n });\n
\n \n
module("RJSMissingMethodDeclarationTest");\n module("RJSMissingMethodDeclarationTest");\n
\n \n
test("verify missing method declaration gadget test", function() {\n test("verify missing method declaration gadget test", function() {\n
var gadget_url = "./interface_test_missing_method_declaration_gadget.html",\n var gadget_url = "./interface_test_missing_method_declaration_gadget.html",\n
interface_url = "https://softinst60317.host.vifib.net/erp5/web_site_module/interface_test/demo_interface1.html";\n interface_url = "https://softinst60317.host.vifib.net/erp5/web_site_module/interface_test/demo_interface1.html";\n
...@@ -174,11 +172,10 @@ ...@@ -174,11 +172,10 @@
.push(function(result) {\n .push(function(result) {\n
equal(result, false, "verify missing method declaration gadget test - expected false - success");\n equal(result, false, "verify missing method declaration gadget test - expected false - success");\n
});\n });\n
\n
});\n });\n
\n \n
module("RJSMismatchedMethodArgumentTest");\n module("RJSMismatchedMethodArgumentTest");\n
\n \n
test("verify mismatched method argument gadget test", function() {\n test("verify mismatched method argument gadget test", function() {\n
var gadget_url = "./interface_test_mismatched_argument_gadget.html",\n var gadget_url = "./interface_test_mismatched_argument_gadget.html",\n
interface_url = "https://softinst60317.host.vifib.net/erp5/web_site_module/interface_test/demo_interface1.html";\n interface_url = "https://softinst60317.host.vifib.net/erp5/web_site_module/interface_test/demo_interface1.html";\n
...@@ -192,11 +189,10 @@ ...@@ -192,11 +189,10 @@
.push(function(result) {\n .push(function(result) {\n
equal(result, false, "verify mismatched method argument gadget test - expected false - success");\n equal(result, false, "verify mismatched method argument gadget test - expected false - success");\n
});\n });\n
\n
});\n });\n
\n \n
module("RJSMultipleInterfaceCorrectImplementationTest");\n module("RJSMultipleInterfaceCorrectImplementationTest");\n
\n \n
test("verify multiple interface correct gadget test", function() {\n test("verify multiple interface correct gadget test", function() {\n
var gadget_url = "./interface_test_multiple_interface_correct_gadget.html";\n var gadget_url = "./interface_test_multiple_interface_correct_gadget.html";\n
return new RSVP.Queue()\n return new RSVP.Queue()\n
...@@ -209,11 +205,10 @@ ...@@ -209,11 +205,10 @@
.push(function(result) {\n .push(function(result) {\n
equal(result, true, "verify multiple interface correct gadget test - expected true - success");\n equal(result, true, "verify multiple interface correct gadget test - expected true - success");\n
});\n });\n
\n
});\n });\n
\n \n
module("RJSMultipleInterfaceMissingMethodDeclarationTest");\n module("RJSMultipleInterfaceMissingMethodDeclarationTest");\n
\n \n
test("verify multiple interface missing method declaration gadget test", function() {\n test("verify multiple interface missing method declaration gadget test", function() {\n
var gadget_url = "./interface_test_multiple_interface_missing_method_declaration_gadget.html";\n var gadget_url = "./interface_test_multiple_interface_missing_method_declaration_gadget.html";\n
return new RSVP.Queue()\n return new RSVP.Queue()\n
...@@ -226,11 +221,10 @@ ...@@ -226,11 +221,10 @@
.push(function(result) {\n .push(function(result) {\n
equal(result, false, "verify multiple interface missing method declaration gadget test - expected false - success");\n equal(result, false, "verify multiple interface missing method declaration gadget test - expected false - success");\n
});\n });\n
\n
});\n });\n
\n \n
module("RJSMultipleInterfaceMismatchedArgumentTest");\n module("RJSMultipleInterfaceMismatchedArgumentTest");\n
\n \n
test("verify multiple interface mismatched argument gadget test", function() {\n test("verify multiple interface mismatched argument gadget test", function() {\n
var gadget_url = "./interface_test_multiple_interface_mismached_argument_gadget.html";\n var gadget_url = "./interface_test_multiple_interface_mismached_argument_gadget.html";\n
return new RSVP.Queue()\n return new RSVP.Queue()\n
...@@ -243,11 +237,10 @@ ...@@ -243,11 +237,10 @@
.push(function(result) {\n .push(function(result) {\n
equal(result, false, "verify multiple interface mismatched argument gadget test - expected false - success");\n equal(result, false, "verify multiple interface mismatched argument gadget test - expected false - success");\n
});\n });\n
\n
});\n });\n
\n \n
module("RJSInvalidInterfaceDefinitionTest");\n module("RJSInvalidInterfaceDefinitionTest");\n
\n \n
test("verify invalid interface definition gadget test", function() {\n test("verify invalid interface definition gadget test", function() {\n
var gadget_url = "./interface_test_missing_interface_declaration_gadget.html",\n var gadget_url = "./interface_test_missing_interface_declaration_gadget.html",\n
interface_url1 = "https://softinst60317.host.vifib.net/erp5/web_site_module/interface_test/demo_interface_invalid1.html",\n interface_url1 = "https://softinst60317.host.vifib.net/erp5/web_site_module/interface_test/demo_interface_invalid1.html",\n
...@@ -269,9 +262,8 @@ ...@@ -269,9 +262,8 @@
equal(result[1], false, "verify invalid interface definition - missing param list tag - gadget test - expected false - success");\n equal(result[1], false, "verify invalid interface definition - missing param list tag - gadget test - expected false - success");\n
equal(result[2], false, "verify invalid interface definition - missing param description tag - gadget test - expected false - success");\n equal(result[2], false, "verify invalid interface definition - missing param description tag - gadget test - expected false - success");\n
});\n });\n
\n
});\n });\n
\n \n
}(document, renderJS, QUnit, sinon, URI));\n }(document, renderJS, QUnit, sinon, URI));\n
</string> </value> </string> </value>
</item> </item>
...@@ -408,7 +400,7 @@ ...@@ -408,7 +400,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>944.38901.1195.26897</string> </value> <value> <string>944.43375.6436.61201</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -426,7 +418,7 @@ ...@@ -426,7 +418,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1437747711.99</float> <float>1438008031.04</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
.declareMethod("method1", function (param1, param2) {\n .declareMethod("method1", function (param1, param2) {\n
return;\n return;\n
})\n })\n
// method2 - argument mismatched - expects param1. \n // method2 - argument mismatched - expects param1.\n
.declareMethod("method2", function () {\n .declareMethod("method2", function () {\n
return;\n return;\n
})\n })\n
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>944.37539.18747.48452</string> </value> <value> <string>944.37543.12889.41096</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -276,7 +276,7 @@ ...@@ -276,7 +276,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1437657935.47</float> <float>1438008051.98</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple>
<string>aggregate/web_page_module/gadget_rjs_itest_index_html</string> <string>aggregate/web_page_module/interface_test_gadget</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -388,7 +388,7 @@ ...@@ -388,7 +388,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>944.38987.49759.34713</string> </value> <value> <string>944.38988.2596.37649</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -406,7 +406,7 @@ ...@@ -406,7 +406,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1437744722.37</float> <float>1438007850.47</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment