jsf.js_next_gen 1.0.0-beta-20 → 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.
- package/.mocharc.json +2 -1
- package/.nyc_output/2303b649-59d9-485c-9228-73b0ec8787a7.json +1 -0
- package/.nyc_output/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +1 -0
- package/.nyc_output/processinfo/2303b649-59d9-485c-9228-73b0ec8787a7.json +1 -0
- package/.nyc_output/processinfo/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -0
- package/.nycrc +2 -1
- package/README.md +78 -24
- package/dist/docs/assets/highlight.css +21 -0
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/assets/style.css +34 -2
- package/dist/docs/functions/{jsf.ajax.addOnError.html → faces.ajax.addOnError.html} +15 -13
- package/dist/docs/functions/{jsf.ajax.addOnEvent.html → faces.ajax.addOnEvent.html} +15 -13
- package/dist/docs/functions/{jsf.ajax.request.html → faces.ajax.request.html} +15 -13
- package/dist/docs/functions/{jsf.ajax.response.html → faces.ajax.response.html} +15 -13
- package/dist/docs/functions/{jsf.getClientWindow.html → faces.getClientWindow.html} +17 -14
- package/dist/docs/functions/{jsf.getProjectStage.html → faces.getProjectStage.html} +18 -15
- package/dist/docs/functions/{jsf.getViewState.html → faces.getViewState.html} +18 -15
- package/dist/docs/functions/{jsf.push.close.html → faces.push.close.html} +15 -13
- package/dist/docs/functions/{jsf.push.init.html → faces.push.init.html} +29 -19
- package/dist/docs/functions/{jsf.push.open.html → faces.push.open.html} +15 -13
- package/dist/docs/functions/{jsf.util.chain.html → faces.util.chain.html} +12 -10
- package/dist/docs/functions/myfaces.ab.html +10 -8
- package/dist/docs/index.html +71 -29
- package/dist/docs/modules/{jsf.ajax.html → faces.ajax.html} +18 -16
- package/dist/docs/modules/faces.html +75 -0
- package/dist/docs/modules/{jsf.push.html → faces.push.html} +16 -14
- package/dist/docs/modules/{jsf.util.html → faces.util.html} +12 -10
- package/dist/docs/modules/myfaces.html +8 -6
- package/dist/docs/modules.html +9 -7
- package/dist/docs/variables/faces.contextpath.html +57 -0
- package/dist/docs/variables/{jsf.implversion.html → faces.implversion.html} +17 -14
- package/dist/docs/variables/{jsf.separatorchar.html → faces.separatorchar.html} +18 -15
- package/dist/docs/variables/faces.specversion.html +64 -0
- package/dist/docs/variables/myfaces.oam.html +8 -6
- package/dist/window/faces-development.js +7688 -0
- package/dist/window/faces-development.js.br +0 -0
- package/dist/window/faces-development.js.gz +0 -0
- package/dist/window/faces-development.js.map +1 -0
- package/dist/window/faces.js +3 -0
- package/dist/window/faces.js.LICENSE.txt +87 -0
- package/dist/window/faces.js.br +0 -0
- package/dist/window/faces.js.gz +0 -0
- package/dist/window/faces.js.map +1 -0
- package/dist/window/jsf-development.js +3011 -2963
- package/dist/window/jsf-development.js.br +0 -0
- package/dist/window/jsf-development.js.gz +0 -0
- package/dist/window/jsf-development.js.map +1 -1
- package/dist/window/jsf.js +2 -1
- package/dist/window/jsf.js.LICENSE.txt +87 -0
- package/dist/window/jsf.js.br +0 -0
- package/dist/window/jsf.js.gz +0 -0
- package/dist/window/jsf.js.map +1 -1
- package/package.json +12 -12
- package/pom.xml +14 -0
- package/src/main/java/com/example/jsfs_js_ts/DecoratedFacesJS.java +94 -0
- package/src/main/java/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.java +54 -0
- package/src/main/java/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.java +57 -0
- package/src/main/java/com/example/jsfs_js_ts/FacesJSMappingDecorator.java +138 -0
- package/src/main/typescript/@types/definitions/index.d.ts +147 -0
- package/src/main/typescript/api/{Jsf.ts → _api.ts} +61 -49
- package/src/main/typescript/api/faces.ts +44 -0
- package/src/main/typescript/api/jsf.ts +43 -0
- package/src/main/typescript/impl/AjaxImpl.ts +39 -42
- package/src/main/typescript/impl/PushImpl.ts +27 -30
- package/src/main/typescript/impl/core/Const.ts +38 -16
- package/src/main/typescript/impl/core/ImplTypes.ts +1 -1
- package/src/main/typescript/impl/i18n/Messages.ts +2 -2
- package/src/main/typescript/impl/util/Assertions.ts +3 -3
- package/src/main/typescript/impl/util/AsyncQueue.ts +1 -1
- package/src/main/typescript/impl/util/AsyncRunnable.ts +5 -5
- package/src/main/typescript/impl/util/ExtDomQuery.ts +200 -48
- package/src/main/typescript/impl/util/IListener.ts +1 -1
- package/src/main/typescript/impl/util/Lang.ts +25 -25
- package/src/main/typescript/impl/xhrCore/ErrorData.ts +2 -3
- package/src/main/typescript/impl/xhrCore/EventData.ts +4 -3
- package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +19 -11
- package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +15 -14
- package/src/main/typescript/impl/xhrCore/ResonseDataResolver.ts +15 -11
- package/src/main/typescript/impl/xhrCore/Response.ts +30 -24
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +69 -49
- package/src/main/typescript/impl/xhrCore/XhrFormData.ts +9 -7
- package/src/main/typescript/impl/xhrCore/XhrRequest.ts +76 -60
- package/src/main/typescript/myfaces/OamSubmit.ts +12 -15
- package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +277 -65
- package/src/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/StreamTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/fixtures/test.js +1 -0
- package/src/main/typescript/test/frameworkBase/_ext/monadish/fixtures/test2.js +1 -0
- package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +75 -30
- package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +44 -4
- package/src/main/typescript/test/impl/ImplTest.spec.ts +18 -22
- package/src/main/typescript/test/impl/ImplTest_23.spec.ts +129 -0
- package/src/main/typescript/test/impl/SeparatorCharsTest.spec.ts +7 -6
- package/src/main/typescript/test/myfaces/OamSubmit.spec.ts +15 -24
- package/src/main/typescript/test/queue/AsynchronousProbe.ts +1 -1
- package/src/main/typescript/test/queue/AsynchronousQueueTest.spec.ts +4 -4
- package/src/main/typescript/test/xhrCore/EventTests.spec.ts +15 -23
- package/src/main/typescript/test/xhrCore/FakeWebsocket.ts +3 -3
- package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +7 -32
- package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +16 -37
- package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +17 -16
- package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +364 -0
- package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +102 -47
- package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +362 -0
- package/src/main/typescript/test/xhrCore/ShadowDomTest.spec.ts +6 -9
- package/src/main/typescript/test/xhrCore/WebsocketTest.ts +15 -15
- package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +3 -3
- package/{target/main/typescript/impl/util/AsyncRunnable.js → src/main/typescript/test/xhrCore/fixtures/addedViewHead1.js} +4 -6
- package/src/main/typescript/test/xhrCore/fixtures/addedViewHead2.css +18 -0
- package/src/main/typescript/test/xhrCore/fixtures/addedViewHead2.js +16 -0
- package/src/main/typescript/test/xhrCore/fixtures/addedViewHead3.js +16 -0
- package/src/main/typescript/test/xhrCore/fixtures/nonce_script.js +16 -0
- package/src/main/typescript/tsconfig-typedoc.json +17 -1
- package/src/main/typescript/tsconfig.json +23 -5
- package/src/test/resources/jsf-development.js +1 -1
- package/src/test.html +75 -0
- package/src/tmp/test.html +92 -0
- package/target/api/{Jsf.js → _api.js} +68 -70
- package/target/api/_api.js.map +1 -0
- package/target/api/faces.js +45 -0
- package/target/api/faces.js.map +1 -0
- package/target/api/jsf.js +45 -0
- package/target/api/jsf.js.map +1 -0
- package/target/classes/com/example/jsfs_js_ts/DecoratedFacesJS.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/FacesJSMappingDecorator.class +0 -0
- package/target/impl/AjaxImpl.js +85 -93
- package/target/impl/AjaxImpl.js.map +1 -1
- package/target/impl/PushImpl.js +63 -64
- package/target/impl/PushImpl.js.map +1 -1
- package/target/impl/core/Const.js +38 -19
- package/target/impl/core/Const.js.map +1 -1
- package/target/impl/core/ImplTypes.js +10 -15
- package/target/impl/core/ImplTypes.js.map +1 -1
- package/target/impl/i18n/Messages.js +5 -6
- package/target/impl/i18n/Messages.js.map +1 -1
- package/target/impl/util/Assertions.js +12 -21
- package/target/impl/util/Assertions.js.map +1 -1
- package/target/impl/util/AsyncQueue.js +28 -36
- package/target/impl/util/AsyncQueue.js.map +1 -1
- package/target/impl/util/AsyncRunnable.js +1 -1
- package/target/impl/util/ExtDomQuery.js +235 -138
- package/target/impl/util/ExtDomQuery.js.map +1 -1
- package/target/impl/util/Lang.js +43 -50
- package/target/impl/util/Lang.js.map +1 -1
- package/target/impl/xhrCore/ErrorData.js +37 -62
- package/target/impl/xhrCore/ErrorData.js.map +1 -1
- package/target/impl/xhrCore/EventData.js +12 -14
- package/target/impl/xhrCore/EventData.js.map +1 -1
- package/target/impl/xhrCore/RequestDataResolver.js +27 -29
- package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
- package/target/impl/xhrCore/ResonseDataResolver.js +25 -23
- package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
- package/target/impl/xhrCore/Response.js +40 -36
- package/target/impl/xhrCore/Response.js.map +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js +165 -167
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
- package/target/impl/xhrCore/XhrFormData.js +75 -103
- package/target/impl/xhrCore/XhrFormData.js.map +1 -1
- package/target/impl/xhrCore/XhrRequest.js +160 -145
- package/target/impl/xhrCore/XhrRequest.js.map +1 -1
- package/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +4 -0
- package/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +4 -0
- package/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst +1 -0
- package/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst +1 -0
- package/target/myfaces/OamSubmit.js +32 -20
- package/target/myfaces/OamSubmit.js.map +1 -1
- package/target/surefire-reports/TEST-com.example.jsfs_js_ts.JsfsJsTsApplicationTests.xml +78 -0
- package/target/surefire-reports/com.example.jsfs_js_ts.JsfsJsTsApplicationTests.txt +7 -0
- package/target/test/frameworkBase/LangTest.spec.js +46 -32
- package/target/test/frameworkBase/LangTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +372 -134
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js +46 -32
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MappingProbes.js +25 -34
- package/target/test/frameworkBase/_ext/monadish/MappingProbes.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js +9 -9
- package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +32 -32
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js +51 -49
- package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/StandardInits.js +277 -124
- package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js +199 -18
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
- package/target/test/impl/ImplTest.spec.js +45 -33
- package/target/test/impl/ImplTest.spec.js.map +1 -1
- package/target/test/impl/ImplTest_23.spec.js +133 -0
- package/target/test/impl/ImplTest_23.spec.js.map +1 -0
- package/target/test/impl/SeparatorCharsTest.spec.js +22 -20
- package/target/test/impl/SeparatorCharsTest.spec.js.map +1 -1
- package/target/test/myfaces/OamSubmit.spec.js +35 -42
- package/target/test/myfaces/OamSubmit.spec.js.map +1 -1
- package/target/test/queue/AsynchronousProbe.js +24 -30
- package/target/test/queue/AsynchronousProbe.js.map +1 -1
- package/target/test/queue/AsynchronousQueueTest.spec.js +40 -71
- package/target/test/queue/AsynchronousQueueTest.spec.js.map +1 -1
- package/target/test/xhrCore/EventTests.spec.js +47 -83
- package/target/test/xhrCore/EventTests.spec.js.map +1 -1
- package/target/test/xhrCore/FakeWebsocket.js +15 -17
- package/target/test/xhrCore/FakeWebsocket.js.map +1 -1
- package/target/test/xhrCore/FileUploadTest.spec.js +50 -91
- package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestParamsTest.spec.js +49 -98
- package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest.spec.js +84 -120
- package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
- package/target/test/{typescript/xhrCore/RequestTest.js → xhrCore/RequestTest_23.spec.js} +142 -127
- package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -0
- package/target/test/xhrCore/ResponseTest.spec.js +183 -105
- package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest23.spec.js +312 -0
- package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -0
- package/target/test/xhrCore/ShadowDomTest.spec.js +33 -66
- package/target/test/xhrCore/ShadowDomTest.spec.js.map +1 -1
- package/target/test/xhrCore/WebsocketTest.js +64 -97
- package/target/test/xhrCore/WebsocketTest.js.map +1 -1
- package/target/test/xhrCore/XhrFormDataTest.spec.js +42 -16
- package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
- package/target/test-classes/jsf-development.js +452 -3674
- package/target/test-classes/jsf.js +1 -1
- package/target/test-classes/jsf.js.br +0 -0
- package/target/test-classes/jsf.js.gz +0 -0
- package/webpack.config.js +7 -4
- package/webpack.config.js.map +1 -1
- package/webpack.config.ts +23 -4
- package/dist/docs/modules/jsf.html +0 -71
- package/dist/docs/variables/jsf.specversion.html +0 -52
- package/integrationdeploy.cmd +0 -4
- package/integrationsdeploy.sh +0 -5
- package/remap.js +0 -44
- package/remap.js.map +0 -1
- package/src/main/java/com/example/jsfs_js_ts/JsfsJsTsApplication.java +0 -12
- package/src/main/types/typedefs.d.ts +0 -66
- package/target/api/Jsf.js.map +0 -1
- package/target/classes/com/example/jsfs_js_ts/JsfsJsTsApplication.class +0 -0
- package/target/impl/util/ListenerQueue.js +0 -3
- package/target/impl/util/ListenerQueue.js.map +0 -1
- package/target/main/typescript/api/Jsf.js +0 -258
- package/target/main/typescript/api/Jsf.js.map +0 -1
- package/target/main/typescript/impl/AjaxImpl.js +0 -569
- package/target/main/typescript/impl/AjaxImpl.js.map +0 -1
- package/target/main/typescript/impl/PushImpl.js +0 -215
- package/target/main/typescript/impl/PushImpl.js.map +0 -1
- package/target/main/typescript/impl/core/Const.js +0 -135
- package/target/main/typescript/impl/core/Const.js.map +0 -1
- package/target/main/typescript/impl/core/ImplTypes.js +0 -43
- package/target/main/typescript/impl/core/ImplTypes.js.map +0 -1
- package/target/main/typescript/impl/i18n/Messages.js +0 -114
- package/target/main/typescript/impl/i18n/Messages.js.map +0 -1
- package/target/main/typescript/impl/util/Assertions.js +0 -90
- package/target/main/typescript/impl/util/Assertions.js.map +0 -1
- package/target/main/typescript/impl/util/AsyncQueue.js +0 -104
- package/target/main/typescript/impl/util/AsyncQueue.js.map +0 -1
- package/target/main/typescript/impl/util/AsyncRunnable.js.map +0 -1
- package/target/main/typescript/impl/util/ExtDomQuery.js +0 -129
- package/target/main/typescript/impl/util/ExtDomQuery.js.map +0 -1
- package/target/main/typescript/impl/util/Lang.js +0 -215
- package/target/main/typescript/impl/util/Lang.js.map +0 -1
- package/target/main/typescript/impl/util/ListenerQueue.js +0 -3
- package/target/main/typescript/impl/util/ListenerQueue.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/ErrorData.js +0 -89
- package/target/main/typescript/impl/xhrCore/ErrorData.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/EventData.js +0 -30
- package/target/main/typescript/impl/xhrCore/EventData.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/IResponseProcessor.js +0 -3
- package/target/main/typescript/impl/xhrCore/IResponseProcessor.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/RequestDataResolver.js +0 -143
- package/target/main/typescript/impl/xhrCore/RequestDataResolver.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/ResonseDataResolver.js +0 -103
- package/target/main/typescript/impl/xhrCore/ResonseDataResolver.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/Response.js +0 -167
- package/target/main/typescript/impl/xhrCore/Response.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/ResponseProcessor.js +0 -368
- package/target/main/typescript/impl/xhrCore/ResponseProcessor.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/XhrFormData.js +0 -272
- package/target/main/typescript/impl/xhrCore/XhrFormData.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/XhrRequest.js +0 -281
- package/target/main/typescript/impl/xhrCore/XhrRequest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.js +0 -293
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/LangTest.js +0 -89
- package/target/test/frameworkBase/_ext/monadish/LangTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/MappingTest.js +0 -39
- package/target/test/frameworkBase/_ext/monadish/MappingTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/MonadTest.js +0 -155
- package/target/test/frameworkBase/_ext/monadish/MonadTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/StreamTest.js +0 -176
- package/target/test/frameworkBase/_ext/monadish/StreamTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.js +0 -1
- package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/LangTest.js +0 -112
- package/target/test/typescript/frameworkBase/LangTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/DomQueryTest.js +0 -293
- package/target/test/typescript/frameworkBase/_ext/monadish/DomQueryTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/LangTest.js +0 -89
- package/target/test/typescript/frameworkBase/_ext/monadish/LangTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingProbes.js +0 -115
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingProbes.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingTest.js +0 -39
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/MonadTest.js +0 -155
- package/target/test/typescript/frameworkBase/_ext/monadish/MonadTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/StreamTest.js +0 -176
- package/target/test/typescript/frameworkBase/_ext/monadish/StreamTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/XmlQueryTest.js +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/XmlQueryTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/shared/StandardInits.js +0 -264
- package/target/test/typescript/frameworkBase/_ext/shared/StandardInits.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/shared/XmlResponses.js +0 -23
- package/target/test/typescript/frameworkBase/_ext/shared/XmlResponses.js.map +0 -1
- package/target/test/typescript/impl/ImplTest.js +0 -98
- package/target/test/typescript/impl/ImplTest.js.map +0 -1
- package/target/test/typescript/impl/SeparatorCharsTest.js +0 -72
- package/target/test/typescript/impl/SeparatorCharsTest.js.map +0 -1
- package/target/test/typescript/queue/AsynchronousProbe.js +0 -99
- package/target/test/typescript/queue/AsynchronousProbe.js.map +0 -1
- package/target/test/typescript/queue/AsynchronousQueueTest.js +0 -130
- package/target/test/typescript/queue/AsynchronousQueueTest.js.map +0 -1
- package/target/test/typescript/xhrCore/EventTests.js +0 -155
- package/target/test/typescript/xhrCore/EventTests.js.map +0 -1
- package/target/test/typescript/xhrCore/FakeWebsocket.js +0 -25
- package/target/test/typescript/xhrCore/FakeWebsocket.js.map +0 -1
- package/target/test/typescript/xhrCore/FileUploadTest.js +0 -166
- package/target/test/typescript/xhrCore/FileUploadTest.js.map +0 -1
- package/target/test/typescript/xhrCore/RequestParamsTest.js +0 -151
- package/target/test/typescript/xhrCore/RequestParamsTest.js.map +0 -1
- package/target/test/typescript/xhrCore/RequestTest.js.map +0 -1
- package/target/test/typescript/xhrCore/ResponseTest.js +0 -257
- package/target/test/typescript/xhrCore/ResponseTest.js.map +0 -1
- package/target/test/typescript/xhrCore/ShadowDomTest.js +0 -122
- package/target/test/typescript/xhrCore/ShadowDomTest.js.map +0 -1
- package/target/test/typescript/xhrCore/WebsocketTest.js +0 -182
- package/target/test/typescript/xhrCore/WebsocketTest.js.map +0 -1
- package/target/test/typescript/xhrCore/XhrFormDataTest.js +0 -58
- package/target/test/typescript/xhrCore/XhrFormDataTest.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
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="
|
|
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
|
|
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="
|
|
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
|
|
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="
|
|
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="
|
|
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
|
|
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
|
|
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
|
|
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="
|
|
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
|
|
|
@@ -225,7 +241,7 @@ export module StandardInits {
|
|
|
225
241
|
function emitPPR(source, event, action, useIframe, formName) {
|
|
226
242
|
document.getElementById(formName || "form1").action = target;
|
|
227
243
|
|
|
228
|
-
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});
|
|
229
245
|
}
|
|
230
246
|
</script>
|
|
231
247
|
</div>
|
|
@@ -254,13 +270,22 @@ export module StandardInits {
|
|
|
254
270
|
export function defaultHtml(withJsf = true): Promise<() => void> {
|
|
255
271
|
return init(HTML_DEFAULT, withJsf);
|
|
256
272
|
}
|
|
273
|
+
export function defaultHtml_23(withJsf = true): Promise<() => void> {
|
|
274
|
+
return init(HTML_DEFAULT.replace(/jakarta/gi, "javax"), withJsf, false);
|
|
275
|
+
}
|
|
257
276
|
|
|
258
277
|
export function defaultMyFaces(withJsf = true): Promise<() => void> {
|
|
259
278
|
return init(HTML_FORM_DEFAULT, withJsf);
|
|
260
279
|
}
|
|
280
|
+
export function defaultMyFaces23(withJsf = true): Promise<() => void> {
|
|
281
|
+
return init(HTML_FORM_DEFAULT.replace(/jakarta/gi, "javax"), withJsf, false);
|
|
282
|
+
}
|
|
261
283
|
export function defaultFileForm(withJsf = true): Promise<() => void> {
|
|
262
284
|
return init(HTML_FILE_FORM_DEFAULT, withJsf);
|
|
263
285
|
}
|
|
286
|
+
export function defaultFileForm_23(withJsf = true): Promise<() => void> {
|
|
287
|
+
return init(HTML_FILE_FORM_DEFAULT.replace(/jakarta/gi, "javax"), withJsf, false);
|
|
288
|
+
}
|
|
264
289
|
|
|
265
290
|
export function shadowDomMyFaces(withJsf = true): Promise<() => void> {
|
|
266
291
|
return <Promise<() => void>>init(HTML_SHADOW, withJsf).then((close) => {
|
|
@@ -273,12 +298,12 @@ export module StandardInits {
|
|
|
273
298
|
});
|
|
274
299
|
}
|
|
275
300
|
|
|
276
|
-
export function protocolPage(withJsf = true): Promise<() => void> {
|
|
277
|
-
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);
|
|
278
303
|
}
|
|
279
304
|
|
|
280
|
-
export function defaultSeparatorChar(separatorChar: string, withJsf = true): Promise<() => void> {
|
|
281
|
-
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);
|
|
282
307
|
return init(template, withJsf);
|
|
283
308
|
}
|
|
284
309
|
|
|
@@ -296,17 +321,31 @@ export module StandardInits {
|
|
|
296
321
|
* @param Implementation
|
|
297
322
|
*/
|
|
298
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) {
|
|
299
336
|
(<any>global).jsf = data.jsf;
|
|
300
337
|
(<any>global).myfaces = data.myfaces;
|
|
301
338
|
(<any>global).window.jsf = data.jsf;
|
|
302
339
|
(<any>global).window.myfaces = data.myfaces;
|
|
303
340
|
(<any>global).Implementation = Implementation.Implementation;
|
|
341
|
+
(<any>global).window.Implementation = Implementation.Implementation;
|
|
304
342
|
(<any>global).PushImpl = PushImpl.PushImpl;
|
|
305
343
|
//bypass a bug on windows jsdom, domparser not an auto global but on window only
|
|
306
344
|
(<any>global).DOMParser = (<any>global)?.DOMParser ?? window.DOMParser;
|
|
307
345
|
(<any>global).document = (<any>global)?.document ?? window.document;
|
|
308
346
|
};
|
|
309
347
|
|
|
348
|
+
|
|
310
349
|
/**
|
|
311
350
|
* init the jsdom global
|
|
312
351
|
* @param clean
|
|
@@ -317,22 +356,27 @@ export module StandardInits {
|
|
|
317
356
|
return import('jsdom-global').then((domIt) => {
|
|
318
357
|
let params = {
|
|
319
358
|
contentType: "text/html",
|
|
320
|
-
runScripts: "dangerously"
|
|
359
|
+
runScripts: "dangerously",
|
|
360
|
+
resources: "usable",
|
|
361
|
+
url: `file://${__dirname}/index.html`
|
|
321
362
|
};
|
|
322
363
|
//we have two different apis depending whether we allow module interop with sinon or not
|
|
323
|
-
return domIt?.default
|
|
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
|
-
|
|
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).
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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
|
-
|
|
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
|
|
29
|
+
declare var faces: any;
|
|
31
30
|
declare var Implementation: any;
|
|
32
31
|
|
|
33
32
|
/**
|
|
34
|
-
* testing the
|
|
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('
|
|
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("
|
|
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
|
|
51
|
-
|
|
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
|
-
|
|
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("
|
|
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("
|
|
78
|
+
it("faces.util.chain must work", () => {
|
|
83
79
|
let called = {};
|
|
84
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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 =
|
|
36
|
+
let separator = faces.separatorchar;
|
|
39
37
|
expect(separator).to.eq(":");
|
|
40
38
|
} finally {
|
|
41
39
|
Implementation.reset();
|
|
@@ -47,12 +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
52
|
expect(separator).to.eq("$");
|
|
55
53
|
done();
|
|
54
|
+
} catch(ex) {
|
|
55
|
+
console.error(ex);
|
|
56
|
+
expect(false).to.eq(true);
|
|
56
57
|
} finally {
|
|
57
58
|
Implementation.reset();
|
|
58
59
|
close();
|