jsf.js_next_gen 1.0.0-beta-19 → 4.0.0-RC-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (343) hide show
  1. package/.mocharc.json +2 -1
  2. package/.nyc_output/2303b649-59d9-485c-9228-73b0ec8787a7.json +1 -0
  3. package/.nyc_output/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +1 -0
  4. package/.nyc_output/processinfo/2303b649-59d9-485c-9228-73b0ec8787a7.json +1 -0
  5. package/.nyc_output/processinfo/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +1 -0
  6. package/.nyc_output/processinfo/index.json +1 -0
  7. package/.nycrc +2 -1
  8. package/README.md +81 -24
  9. package/dist/docs/assets/highlight.css +21 -0
  10. package/dist/docs/assets/search.js +1 -1
  11. package/dist/docs/assets/style.css +34 -2
  12. package/dist/docs/functions/{jsf.ajax.addOnError.html → faces.ajax.addOnError.html} +15 -13
  13. package/dist/docs/functions/{jsf.ajax.addOnEvent.html → faces.ajax.addOnEvent.html} +15 -13
  14. package/dist/docs/functions/{jsf.ajax.request.html → faces.ajax.request.html} +15 -13
  15. package/dist/docs/functions/{jsf.ajax.response.html → faces.ajax.response.html} +15 -13
  16. package/dist/docs/functions/{jsf.getClientWindow.html → faces.getClientWindow.html} +17 -14
  17. package/dist/docs/functions/{jsf.getProjectStage.html → faces.getProjectStage.html} +18 -15
  18. package/dist/docs/functions/{jsf.getViewState.html → faces.getViewState.html} +18 -15
  19. package/dist/docs/functions/{jsf.push.close.html → faces.push.close.html} +15 -13
  20. package/dist/docs/functions/{jsf.push.init.html → faces.push.init.html} +29 -19
  21. package/dist/docs/functions/{jsf.push.open.html → faces.push.open.html} +15 -13
  22. package/dist/docs/functions/{jsf.util.chain.html → faces.util.chain.html} +12 -10
  23. package/dist/docs/functions/myfaces.ab.html +10 -8
  24. package/dist/docs/index.html +74 -29
  25. package/dist/docs/modules/{jsf.ajax.html → faces.ajax.html} +18 -16
  26. package/dist/docs/modules/faces.html +75 -0
  27. package/dist/docs/modules/{jsf.push.html → faces.push.html} +16 -14
  28. package/dist/docs/modules/{jsf.util.html → faces.util.html} +12 -10
  29. package/dist/docs/modules/myfaces.html +8 -6
  30. package/dist/docs/modules.html +9 -7
  31. package/dist/docs/variables/faces.contextpath.html +57 -0
  32. package/dist/docs/variables/{jsf.implversion.html → faces.implversion.html} +17 -14
  33. package/dist/docs/variables/{jsf.separatorchar.html → faces.separatorchar.html} +18 -15
  34. package/dist/docs/variables/faces.specversion.html +64 -0
  35. package/dist/docs/variables/myfaces.oam.html +8 -6
  36. package/dist/window/faces-development.js +7688 -0
  37. package/dist/window/faces-development.js.br +0 -0
  38. package/dist/window/faces-development.js.gz +0 -0
  39. package/dist/window/faces-development.js.map +1 -0
  40. package/dist/window/faces.js +3 -0
  41. package/dist/window/faces.js.LICENSE.txt +87 -0
  42. package/dist/window/faces.js.br +0 -0
  43. package/dist/window/faces.js.gz +0 -0
  44. package/dist/window/faces.js.map +1 -0
  45. package/dist/window/jsf-development.js +3043 -3018
  46. package/dist/window/jsf-development.js.br +0 -0
  47. package/dist/window/jsf-development.js.gz +0 -0
  48. package/dist/window/jsf-development.js.map +1 -1
  49. package/dist/window/jsf.js +2 -1
  50. package/dist/window/jsf.js.LICENSE.txt +87 -0
  51. package/dist/window/jsf.js.br +0 -0
  52. package/dist/window/jsf.js.gz +0 -0
  53. package/dist/window/jsf.js.map +1 -1
  54. package/package.json +12 -12
  55. package/pom.xml +14 -0
  56. package/src/main/java/com/example/jsfs_js_ts/DecoratedFacesJS.java +94 -0
  57. package/src/main/java/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.java +54 -0
  58. package/src/main/java/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.java +57 -0
  59. package/src/main/java/com/example/jsfs_js_ts/FacesJSMappingDecorator.java +138 -0
  60. package/src/main/typescript/@types/definitions/index.d.ts +147 -0
  61. package/src/main/typescript/api/{Jsf.ts → _api.ts} +61 -49
  62. package/src/main/typescript/api/faces.ts +44 -0
  63. package/src/main/typescript/api/jsf.ts +43 -0
  64. package/src/main/typescript/impl/AjaxImpl.ts +39 -42
  65. package/src/main/typescript/impl/PushImpl.ts +27 -30
  66. package/src/main/typescript/impl/core/Const.ts +38 -16
  67. package/src/main/typescript/impl/core/ImplTypes.ts +1 -1
  68. package/src/main/typescript/impl/i18n/Messages.ts +2 -2
  69. package/src/main/typescript/impl/util/Assertions.ts +3 -3
  70. package/src/main/typescript/impl/util/AsyncQueue.ts +1 -1
  71. package/src/main/typescript/impl/util/AsyncRunnable.ts +5 -5
  72. package/src/main/typescript/impl/util/ExtDomQuery.ts +200 -48
  73. package/src/main/typescript/impl/util/IListener.ts +1 -1
  74. package/src/main/typescript/impl/util/Lang.ts +25 -25
  75. package/src/main/typescript/impl/xhrCore/ErrorData.ts +2 -3
  76. package/src/main/typescript/impl/xhrCore/EventData.ts +4 -3
  77. package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +19 -11
  78. package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +15 -14
  79. package/src/main/typescript/impl/xhrCore/ResonseDataResolver.ts +15 -11
  80. package/src/main/typescript/impl/xhrCore/Response.ts +30 -24
  81. package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +69 -49
  82. package/src/main/typescript/impl/xhrCore/XhrFormData.ts +9 -7
  83. package/src/main/typescript/impl/xhrCore/XhrRequest.ts +76 -60
  84. package/src/main/typescript/myfaces/OamSubmit.ts +51 -86
  85. package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +277 -65
  86. package/src/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.ts +1 -1
  87. package/src/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.ts +1 -1
  88. package/src/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.ts +1 -1
  89. package/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.ts +1 -6
  90. package/src/main/typescript/test/frameworkBase/_ext/monadish/StreamTest.spec.ts +1 -1
  91. package/src/main/typescript/test/frameworkBase/_ext/monadish/fixtures/test.js +1 -0
  92. package/src/main/typescript/test/frameworkBase/_ext/monadish/fixtures/test2.js +1 -0
  93. package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +78 -33
  94. package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +44 -4
  95. package/src/main/typescript/test/impl/ImplTest.spec.ts +18 -22
  96. package/src/main/typescript/test/impl/ImplTest_23.spec.ts +129 -0
  97. package/src/main/typescript/test/impl/SeparatorCharsTest.spec.ts +7 -7
  98. package/src/main/typescript/test/myfaces/OamSubmit.spec.ts +99 -17
  99. package/src/main/typescript/test/queue/AsynchronousProbe.ts +1 -1
  100. package/src/main/typescript/test/queue/AsynchronousQueueTest.spec.ts +4 -4
  101. package/src/main/typescript/test/xhrCore/EventTests.spec.ts +15 -23
  102. package/src/main/typescript/test/xhrCore/FakeWebsocket.ts +3 -3
  103. package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +7 -32
  104. package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +16 -37
  105. package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +17 -16
  106. package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +364 -0
  107. package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +102 -47
  108. package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +362 -0
  109. package/src/main/typescript/test/xhrCore/ShadowDomTest.spec.ts +6 -9
  110. package/src/main/typescript/test/xhrCore/WebsocketTest.ts +15 -15
  111. package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +3 -3
  112. package/{target/main/typescript/impl/util/AsyncRunnable.js → src/main/typescript/test/xhrCore/fixtures/addedViewHead1.js} +4 -6
  113. package/src/main/typescript/test/xhrCore/fixtures/addedViewHead2.css +18 -0
  114. package/src/main/typescript/test/xhrCore/fixtures/addedViewHead2.js +16 -0
  115. package/src/main/typescript/test/xhrCore/fixtures/addedViewHead3.js +16 -0
  116. package/src/main/typescript/test/xhrCore/fixtures/nonce_script.js +16 -0
  117. package/src/main/typescript/tsconfig-typedoc.json +17 -1
  118. package/src/main/typescript/tsconfig.json +24 -5
  119. package/src/test/resources/jsf-development.js +1 -1
  120. package/src/test.html +75 -0
  121. package/src/tmp/test.html +92 -0
  122. package/target/api/{Jsf.js → _api.js} +68 -70
  123. package/target/api/_api.js.map +1 -0
  124. package/target/api/faces.js +45 -0
  125. package/target/api/faces.js.map +1 -0
  126. package/target/api/jsf.js +45 -0
  127. package/target/api/jsf.js.map +1 -0
  128. package/target/classes/com/example/jsfs_js_ts/DecoratedFacesJS.class +0 -0
  129. package/target/classes/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.class +0 -0
  130. package/target/classes/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.class +0 -0
  131. package/target/classes/com/example/jsfs_js_ts/FacesJSMappingDecorator.class +0 -0
  132. package/target/impl/AjaxImpl.js +85 -93
  133. package/target/impl/AjaxImpl.js.map +1 -1
  134. package/target/impl/PushImpl.js +63 -64
  135. package/target/impl/PushImpl.js.map +1 -1
  136. package/target/impl/core/Const.js +38 -19
  137. package/target/impl/core/Const.js.map +1 -1
  138. package/target/impl/core/ImplTypes.js +10 -15
  139. package/target/impl/core/ImplTypes.js.map +1 -1
  140. package/target/impl/i18n/Messages.js +5 -6
  141. package/target/impl/i18n/Messages.js.map +1 -1
  142. package/target/impl/util/Assertions.js +12 -21
  143. package/target/impl/util/Assertions.js.map +1 -1
  144. package/target/impl/util/AsyncQueue.js +28 -36
  145. package/target/impl/util/AsyncQueue.js.map +1 -1
  146. package/target/impl/util/AsyncRunnable.js +1 -1
  147. package/target/impl/util/ExtDomQuery.js +235 -138
  148. package/target/impl/util/ExtDomQuery.js.map +1 -1
  149. package/target/impl/util/Lang.js +43 -50
  150. package/target/impl/util/Lang.js.map +1 -1
  151. package/target/impl/xhrCore/ErrorData.js +37 -62
  152. package/target/impl/xhrCore/ErrorData.js.map +1 -1
  153. package/target/impl/xhrCore/EventData.js +12 -14
  154. package/target/impl/xhrCore/EventData.js.map +1 -1
  155. package/target/impl/xhrCore/RequestDataResolver.js +27 -29
  156. package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
  157. package/target/impl/xhrCore/ResonseDataResolver.js +25 -23
  158. package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
  159. package/target/impl/xhrCore/Response.js +40 -36
  160. package/target/impl/xhrCore/Response.js.map +1 -1
  161. package/target/impl/xhrCore/ResponseProcessor.js +165 -167
  162. package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
  163. package/target/impl/xhrCore/XhrFormData.js +75 -103
  164. package/target/impl/xhrCore/XhrFormData.js.map +1 -1
  165. package/target/impl/xhrCore/XhrRequest.js +160 -145
  166. package/target/impl/xhrCore/XhrRequest.js.map +1 -1
  167. package/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +4 -0
  168. package/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +4 -0
  169. package/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst +1 -0
  170. package/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst +1 -0
  171. package/target/myfaces/OamSubmit.js +63 -74
  172. package/target/myfaces/OamSubmit.js.map +1 -1
  173. package/target/surefire-reports/TEST-com.example.jsfs_js_ts.JsfsJsTsApplicationTests.xml +78 -0
  174. package/target/surefire-reports/com.example.jsfs_js_ts.JsfsJsTsApplicationTests.txt +7 -0
  175. package/target/test/frameworkBase/LangTest.spec.js +46 -32
  176. package/target/test/frameworkBase/LangTest.spec.js.map +1 -1
  177. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +372 -111
  178. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
  179. package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js +46 -32
  180. package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +1 -1
  181. package/target/test/frameworkBase/_ext/monadish/MappingProbes.js +25 -34
  182. package/target/test/frameworkBase/_ext/monadish/MappingProbes.js.map +1 -1
  183. package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js +9 -9
  184. package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +1 -1
  185. package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +32 -37
  186. package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +1 -1
  187. package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js +51 -49
  188. package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js.map +1 -1
  189. package/target/test/frameworkBase/_ext/shared/StandardInits.js +300 -121
  190. package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
  191. package/target/test/frameworkBase/_ext/shared/XmlResponses.js +199 -18
  192. package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
  193. package/target/test/impl/ImplTest.spec.js +68 -33
  194. package/target/test/impl/ImplTest.spec.js.map +1 -1
  195. package/target/test/impl/ImplTest_23.spec.js +133 -0
  196. package/target/test/impl/ImplTest_23.spec.js.map +1 -0
  197. package/target/test/impl/SeparatorCharsTest.spec.js +45 -21
  198. package/target/test/impl/SeparatorCharsTest.spec.js.map +1 -1
  199. package/target/test/myfaces/OamSubmit.spec.js +90 -18
  200. package/target/test/myfaces/OamSubmit.spec.js.map +1 -1
  201. package/target/test/queue/AsynchronousProbe.js +24 -30
  202. package/target/test/queue/AsynchronousProbe.js.map +1 -1
  203. package/target/test/queue/AsynchronousQueueTest.spec.js +63 -71
  204. package/target/test/queue/AsynchronousQueueTest.spec.js.map +1 -1
  205. package/target/test/xhrCore/EventTests.spec.js +70 -83
  206. package/target/test/xhrCore/EventTests.spec.js.map +1 -1
  207. package/target/test/xhrCore/FakeWebsocket.js +15 -17
  208. package/target/test/xhrCore/FakeWebsocket.js.map +1 -1
  209. package/target/test/xhrCore/FileUploadTest.spec.js +73 -91
  210. package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
  211. package/target/test/xhrCore/RequestParamsTest.spec.js +72 -98
  212. package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
  213. package/target/test/xhrCore/RequestTest.spec.js +107 -120
  214. package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
  215. package/target/test/{typescript/xhrCore/RequestTest.js → xhrCore/RequestTest_23.spec.js} +142 -127
  216. package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -0
  217. package/target/test/xhrCore/ResponseTest.spec.js +206 -105
  218. package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
  219. package/target/test/xhrCore/ResponseTest23.spec.js +312 -0
  220. package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -0
  221. package/target/test/xhrCore/ShadowDomTest.spec.js +56 -66
  222. package/target/test/xhrCore/ShadowDomTest.spec.js.map +1 -1
  223. package/target/test/xhrCore/WebsocketTest.js +87 -97
  224. package/target/test/xhrCore/WebsocketTest.js.map +1 -1
  225. package/target/test/xhrCore/XhrFormDataTest.spec.js +65 -16
  226. package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
  227. package/target/test-classes/jsf-development.js +452 -3674
  228. package/target/test-classes/jsf.js +1 -1
  229. package/target/test-classes/jsf.js.br +0 -0
  230. package/target/test-classes/jsf.js.gz +0 -0
  231. package/webpack.config.js +7 -4
  232. package/webpack.config.js.map +1 -1
  233. package/webpack.config.ts +23 -4
  234. package/dist/docs/modules/jsf.html +0 -71
  235. package/dist/docs/variables/jsf.specversion.html +0 -52
  236. package/integrationdeploy.cmd +0 -4
  237. package/integrationsdeploy.sh +0 -5
  238. package/remap.js +0 -44
  239. package/remap.js.map +0 -1
  240. package/src/main/java/com/example/jsfs_js_ts/JsfsJsTsApplication.java +0 -12
  241. package/src/main/types/typedefs.d.ts +0 -66
  242. package/target/api/Jsf.js.map +0 -1
  243. package/target/classes/com/example/jsfs_js_ts/JsfsJsTsApplication.class +0 -0
  244. package/target/impl/util/ListenerQueue.js +0 -3
  245. package/target/impl/util/ListenerQueue.js.map +0 -1
  246. package/target/main/typescript/api/Jsf.js +0 -258
  247. package/target/main/typescript/api/Jsf.js.map +0 -1
  248. package/target/main/typescript/impl/AjaxImpl.js +0 -569
  249. package/target/main/typescript/impl/AjaxImpl.js.map +0 -1
  250. package/target/main/typescript/impl/PushImpl.js +0 -215
  251. package/target/main/typescript/impl/PushImpl.js.map +0 -1
  252. package/target/main/typescript/impl/core/Const.js +0 -135
  253. package/target/main/typescript/impl/core/Const.js.map +0 -1
  254. package/target/main/typescript/impl/core/ImplTypes.js +0 -43
  255. package/target/main/typescript/impl/core/ImplTypes.js.map +0 -1
  256. package/target/main/typescript/impl/i18n/Messages.js +0 -114
  257. package/target/main/typescript/impl/i18n/Messages.js.map +0 -1
  258. package/target/main/typescript/impl/util/Assertions.js +0 -90
  259. package/target/main/typescript/impl/util/Assertions.js.map +0 -1
  260. package/target/main/typescript/impl/util/AsyncQueue.js +0 -104
  261. package/target/main/typescript/impl/util/AsyncQueue.js.map +0 -1
  262. package/target/main/typescript/impl/util/AsyncRunnable.js.map +0 -1
  263. package/target/main/typescript/impl/util/ExtDomQuery.js +0 -129
  264. package/target/main/typescript/impl/util/ExtDomQuery.js.map +0 -1
  265. package/target/main/typescript/impl/util/Lang.js +0 -215
  266. package/target/main/typescript/impl/util/Lang.js.map +0 -1
  267. package/target/main/typescript/impl/util/ListenerQueue.js +0 -3
  268. package/target/main/typescript/impl/util/ListenerQueue.js.map +0 -1
  269. package/target/main/typescript/impl/xhrCore/ErrorData.js +0 -89
  270. package/target/main/typescript/impl/xhrCore/ErrorData.js.map +0 -1
  271. package/target/main/typescript/impl/xhrCore/EventData.js +0 -30
  272. package/target/main/typescript/impl/xhrCore/EventData.js.map +0 -1
  273. package/target/main/typescript/impl/xhrCore/IResponseProcessor.js +0 -3
  274. package/target/main/typescript/impl/xhrCore/IResponseProcessor.js.map +0 -1
  275. package/target/main/typescript/impl/xhrCore/RequestDataResolver.js +0 -143
  276. package/target/main/typescript/impl/xhrCore/RequestDataResolver.js.map +0 -1
  277. package/target/main/typescript/impl/xhrCore/ResonseDataResolver.js +0 -103
  278. package/target/main/typescript/impl/xhrCore/ResonseDataResolver.js.map +0 -1
  279. package/target/main/typescript/impl/xhrCore/Response.js +0 -167
  280. package/target/main/typescript/impl/xhrCore/Response.js.map +0 -1
  281. package/target/main/typescript/impl/xhrCore/ResponseProcessor.js +0 -368
  282. package/target/main/typescript/impl/xhrCore/ResponseProcessor.js.map +0 -1
  283. package/target/main/typescript/impl/xhrCore/XhrFormData.js +0 -272
  284. package/target/main/typescript/impl/xhrCore/XhrFormData.js.map +0 -1
  285. package/target/main/typescript/impl/xhrCore/XhrRequest.js +0 -281
  286. package/target/main/typescript/impl/xhrCore/XhrRequest.js.map +0 -1
  287. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.js +0 -293
  288. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.js.map +0 -1
  289. package/target/test/frameworkBase/_ext/monadish/LangTest.js +0 -89
  290. package/target/test/frameworkBase/_ext/monadish/LangTest.js.map +0 -1
  291. package/target/test/frameworkBase/_ext/monadish/MappingTest.js +0 -39
  292. package/target/test/frameworkBase/_ext/monadish/MappingTest.js.map +0 -1
  293. package/target/test/frameworkBase/_ext/monadish/MonadTest.js +0 -155
  294. package/target/test/frameworkBase/_ext/monadish/MonadTest.js.map +0 -1
  295. package/target/test/frameworkBase/_ext/monadish/StreamTest.js +0 -176
  296. package/target/test/frameworkBase/_ext/monadish/StreamTest.js.map +0 -1
  297. package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.js +0 -1
  298. package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.js.map +0 -1
  299. package/target/test/typescript/frameworkBase/LangTest.js +0 -112
  300. package/target/test/typescript/frameworkBase/LangTest.js.map +0 -1
  301. package/target/test/typescript/frameworkBase/_ext/monadish/DomQueryTest.js +0 -293
  302. package/target/test/typescript/frameworkBase/_ext/monadish/DomQueryTest.js.map +0 -1
  303. package/target/test/typescript/frameworkBase/_ext/monadish/LangTest.js +0 -89
  304. package/target/test/typescript/frameworkBase/_ext/monadish/LangTest.js.map +0 -1
  305. package/target/test/typescript/frameworkBase/_ext/monadish/MappingProbes.js +0 -115
  306. package/target/test/typescript/frameworkBase/_ext/monadish/MappingProbes.js.map +0 -1
  307. package/target/test/typescript/frameworkBase/_ext/monadish/MappingTest.js +0 -39
  308. package/target/test/typescript/frameworkBase/_ext/monadish/MappingTest.js.map +0 -1
  309. package/target/test/typescript/frameworkBase/_ext/monadish/MonadTest.js +0 -155
  310. package/target/test/typescript/frameworkBase/_ext/monadish/MonadTest.js.map +0 -1
  311. package/target/test/typescript/frameworkBase/_ext/monadish/StreamTest.js +0 -176
  312. package/target/test/typescript/frameworkBase/_ext/monadish/StreamTest.js.map +0 -1
  313. package/target/test/typescript/frameworkBase/_ext/monadish/XmlQueryTest.js +0 -1
  314. package/target/test/typescript/frameworkBase/_ext/monadish/XmlQueryTest.js.map +0 -1
  315. package/target/test/typescript/frameworkBase/_ext/shared/StandardInits.js +0 -264
  316. package/target/test/typescript/frameworkBase/_ext/shared/StandardInits.js.map +0 -1
  317. package/target/test/typescript/frameworkBase/_ext/shared/XmlResponses.js +0 -23
  318. package/target/test/typescript/frameworkBase/_ext/shared/XmlResponses.js.map +0 -1
  319. package/target/test/typescript/impl/ImplTest.js +0 -98
  320. package/target/test/typescript/impl/ImplTest.js.map +0 -1
  321. package/target/test/typescript/impl/SeparatorCharsTest.js +0 -72
  322. package/target/test/typescript/impl/SeparatorCharsTest.js.map +0 -1
  323. package/target/test/typescript/queue/AsynchronousProbe.js +0 -99
  324. package/target/test/typescript/queue/AsynchronousProbe.js.map +0 -1
  325. package/target/test/typescript/queue/AsynchronousQueueTest.js +0 -130
  326. package/target/test/typescript/queue/AsynchronousQueueTest.js.map +0 -1
  327. package/target/test/typescript/xhrCore/EventTests.js +0 -155
  328. package/target/test/typescript/xhrCore/EventTests.js.map +0 -1
  329. package/target/test/typescript/xhrCore/FakeWebsocket.js +0 -25
  330. package/target/test/typescript/xhrCore/FakeWebsocket.js.map +0 -1
  331. package/target/test/typescript/xhrCore/FileUploadTest.js +0 -166
  332. package/target/test/typescript/xhrCore/FileUploadTest.js.map +0 -1
  333. package/target/test/typescript/xhrCore/RequestParamsTest.js +0 -151
  334. package/target/test/typescript/xhrCore/RequestParamsTest.js.map +0 -1
  335. package/target/test/typescript/xhrCore/RequestTest.js.map +0 -1
  336. package/target/test/typescript/xhrCore/ResponseTest.js +0 -257
  337. package/target/test/typescript/xhrCore/ResponseTest.js.map +0 -1
  338. package/target/test/typescript/xhrCore/ShadowDomTest.js +0 -122
  339. package/target/test/typescript/xhrCore/ShadowDomTest.js.map +0 -1
  340. package/target/test/typescript/xhrCore/WebsocketTest.js +0 -182
  341. package/target/test/typescript/xhrCore/WebsocketTest.js.map +0 -1
  342. package/target/test/typescript/xhrCore/XhrFormDataTest.js +0 -58
  343. package/target/test/typescript/xhrCore/XhrFormDataTest.js.map +0 -1
@@ -1,4 +1,4 @@
1
- /* Licensed to the Apache Software Foundation (ASF) under one or more
1
+ /*! Licensed to the Apache Software Foundation (ASF) under one or more
2
2
  * contributor license agreements. See the NOTICE file distributed with
3
3
  * this work for additional information regarding copyright ownership.
4
4
  * The ASF licenses this file to you under the Apache License, Version 2.0
@@ -17,7 +17,9 @@
17
17
 
18
18
  import {DomQuery} from "mona-dish";
19
19
 
20
+
20
21
  declare let global;
22
+ declare let faces: any;
21
23
  declare let jsf: any;
22
24
  declare let myfaces: any;
23
25
 
@@ -60,7 +62,7 @@ export module StandardInits {
60
62
  <body>
61
63
  <form id="blarg">
62
64
  <input type="text" id="blarg:input_1" name="blarg:input_1" value="input_1_val"></input>
63
- <input type="hidden" id="javax.faces.ViewState" name="javax.faces.ViewState" value="blubbblubblubb"></input>
65
+ <input type="hidden" id="jakarta.faces.ViewState" name="jakarta.faces.ViewState" value="blubbblubblubb"></input>
64
66
  <input type="button" id="blarg:input_2" name="blarg:input_2" value="input_1_val"></input>
65
67
  <div id="shadowDomArea">
66
68
  <input type="button" id="blarg:input_3" name="blarg:input_3" value="input_3_val"></input>
@@ -70,7 +72,7 @@ export module StandardInits {
70
72
  </html>`;
71
73
 
72
74
  /**
73
- * a page simulating basically a simple jsf form
75
+ * a page simulating basically a simple faces form
74
76
  */
75
77
  const HTML_FORM_DEFAULT = `<!DOCTYPE html>
76
78
  <html lang="en">
@@ -81,14 +83,16 @@ export module StandardInits {
81
83
  <body>
82
84
  <form id="blarg">
83
85
  <input type="text" id="input_1" name="input_1" value="input_1_val"></input>
84
- <input type="hidden" id="javax.faces.ViewState" name="javax.faces.ViewState" value="blubbblubblubb"></input>
86
+ <input type="hidden" id="jakarta.faces.ViewState" name="jakarta.faces.ViewState" value="blubbblubblubb"></input>
85
87
  <input type="button" id="input_2" name="input_2" value="input_1_val"></input>
86
88
  </form>
87
89
  </body>
88
90
  </html>`;
89
91
 
92
+
93
+
90
94
  /**
91
- * a page simulating basically a simple jsf form
95
+ * a page simulating basically a simple faces form
92
96
  */
93
97
  const HTML_FILE_FORM_DEFAULT = `<!DOCTYPE html>
94
98
  <html lang="en">
@@ -100,7 +104,7 @@ export module StandardInits {
100
104
  <form id="blarg" enctype="multipart/form-data">
101
105
  <input type="file" id="fíleupload"></input>
102
106
  <input type="text" id="input_1" name="input_1" value="input_1_val"></input>
103
- <input type="hidden" id="javax.faces.ViewState" name="javax.faces.ViewState" value="blubbblubblubb"></input>
107
+ <input type="hidden" id="jakarta.faces.ViewState" name="jakarta.faces.ViewState" value="blubbblubblubb"></input>
104
108
  <input type="button" id="input_2" name="input_2" value="input_1_val"></input>
105
109
  </form>
106
110
  </body>
@@ -108,21 +112,21 @@ export module StandardInits {
108
112
 
109
113
 
110
114
 
111
- export const STD_XML = `<?xml version="1.0" encoding="utf-8"?><partial-response><changes><update id="value_1"><![CDATA[<span id="out1">2</span>]]></update><update id="javax.faces.ViewState"><![CDATA[j_id1:j_id3]]></update></changes></partial-response>`;
115
+ export const STD_XML = `<?xml version="1.0" encoding="utf-8"?><partial-response><changes><update id="value_1"><![CDATA[<span id="out1">2</span>]]></update><update id="jakarta.faces.ViewState"><![CDATA[j_id1:j_id3]]></update></changes></partial-response>`;
112
116
 
113
117
  /**
114
- * a page containing a jsf.js input with a new separator char
118
+ * a page containing a faces.js input with a new separator char
115
119
  * @param separatorChar
116
120
  * @constructor
117
121
  */
118
- function HTML_DEFAULT_SEPARATOR_CHAR(separatorChar: string) {
122
+ function HTML_DEFAULT_SEPARATOR_CHAR(separatorChar: string, IS_40=true) {
119
123
  return `<!DOCTYPE html>
120
124
  <html lang="en">
121
125
  <head>
122
126
  <meta charset="UTF-8">
123
127
  <title>Title</title>
124
128
  <script type="text/javascript"
125
- src="/wfmportal/javax.faces.resource/jsf.js.jsf?ln=javax.faces&separator=${separatorChar}"></script>
129
+ src="/wfmportal/${IS_40 ? 'jakarta' : 'javax'}.faces.resource/${IS_40 ? 'faces': 'jsf'}.js.jsf?ln=jakarta.faces&separator=${separatorChar}"></script>
126
130
  </head>
127
131
  <body>
128
132
  <form id="blarg">
@@ -140,7 +144,7 @@ export module StandardInits {
140
144
  * testing the various aspects of the protocol
141
145
  * under pure html conditions
142
146
  *
143
- * We get the jsf out of the way and bascially simulate what the browser sees
147
+ * We get the jsf out of the way and basically simulate what the browser sees
144
148
  */
145
149
  export const PROTOCOL_PAGE = `<!DOCTYPE html>
146
150
  <html lang="en">
@@ -175,21 +179,33 @@ export module StandardInits {
175
179
 
176
180
  <div id="attributeChange">attributes changes area</div>
177
181
 
178
-
179
-
182
+ <div id="resource_area_1"></div>
183
+ <div id="resource_area_2"></div>
184
+ <div id="resource_area_3"></div>
185
+ <div id="nonce_result"></div>
186
+
180
187
  </div>
181
188
 
182
189
  <h2>Call actions via normal ppr</h2>
183
190
 
184
191
  <form id="form1" action="boog.html">
185
192
 
186
- <input type="hidden" id="javax.faces.ViewState" name="javax.faces.ViewState" value="blubbblubblubb"></input>
193
+ <input type="hidden" id="jakarta.faces.ViewState" name="jakarta.faces.ViewState" value="blubbblubblubb"></input>
187
194
 
188
195
  <input type="button" id="cmd_eval" value="eval"
189
196
  onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'eval1');"/>
190
197
 
191
198
  <input type="button" id="cmd_update_insert" value="update insert"
192
199
  onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'updateinsert1');"/>
200
+
201
+ <input type="button" id="cmd_simple_resource" value="simple resource"
202
+ onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'simpleresource');"/>
203
+
204
+ <input type="button" id="cmd_complex_resource" value="complex resource"
205
+ onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'complex_resource');"/>
206
+
207
+ <input type="button" id="cmd_complex_resource2" value="complex resource2"
208
+ onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'complex_resource2');"/>
193
209
 
194
210
  <input type="button" id="cmd_update_insert2" value="update insert second protocol path"
195
211
  onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'updateinsert2');"/>
@@ -213,7 +229,7 @@ export module StandardInits {
213
229
  onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'errors');"/>
214
230
 
215
231
  <input type="button" id="cmd_error_component" value="Error: no component given"
216
- onclick="jsf.ajax.request(null, event, {}); return false"/>
232
+ onclick="(window.faces || window.jsf).ajax.request(null, event, {}); return false"/>
217
233
 
218
234
  </form>
219
235
 
@@ -223,11 +239,9 @@ export module StandardInits {
223
239
  var target = "./test.mockup";
224
240
 
225
241
  function emitPPR(source, event, action, useIframe, formName) {
226
- debugger;
227
- console.debug("emitting;");
228
242
  document.getElementById(formName || "form1").action = target;
229
243
 
230
- jsf.ajax.request(/*String|Dom Node*/ source, /*|EVENT|*/ (window.event) ? window.event : event, /*{|OPTIONS|}*/ {op: action});
244
+ (window?.faces ?? window.jsf).ajax.request(/*String|Dom Node*/ source, /*|EVENT|*/ (window.event) ? window.event : event, /*{|OPTIONS|}*/ {op: action});
231
245
  }
232
246
  </script>
233
247
  </div>
@@ -256,13 +270,22 @@ export module StandardInits {
256
270
  export function defaultHtml(withJsf = true): Promise<() => void> {
257
271
  return init(HTML_DEFAULT, withJsf);
258
272
  }
273
+ export function defaultHtml_23(withJsf = true): Promise<() => void> {
274
+ return init(HTML_DEFAULT.replace(/jakarta/gi, "javax"), withJsf, false);
275
+ }
259
276
 
260
277
  export function defaultMyFaces(withJsf = true): Promise<() => void> {
261
278
  return init(HTML_FORM_DEFAULT, withJsf);
262
279
  }
280
+ export function defaultMyFaces23(withJsf = true): Promise<() => void> {
281
+ return init(HTML_FORM_DEFAULT.replace(/jakarta/gi, "javax"), withJsf, false);
282
+ }
263
283
  export function defaultFileForm(withJsf = true): Promise<() => void> {
264
284
  return init(HTML_FILE_FORM_DEFAULT, withJsf);
265
285
  }
286
+ export function defaultFileForm_23(withJsf = true): Promise<() => void> {
287
+ return init(HTML_FILE_FORM_DEFAULT.replace(/jakarta/gi, "javax"), withJsf, false);
288
+ }
266
289
 
267
290
  export function shadowDomMyFaces(withJsf = true): Promise<() => void> {
268
291
  return <Promise<() => void>>init(HTML_SHADOW, withJsf).then((close) => {
@@ -275,12 +298,12 @@ export module StandardInits {
275
298
  });
276
299
  }
277
300
 
278
- export function protocolPage(withJsf = true): Promise<() => void> {
279
- return <any>init(PROTOCOL_PAGE, withJsf);
301
+ export function protocolPage(withJsf = true, IS_40 = true): Promise<() => void> {
302
+ return <any>init((IS_40) ? PROTOCOL_PAGE : PROTOCOL_PAGE.replace(/jakarta/gi,"javax"), withJsf, IS_40);
280
303
  }
281
304
 
282
- export function defaultSeparatorChar(separatorChar: string, withJsf = true): Promise<() => void> {
283
- let template = HTML_DEFAULT_SEPARATOR_CHAR(separatorChar);
305
+ export function defaultSeparatorChar(separatorChar: string, withJsf = true, IS_40 = true): Promise<() => void> {
306
+ let template = HTML_DEFAULT_SEPARATOR_CHAR(separatorChar, IS_40);
284
307
  return init(template, withJsf);
285
308
  }
286
309
 
@@ -298,17 +321,31 @@ export module StandardInits {
298
321
  * @param Implementation
299
322
  */
300
323
  let applyJsfToGlobals = function (data, Implementation, PushImpl) {
324
+ (<any>global).faces = data.faces;
325
+ (<any>global).myfaces = data.myfaces;
326
+ (<any>global).window.faces = data.faces;
327
+ (<any>global).window.myfaces = data.myfaces;
328
+ (<any>global).Implementation = Implementation.Implementation;
329
+ (<any>global).PushImpl = PushImpl.PushImpl;
330
+ //bypass a bug on windows jsdom, domparser not an auto global but on window only
331
+ (<any>global).DOMParser = (<any>global)?.DOMParser ?? window.DOMParser;
332
+ (<any>global).document = (<any>global)?.document ?? window.document;
333
+ };
334
+
335
+ let applyJsfToGlobals23 = function (data, Implementation, PushImpl) {
301
336
  (<any>global).jsf = data.jsf;
302
337
  (<any>global).myfaces = data.myfaces;
303
338
  (<any>global).window.jsf = data.jsf;
304
339
  (<any>global).window.myfaces = data.myfaces;
305
340
  (<any>global).Implementation = Implementation.Implementation;
341
+ (<any>global).window.Implementation = Implementation.Implementation;
306
342
  (<any>global).PushImpl = PushImpl.PushImpl;
307
343
  //bypass a bug on windows jsdom, domparser not an auto global but on window only
308
344
  (<any>global).DOMParser = (<any>global)?.DOMParser ?? window.DOMParser;
309
345
  (<any>global).document = (<any>global)?.document ?? window.document;
310
346
  };
311
347
 
348
+
312
349
  /**
313
350
  * init the jsdom global
314
351
  * @param clean
@@ -317,22 +354,29 @@ export module StandardInits {
317
354
  let initJSDOM = async function (template: string) {
318
355
  // @ts-ignore
319
356
  return import('jsdom-global').then((domIt) => {
320
- return domIt(template, {
357
+ let params = {
321
358
  contentType: "text/html",
322
- runScripts: "dangerously"
323
- });
359
+ runScripts: "dangerously",
360
+ resources: "usable",
361
+ url: `file://${__dirname}/index.html`
362
+ };
363
+ //we have two different apis depending whether we allow module interop with sinon or not
364
+ return (domIt?.default ?? domIt)?.(template, params) ;
324
365
  });
325
366
  };
326
367
 
327
368
  /**
328
369
  * init the jsf subsystem
329
370
  */
330
- let initJSF = async function () {
371
+ let initJSF = async function (IS_40: boolean = true) {
331
372
  // @ts-ignore
332
- return import("../../../../api/Jsf").then((data) => {
373
+
374
+ const facesImport = IS_40 ? import("../../../../api/faces") : import("../../../../api/jsf");
375
+
376
+ return facesImport.then((data) => {
333
377
  let Implementation = require("../../../../impl/AjaxImpl");
334
378
  let PushImpl = require("../../../../impl/PushImpl");
335
- applyJsfToGlobals(data, Implementation, PushImpl);
379
+ IS_40 ? applyJsfToGlobals(data, Implementation, PushImpl): applyJsfToGlobals23(data, Implementation, PushImpl);
336
380
  }).catch(err => {
337
381
  console.error(err);
338
382
  });
@@ -345,9 +389,10 @@ export module StandardInits {
345
389
  (<any>global)?.Implementation?.reset();
346
390
  (<any>global)?.PushImpl?.reset();
347
391
 
348
- delete (<any>global).jsf;
392
+ ((<any>global).faces) ? delete (<any>global).faces : null;
393
+ ((<any>global).jsf) ? delete (<any>global).jsf : null;
349
394
  delete (<any>global).myfaces;
350
- delete (<any>global).Implementation;
395
+ ((<any>global).Implementation) ? delete (<any>global).Implementation : null;
351
396
  delete (<any>global).PushImpl;
352
397
  };
353
398
 
@@ -357,7 +402,7 @@ export module StandardInits {
357
402
  * @param template
358
403
  * @param withJsf
359
404
  */
360
- async function init(template: string, withJsf = true): Promise<() => void> {
405
+ async function init(template: string, withJsf = true, IS_JSF_40 = true): Promise<() => void> {
361
406
  //let dom2 = new JSDOM(template)
362
407
  //return initMyFacesFromDom(dom2);
363
408
  let clean = null;
@@ -368,11 +413,11 @@ export module StandardInits {
368
413
  resetGlobals();
369
414
  // @ts-ignore
370
415
  await initJSDOM(template).then(data => clean = data);
371
- await initJSF();
416
+ await initJSF(IS_JSF_40);
372
417
  } else {
373
418
  // @ts-ignore
374
419
  await import('jsdom-global').then((domIt) => {
375
- clean = domIt(template);
420
+ clean = (domIt?.default ?? domIt)?.(template);
376
421
  });
377
422
  }
378
423
  //the async is returning a promise on the caller level
@@ -59,7 +59,7 @@ export class XmlResponses {
59
59
  static VIEWSTATE_1 = `
60
60
  <partial-response>
61
61
  <changes>
62
- <update id="javax.faces.ViewState"><![CDATA[hello world]]></update>
62
+ <update id="jakarta.faces.ViewState"><![CDATA[hello world]]></update>
63
63
  </changes>
64
64
  </partial-response>
65
65
  `;
@@ -94,7 +94,7 @@ export class XmlResponses {
94
94
 
95
95
  static BODY_REPLACEMENT = `<partial-response>
96
96
  <changes>
97
- <update id="javax.faces.ViewBody"><![CDATA[
97
+ <update id="jakarta.faces.ViewBody"><![CDATA[
98
98
  <body id="the_id" class="tundra">
99
99
  <div id='centerDiv'>
100
100
  <h1>Test for body change done</h1>
@@ -121,7 +121,7 @@ export class XmlResponses {
121
121
 
122
122
  static HEAD_REPLACEMENT = `<partial-response>
123
123
  <changes>
124
- <update id="javax.faces.ViewHead"><![CDATA[
124
+ <update id="jakarta.faces.ViewHead"><![CDATA[
125
125
  <head>
126
126
  <meta blarg="blarg2"></meta>
127
127
  <script type='text/javascript'>
@@ -137,7 +137,7 @@ export class XmlResponses {
137
137
 
138
138
  static VIEW_ROOT_REPLACEMENT = `<partial-response>
139
139
  <changes>
140
- <update id="javax.faces.ViewRoot"><![CDATA[
140
+ <update id="jakarta.faces.ViewRoot"><![CDATA[
141
141
  <html>
142
142
  <head>
143
143
  <meta blarg="blarg2"></meta>
@@ -170,5 +170,45 @@ export class XmlResponses {
170
170
  </partial-response>
171
171
  `;
172
172
 
173
+ static SIMPLE_RESOURCE_RESPONSE = `
174
+ <partial-response>
175
+ <changes>
176
+ <update id="jakarta.faces.Resource">
177
+ <![CDATA[<script src="../../../xhrCore/fixtures/addedViewHead1.js"></script>]]>
178
+ </update>
179
+ </changes>
180
+ </partial-response>
181
+ `;
182
+ static MULTIPLE_RESOURCE_RESPONSE = `
183
+ <partial-response id="j_id__v_0"><changes><update id="jakarta.faces.Resource">
184
+ <![CDATA[
185
+ <script src="../../../xhrCore/fixtures/addedViewHead2.js"></script>
186
+ <style type="text/css" rel="../../../xhrCore/fixtures/addedViewHead2.css"></style>
187
+ ]]>
188
+ </update>
189
+ </changes>
190
+ </partial-response>
191
+ `
192
+
193
+ static EMBEDDED_SCRIPTS_RESOURCE_RESPONSE = `
194
+ <partial-response id="j_id__v_0"><changes><update id="jakarta.faces.Resource">
195
+ <![CDATA[
196
+ <script src="../../../xhrCore/fixtures/addedViewHead3.js"></script>
197
+ <style type="text/css" rel="../../../xhrCore/fixtures/addedViewHead2.css"></style>
198
+ <script type="text/javascript">
199
+ document.getElementById('resource_area_1').innerHTML = 'booga';
200
+ </script>
201
+ ]]>
202
+ </update>
203
+ </changes>
204
+ </partial-response>
205
+ `
206
+
207
+ static NONCE_REPLY = `
208
+ <partial-response><changes><update id='nonce_result'>
209
+ <![CDATA[<script nonce='test12d3' type='text/javascript' src='http://foobaz/nonce_script.js'></script>]]>
210
+ </update></changes></partial-response>
211
+ `;
212
+
173
213
  static ILLEGAL_RESP = `>>>> xxxx >YYYY-!->>>`;
174
214
  }
@@ -1,4 +1,4 @@
1
- /* Licensed to the Apache Software Foundation (ASF) under one or more
1
+ /*! Licensed to the Apache Software Foundation (ASF) under one or more
2
2
  * contributor license agreements. See the NOTICE file distributed with
3
3
  * this work for additional information regarding copyright ownership.
4
4
  * The ASF licenses this file to you under the Apache License, Version 2.0
@@ -14,54 +14,50 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import {Config} from "mona-dish";
17
+ import {Config, DomQuery} from "mona-dish";
18
18
  import {describe, it} from 'mocha';
19
19
  import {expect} from 'chai';
20
20
  import * as sinon from 'sinon';
21
21
 
22
- import {DomQuery} from "mona-dish";
23
-
24
22
  import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
25
- import defaultMyFaces = StandardInits.defaultMyFaces;
26
23
  import {P_EXECUTE, P_RENDER} from "../../impl/core/Const";
24
+ import defaultMyFaces = StandardInits.defaultMyFaces;
25
+
27
26
 
28
27
  sinon.reset();
29
28
 
30
- declare var jsf: any;
29
+ declare var faces: any;
31
30
  declare var Implementation: any;
32
31
 
33
32
  /**
34
- * testing the jsf.ajax.request api without triggering any
33
+ * testing the faces.ajax.request api without triggering any
35
34
  * xhr request...
36
35
  * the idea is to shim the code which triggers the request out and check what is going in
37
36
  * and what is coming out
38
37
  */
39
38
 
40
- describe('jsf.ajax.request test suite', () => {
39
+ describe('faces.ajax.request test suite', () => {
41
40
 
42
- beforeEach(() => {
43
- return defaultMyFaces();
41
+ beforeEach(async () => {
42
+ return await defaultMyFaces();
44
43
  });
45
44
 
46
- it("jsf.ajax.request can be called", () => {
45
+ it("faces.ajax.request can be called", () => {
47
46
  //we stub the addRequestToQueue, to enable the request check only
48
47
  //without any xhr and response, both will be tested separately for
49
48
  //proper behavior
50
- const Impl = Implementation;
51
- const addRequestToQueue = sinon.stub(Impl.queueHandler, "addRequestToQueue");
52
- //now the jsf.ajax.request should trigger but should not go into
49
+ const addRequestToQueue = sinon.stub(Implementation.queueHandler, "addRequestToQueue");
50
+ //now the faces.ajax.request should trigger but should not go into
53
51
  //the asynchronous event loop.
54
52
  //lets check it out
55
53
 
56
54
  try {
57
55
  DomQuery.byId("input_2").addEventListener("click", (event: Event) => {
58
- jsf.ajax.request(null, event, {render: '@all', execute: '@form'})
56
+ faces.ajax.request(null, event, {render: '@all', execute: '@form'})
59
57
  }).click();
60
58
 
61
59
  expect(addRequestToQueue.called).to.be.true;
62
60
  expect(addRequestToQueue.callCount).to.eq(1);
63
-
64
- const argElement = <Config>addRequestToQueue.args[0][2];
65
61
  const context = (<Config>addRequestToQueue.args[0][2]);
66
62
 
67
63
  expect(context.getIf("passThrgh", P_RENDER).value).eq("@all");
@@ -74,14 +70,14 @@ describe('jsf.ajax.request test suite', () => {
74
70
 
75
71
  });
76
72
 
77
- it("jsf.ajax.request passthroughs must end up in passthrough", (done) => {
73
+ it("faces.ajax.request passthroughs must end up in passthrough", (done) => {
78
74
  //TODO implementation
79
75
  done();
80
76
  });
81
77
 
82
- it("jsf.util.chain must work", () => {
78
+ it("faces.util.chain must work", () => {
83
79
  let called = {};
84
- (<any>window).called = called;
80
+ window.called = called;
85
81
 
86
82
  let func1 = () => {
87
83
  called["func1"] = true;
@@ -108,7 +104,7 @@ describe('jsf.ajax.request test suite', () => {
108
104
  return false;
109
105
  };
110
106
 
111
- jsf.util.chain(this, called, func1, func2, func3, func4, func5);
107
+ faces.util.chain(this, called, func1, func2, func3, func4, func5);
112
108
 
113
109
  expect(called["func1"]).to.be.true;
114
110
  expect(called["func2"]).to.be.true;
@@ -117,7 +113,7 @@ describe('jsf.ajax.request test suite', () => {
117
113
  expect(!!called["func5"]).to.be.false;
118
114
 
119
115
  called = {};
120
- jsf.util.chain(this, called, func1, func2, func4, func5);
116
+ faces.util.chain(this, called, func1, func2, func4, func5);
121
117
  expect(called["func1"]).to.be.true;
122
118
  expect(called["func2"]).to.be.true;
123
119
  expect(!!called["func4"]).to.be.true;
@@ -0,0 +1,129 @@
1
+ /*! Licensed to the Apache Software Foundation (ASF) under one or more
2
+ * contributor license agreements. See the NOTICE file distributed with
3
+ * this work for additional information regarding copyright ownership.
4
+ * The ASF licenses this file to you under the Apache License, Version 2.0
5
+ * (the "License"); you may not use this file except in compliance with
6
+ * the License. You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import {Config, DomQuery} from "mona-dish";
18
+ import {describe, it} from 'mocha';
19
+ import {expect} from 'chai';
20
+ import * as sinon from 'sinon';
21
+
22
+ import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
23
+ import {P_EXECUTE, P_RENDER} from "../../impl/core/Const";
24
+ import defaultMyFaces23 = StandardInits.defaultMyFaces23;
25
+
26
+
27
+ sinon.reset();
28
+
29
+ declare var jsf: any;
30
+ declare var Implementation: any;
31
+
32
+ /**
33
+ * testing the javax.ajax.request api without triggering any
34
+ * xhr request...
35
+ * the idea is to shim the code which triggers the request out and check what is going in
36
+ * and what is coming out
37
+ */
38
+
39
+ describe('javax.ajax.request test suite', () => {
40
+
41
+ beforeEach(async () => {
42
+ return await defaultMyFaces23();
43
+ });
44
+
45
+ it("jsf.ajax.request can be called", () => {
46
+ //we stub the addRequestToQueue, to enable the request check only
47
+ //without any xhr and response, both will be tested separately for
48
+ //proper behavior
49
+ const addRequestToQueue = sinon.stub(Implementation.queueHandler, "addRequestToQueue");
50
+ //now the javax.ajax.request should trigger but should not go into
51
+ //the asynchronous event loop.
52
+ //lets check it out
53
+
54
+ try {
55
+ DomQuery.byId("input_2").addEventListener("click", (event: Event) => {
56
+ jsf.ajax.request(null, event, {render: '@all', execute: '@form'})
57
+ }).click();
58
+
59
+ expect(addRequestToQueue.called).to.be.true;
60
+ expect(addRequestToQueue.callCount).to.eq(1);
61
+ const context = (<Config>addRequestToQueue.args[0][2]);
62
+
63
+ expect(context.getIf("passThrgh", P_RENDER).value).eq("@all");
64
+ //Execute issuing form due to @form and always the issuing element
65
+ expect(context.getIf("passThrgh", P_EXECUTE).value).eq("blarg input_2");
66
+ } finally {
67
+ //once done we restore the proper state
68
+ addRequestToQueue.restore();
69
+ }
70
+
71
+ });
72
+
73
+ it("javax.ajax.request passthroughs must end up in passthrough", (done) => {
74
+ //TODO implementation
75
+ done();
76
+ });
77
+
78
+ it("javax.util.chain must work", () => {
79
+ let called = {};
80
+ window.called = called;
81
+
82
+ let func1 = () => {
83
+ called["func1"] = true;
84
+ return true;
85
+ }
86
+
87
+ let func2 = `function func2(called) {
88
+ called["func2"] = true;
89
+ return true;
90
+ }`;
91
+
92
+ let func3 = () => {
93
+ called["func3"] = true;
94
+ return false;
95
+ }
96
+
97
+ let func4 = `return (function func4(called) {
98
+ called["func4"] = true;
99
+ return false;
100
+ })(event)`;
101
+
102
+ let func5 = () => {
103
+ called["func5"] = true;
104
+ return false;
105
+ };
106
+
107
+ window.jsf.util.chain(this, called, func1, func2, func3, func4, func5);
108
+
109
+ expect(called["func1"]).to.be.true;
110
+ expect(called["func2"]).to.be.true;
111
+ expect(!!called["func3"]).to.be.true;
112
+ expect(!!called["func4"]).to.be.false;
113
+ expect(!!called["func5"]).to.be.false;
114
+
115
+ called = {};
116
+ window.jsf.util.chain(this, called, func1, func2, func4, func5);
117
+ expect(called["func1"]).to.be.true;
118
+ expect(called["func2"]).to.be.true;
119
+ expect(!!called["func4"]).to.be.true;
120
+ expect(!!called["func5"]).to.be.false;
121
+
122
+ });
123
+
124
+
125
+
126
+
127
+ });
128
+
129
+
@@ -1,4 +1,4 @@
1
- /* Licensed to the Apache Software Foundation (ASF) under one or more
1
+ /*! Licensed to the Apache Software Foundation (ASF) under one or more
2
2
  * contributor license agreements. See the NOTICE file distributed with
3
3
  * this work for additional information regarding copyright ownership.
4
4
  * The ASF licenses this file to you under the Apache License, Version 2.0
@@ -21,11 +21,9 @@ import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
21
21
  import defaultMyFaces = StandardInits.defaultMyFaces;
22
22
  import defaultSeparatorChar = StandardInits.defaultSeparatorChar;
23
23
 
24
- const jsdom = require("jsdom");
25
- const {JSDOM} = jsdom;
26
24
  sinon.reset();
27
25
 
28
- declare var jsf: any;
26
+ declare var faces: any;
29
27
  declare var Implementation: any;
30
28
 
31
29
  describe('various tests for get separator char', () => {
@@ -35,7 +33,7 @@ describe('various tests for get separator char', () => {
35
33
  let waitForResult = defaultMyFaces();
36
34
  waitForResult.then((close) => {
37
35
  try {
38
- let separator = jsf.separatorchar;
36
+ let separator = faces.separatorchar;
39
37
  expect(separator).to.eq(":");
40
38
  } finally {
41
39
  Implementation.reset();
@@ -47,13 +45,15 @@ describe('various tests for get separator char', () => {
47
45
 
48
46
  it("should have a custom separator char", (done) => {
49
47
 
50
- let waitForResult = defaultSeparatorChar("$");
48
+ let waitForResult = defaultSeparatorChar("$", false);
51
49
  waitForResult.then((close) => {
52
50
  try {
53
51
  let separator = Implementation.getSeparatorChar();
54
- console.debug("sep:", separator);
55
52
  expect(separator).to.eq("$");
56
53
  done();
54
+ } catch(ex) {
55
+ console.error(ex);
56
+ expect(false).to.eq(true);
57
57
  } finally {
58
58
  Implementation.reset();
59
59
  close();