Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
138
Merge Requests
138
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
e234f354
Commit
e234f354
authored
Aug 14, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_gadget_interface_validator] Not documented methods are reported as failure
parent
54f7b6b3
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
724 additions
and
23 deletions
+724
-23
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_js.js
...r/PathTemplateItem/web_page_module/gadget_interface_js.js
+24
-7
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_js.xml
.../PathTemplateItem/web_page_module/gadget_interface_js.xml
+2
-2
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_validator_appcache.xml
...m/web_page_module/gadget_interface_validator_appcache.xml
+3
-3
bt5/erp5_gadget_interface_validator_ui_test/PathTemplateItem/portal_tests/gadget_interface_validator_ui_zuite/testGadgetInterfaceVerification.zpt
...ce_validator_ui_zuite/testGadgetInterfaceVerification.zpt
+6
-6
bt5/erp5_gadget_interface_validator_ui_test/PathTemplateItem/web_page_module/gadget_test_interface_validator_appcache.xml
..._page_module/gadget_test_interface_validator_appcache.xml
+7
-5
bt5/erp5_gadget_interface_validator_ui_test/PathTemplateItem/web_page_module/gadget_test_interface_validator_unknown_method_declaration_gadget_html.html
...ace_validator_unknown_method_declaration_gadget_html.html
+18
-0
bt5/erp5_gadget_interface_validator_ui_test/PathTemplateItem/web_page_module/gadget_test_interface_validator_unknown_method_declaration_gadget_html.xml
...face_validator_unknown_method_declaration_gadget_html.xml
+322
-0
bt5/erp5_gadget_interface_validator_ui_test/PathTemplateItem/web_page_module/gadget_test_interface_validator_unknown_method_declaration_gadget_js.js
...terface_validator_unknown_method_declaration_gadget_js.js
+24
-0
bt5/erp5_gadget_interface_validator_ui_test/PathTemplateItem/web_page_module/gadget_test_interface_validator_unknown_method_declaration_gadget_js.xml
...erface_validator_unknown_method_declaration_gadget_js.xml
+318
-0
No files found.
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_js.js
View file @
e234f354
...
@@ -202,25 +202,42 @@
...
@@ -202,25 +202,42 @@
interface_method_name_list
=
[],
interface_method_name_list
=
[],
i
,
i
,
j
,
j
,
failed
=
false
,
missing_method_list
=
[]
,
failed_methods
=
[],
unknown_method_list
=
[],
error_message
;
error_message
;
for
(
i
=
0
;
i
<
interface_method_list
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
interface_method_list
.
length
;
i
+=
1
)
{
interface_method_name_list
.
push
(
interface_method_list
[
i
].
name
);
interface_method_name_list
.
push
(
interface_method_list
[
i
].
name
);
}
}
// Check missing method declaration
for
(
j
=
0
;
j
<
interface_method_name_list
.
length
;
j
+=
1
)
{
for
(
j
=
0
;
j
<
interface_method_name_list
.
length
;
j
+=
1
)
{
if
(
gadget_method_name_list
.
indexOf
(
if
(
gadget_method_name_list
.
indexOf
(
interface_method_name_list
[
j
]
interface_method_name_list
[
j
]
)
<
0
)
{
)
<
0
)
{
failed
=
true
;
missing_method_list
.
push
(
interface_method_name_list
[
j
]);
failed_methods
.
push
(
interface_method_name_list
[
j
]);
}
}
}
}
if
(
failed
)
{
if
(
missing_method_list
.
length
)
{
error_message
=
error_message
=
"
Following required methods are not declared in the gadget:
"
;
"
Following required methods are not declared in the gadget:
"
;
for
(
i
=
0
;
i
<
failed_methods
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
missing_method_list
.
length
;
i
+=
1
)
{
error_message
+=
(
"
\n
"
+
failed_methods
[
i
]);
error_message
+=
(
"
\n
"
+
missing_method_list
[
i
]);
}
throw
new
Error
(
error_message
);
}
// Check unknown method declaration
for
(
j
=
0
;
j
<
gadget_method_name_list
.
length
;
j
+=
1
)
{
if
(
interface_method_name_list
.
indexOf
(
gadget_method_name_list
[
j
]
)
<
0
)
{
unknown_method_list
.
push
(
gadget_method_name_list
[
j
]);
}
}
if
(
unknown_method_list
.
length
)
{
error_message
=
"
Following methods are not documents in the interface:
"
;
for
(
i
=
0
;
i
<
unknown_method_list
.
length
;
i
+=
1
)
{
error_message
+=
(
"
\n
"
+
unknown_method_list
[
i
]);
}
}
throw
new
Error
(
error_message
);
throw
new
Error
(
error_message
);
}
}
...
...
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_js.xml
View file @
e234f354
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
8.35510.60407.49868
</string>
</value>
<value>
<string>
96
9.37975.64169.12509
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -248,7 +248,7 @@
...
@@ -248,7 +248,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
153
0266417.35
</float>
<float>
153
4260072.07
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_validator_appcache.xml
View file @
e234f354
...
@@ -100,7 +100,7 @@
...
@@ -100,7 +100,7 @@
<item>
<item>
<key>
<string>
text_content
</string>
</key>
<key>
<string>
text_content
</string>
</key>
<value>
<string>
CACHE MANIFEST\n
<value>
<string>
CACHE MANIFEST\n
# generated on Thu,
28 Jun
2018 15:31:33 +0000\n
# generated on Thu,
14 Aug
2018 15:31:33 +0000\n
CACHE:\n
CACHE:\n
favicon.ico\n
favicon.ico\n
font-awesome/font-awesome-webfont.eot\n
font-awesome/font-awesome-webfont.eot\n
...
@@ -305,7 +305,7 @@ NETWORK:\n
...
@@ -305,7 +305,7 @@ NETWORK:\n
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
968.
34429.27639.36556
</string>
</value>
<value>
<string>
968.
41228.46964.12441
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -323,7 +323,7 @@ NETWORK:\n
...
@@ -323,7 +323,7 @@ NETWORK:\n
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
153
0201523.97
</float>
<float>
153
4260712.58
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_gadget_interface_validator_ui_test/PathTemplateItem/portal_tests/gadget_interface_validator_ui_zuite/testGadgetInterfaceVerification.zpt
View file @
e234f354
...
@@ -119,19 +119,19 @@
...
@@ -119,19 +119,19 @@
<td>
Error with gadget loading
</td>
<td>
Error with gadget loading
</td>
</tr>
</tr>
<
!--
tr>
<tr>
<td
colspan=
"3"
><b>
Check unknown method declaration
</b></td>
<td
colspan=
"3"
><b>
Check unknown method declaration
</b></td>
</tr>
</tr>
<tr>
<tr>
<td>
waitForElementPresen
t</td>
<td>
assertTex
t
</td>
<td>//t
r[@id='${application_title}_test_unknown_method_declaration_gadget']//td[@class='validation_status final']
</td>
<td>
//t
body/tr[6]/td
</td>
<td></td>
<td>
gadget_interface_validator_test_unknown_method_declaration_gadget.html
</td>
</tr>
</tr>
<tr>
<tr>
<td>
assertText
</td>
<td>
assertText
</td>
<td>//t
r[@id='${application_title}_test_unknown_method_declaration_gadget']//td[@class='validation_status final'
]</td>
<td>
//t
body/tr[6]/td[2
]
</td>
<td>
Failure
</td>
<td>
Failure
</td>
</tr
--
>
</tr>
</tbody></table>
</tbody></table>
</body>
</body>
...
...
bt5/erp5_gadget_interface_validator_ui_test/PathTemplateItem/web_page_module/gadget_test_interface_validator_appcache.xml
View file @
e234f354
...
@@ -100,21 +100,23 @@
...
@@ -100,21 +100,23 @@
<item>
<item>
<key>
<string>
text_content
</string>
</key>
<key>
<string>
text_content
</string>
</key>
<value>
<string>
CACHE MANIFEST\n
<value>
<string>
CACHE MANIFEST\n
# generated on Fri,
06 Feb 2015
15:31:33 +0000\n
# generated on Fri,
14 Jun 2018
15:31:33 +0000\n
# XXX + fonts\n
# XXX + fonts\n
# images/ajax-loader.gif\n
# images/ajax-loader.gif\n
CACHE:\n
CACHE:\n
URI.js\n
URI.js\n
gadget_interface_validator_test_correct_implemented_gadget.html\n
gadget_interface_validator_test_correct_implemented_gadget.html\n
gadget_interface_validator_test_correct_implemented_gadget.js\n
gadget_interface_validator_test_correct_implemented_gadget.js\n
gadget_interface_validator_test_nonexistent_gadget.html\n
gadget_interface_validator_test_nonexistent_gadget.js\n
gadget_interface_validator_test_invalid_interface_gadget.html\n
gadget_interface_validator_test_invalid_interface_gadget.html\n
gadget_interface_validator_test_invalid_interface_gadget.js\n
gadget_interface_validator_test_invalid_interface_gadget.js\n
gadget_interface_validator_test_missing_interface_declaration_gadget.html\n
gadget_interface_validator_test_missing_interface_declaration_gadget.html\n
gadget_interface_validator_test_missing_interface_declaration_gadget.js\n
gadget_interface_validator_test_missing_interface_declaration_gadget.js\n
gadget_interface_validator_test_missing_method_declaration_gadget.html\n
gadget_interface_validator_test_missing_method_declaration_gadget.html\n
gadget_interface_validator_test_missing_method_declaration_gadget.js\n
gadget_interface_validator_test_missing_method_declaration_gadget.js\n
gadget_interface_validator_test_
nonexistent
_gadget.html\n
gadget_interface_validator_test_
unknown_method_declaration
_gadget.html\n
gadget_interface_validator_test_
nonexistent
_gadget.js\n
gadget_interface_validator_test_
unknown_method_declaration
_gadget.js\n
i18next.js\n
i18next.js\n
jquery.js\n
jquery.js\n
jquerymobile.css\n
jquerymobile.css\n
...
@@ -257,7 +259,7 @@ NETWORK:\n
...
@@ -257,7 +259,7 @@ NETWORK:\n
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
46.44862.31274.46370
</string>
</value>
<value>
<string>
9
68.14266.18355.13568
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -275,7 +277,7 @@ NETWORK:\n
...
@@ -275,7 +277,7 @@ NETWORK:\n
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1
445875941.09
</float>
<float>
1
529048876.03
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_gadget_interface_validator_ui_test/PathTemplateItem/web_page_module/gadget_test_interface_validator_unknown_method_declaration_gadget_html.html
0 → 100644
View file @
e234f354
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
/>
<title>
Unknown method declaration Test Gadget
</title>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
/>
<link
rel=
"http://www.renderjs.org/rel/interface"
href=
"gadget_interface_validator_test_dummy_interface1.html"
>
<!-- renderjs -->
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
<!-- custom script -->
<script
src=
"gadget_interface_validator_test_unknown_method_declaration_gadget.js"
type=
"text/javascript"
></script>
</head>
<body>
</body>
</html>
\ No newline at end of file
bt5/erp5_gadget_interface_validator_ui_test/PathTemplateItem/web_page_module/gadget_test_interface_validator_unknown_method_declaration_gadget_html.xml
0 → 100644
View file @
e234f354
This diff is collapsed.
Click to expand it.
bt5/erp5_gadget_interface_validator_ui_test/PathTemplateItem/web_page_module/gadget_test_interface_validator_unknown_method_declaration_gadget_js.js
0 → 100644
View file @
e234f354
/*global window, rJS , RSVP*/
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
)
{
"
use strict
"
;
rJS
(
window
)
.
ready
(
function
(
g
)
{
g
.
props
=
{};
})
.
declareMethod
(
"
method1
"
,
function
(
param1
,
param2
)
{
return
;
})
.
declareMethod
(
"
method2
"
,
function
(
param1
)
{
return
;
})
.
declareMethod
(
"
method3
"
,
function
()
{
return
;
})
.
declareMethod
(
"
method4
"
,
function
()
{
return
;
});
}(
window
,
rJS
));
\ No newline at end of file
bt5/erp5_gadget_interface_validator_ui_test/PathTemplateItem/web_page_module/gadget_test_interface_validator_unknown_method_declaration_gadget_js.xml
0 → 100644
View file @
e234f354
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment