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
|
@@ -0,0 +1,364 @@
|
|
|
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
|
+
/**
|
|
18
|
+
* Request test, testing on the 2.3 namespace fallback code
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
import {describe, it} from "mocha";
|
|
22
|
+
import * as sinon from "sinon";
|
|
23
|
+
import {expect} from "chai";
|
|
24
|
+
import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
|
|
25
|
+
import {DomQuery} from "mona-dish";
|
|
26
|
+
import {
|
|
27
|
+
COMPLETE,
|
|
28
|
+
SUCCESS
|
|
29
|
+
} from "../../impl/core/Const";
|
|
30
|
+
;
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* wherever we reference the namespaces they must be mapped to javax instead of jakarta
|
|
35
|
+
*/
|
|
36
|
+
function remapNamespacesFor23() {
|
|
37
|
+
const P_PARTIAL_SOURCE = "javax.faces.source";
|
|
38
|
+
const P_VIEWSTATE = "javax.faces.ViewState";
|
|
39
|
+
const P_VIEWROOT = "javax.faces.ViewRoot";
|
|
40
|
+
const P_VIEWHEAD = "javax.faces.ViewHead";
|
|
41
|
+
const P_VIEWBODY = "javax.faces.ViewBody";
|
|
42
|
+
const P_AJAX = "javax.faces.partial.ajax";
|
|
43
|
+
const P_EXECUTE = "javax.faces.partial.execute";
|
|
44
|
+
const P_RENDER = "javax.faces.partial.render";
|
|
45
|
+
const P_EVT = "javax.faces.partial.event";
|
|
46
|
+
const P_CLIENT_WINDOW = "javax.faces.ClientWindow";
|
|
47
|
+
const P_RESET_VALUES = "javax.faces.partial.resetValues";
|
|
48
|
+
const P_WINDOW_ID = "javax.faces.windowId";
|
|
49
|
+
const ENCODED_URL = "javax.faces.encodedURL";
|
|
50
|
+
return {
|
|
51
|
+
P_PARTIAL_SOURCE, P_VIEWSTATE, P_VIEWROOT, P_VIEWHEAD, P_VIEWBODY,
|
|
52
|
+
P_AJAX, P_EXECUTE, P_RENDER, P_EVT, P_CLIENT_WINDOW, P_RESET_VALUES,
|
|
53
|
+
P_WINDOW_ID, ENCODED_URL
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
let {
|
|
60
|
+
P_PARTIAL_SOURCE, P_VIEWSTATE,
|
|
61
|
+
P_AJAX, P_EXECUTE, P_RENDER,
|
|
62
|
+
P_WINDOW_ID
|
|
63
|
+
} = remapNamespacesFor23();
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
import STD_XML = StandardInits.STD_XML;
|
|
67
|
+
import defaultMyFaces23 = StandardInits.defaultMyFaces23;
|
|
68
|
+
|
|
69
|
+
declare var jsf: any;
|
|
70
|
+
declare var Implementation: any;
|
|
71
|
+
|
|
72
|
+
let issueStdReq = function (element) {
|
|
73
|
+
jsf.ajax.request(element, null, {
|
|
74
|
+
execute: "input_1",
|
|
75
|
+
render: "@form",
|
|
76
|
+
pass1: "pass1",
|
|
77
|
+
pass2: "pass2"
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* specialized tests testing the xhr core behavior when it hits the xmlHttpRequest object
|
|
82
|
+
*/
|
|
83
|
+
describe('Tests on the xhr core when it starts to call the request', function () {
|
|
84
|
+
|
|
85
|
+
beforeEach(async function () {
|
|
86
|
+
|
|
87
|
+
let waitForResult = defaultMyFaces23();
|
|
88
|
+
|
|
89
|
+
return waitForResult.then((close) => {
|
|
90
|
+
|
|
91
|
+
this.xhr = sinon.useFakeXMLHttpRequest();
|
|
92
|
+
this.requests = [];
|
|
93
|
+
this.xhr.onCreate = (xhr) => {
|
|
94
|
+
this.requests.push(xhr);
|
|
95
|
+
};
|
|
96
|
+
(<any>global).XMLHttpRequest = this.xhr;
|
|
97
|
+
window.XMLHttpRequest = this.xhr;
|
|
98
|
+
|
|
99
|
+
this.jsfAjaxResponse = sinon.spy((<any>global).jsf.ajax, "response");
|
|
100
|
+
|
|
101
|
+
this.closeIt = () => {
|
|
102
|
+
(<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
103
|
+
this.jsfAjaxResponse.restore();
|
|
104
|
+
Implementation.reset();
|
|
105
|
+
close();
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
afterEach(function () {
|
|
111
|
+
this.closeIt();
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it('must have the standard parameters all in', function (done) {
|
|
115
|
+
//issue a standard jsf.ajax.request upon the standard simple form case and check the passed parameters
|
|
116
|
+
//and whether send was called
|
|
117
|
+
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
118
|
+
|
|
119
|
+
try {
|
|
120
|
+
let element = DomQuery.byId("input_2").getAsElem(0).value;
|
|
121
|
+
issueStdReq(element);
|
|
122
|
+
|
|
123
|
+
expect(this.requests.length).to.eq(1);
|
|
124
|
+
expect(this.requests[0].method).to.eq("POST");
|
|
125
|
+
expect(this.requests[0].async).to.be.true;
|
|
126
|
+
expect(send.called).to.be.true;
|
|
127
|
+
expect(send.callCount).to.eq(1);
|
|
128
|
+
|
|
129
|
+
//sent params jakarta.jsf.ViewState=null&execute=input_1&render=%40form&pass1=pass1&pass2=pass2&jakarta.jsf.windowId=null&jakarta.jsf.source=input_2&jakarta.jsf.partial.ajax=input_2&blarg=blarg&jakarta.jsf.partial.execute=input_1%20input_2&jakarta.jsf.partial.render=blarg
|
|
130
|
+
|
|
131
|
+
} finally {
|
|
132
|
+
|
|
133
|
+
send.restore();
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
done();
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it('it must have the pass through values properly passed', function (done) {
|
|
140
|
+
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
141
|
+
try {
|
|
142
|
+
let element = DomQuery.byId("input_2").getAsElem(0).value;
|
|
143
|
+
issueStdReq(element);
|
|
144
|
+
|
|
145
|
+
expect(send.called).to.be.true;
|
|
146
|
+
let argsVal: any = send.args[0][0];
|
|
147
|
+
let arsArr = argsVal.split("&");
|
|
148
|
+
let resultsMap = {};
|
|
149
|
+
for (let val of arsArr) {
|
|
150
|
+
let keyVal = val.split("=");
|
|
151
|
+
resultsMap[keyVal[0]] = keyVal[1];
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
expect(resultsMap["pass1"]).to.eq("pass1");
|
|
155
|
+
expect(resultsMap["pass2"]).to.eq("pass2");
|
|
156
|
+
expect(!!resultsMap["render"]).to.be.false;
|
|
157
|
+
expect(!!resultsMap["execute"]).to.be.false;
|
|
158
|
+
expect(P_WINDOW_ID in resultsMap).to.be.false;
|
|
159
|
+
expect(P_VIEWSTATE in resultsMap).to.be.true;
|
|
160
|
+
expect(resultsMap[P_PARTIAL_SOURCE]).to.eq("input_2");
|
|
161
|
+
expect(resultsMap[P_AJAX]).to.eq("true");
|
|
162
|
+
expect(resultsMap[P_RENDER]).to.eq("blarg");
|
|
163
|
+
expect(resultsMap[P_EXECUTE]).to.eq("input_1%20input_2");
|
|
164
|
+
|
|
165
|
+
} finally {
|
|
166
|
+
send.restore();
|
|
167
|
+
}
|
|
168
|
+
done();
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
it('it must have the proper target type', function (done) {
|
|
172
|
+
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
173
|
+
try {
|
|
174
|
+
let element = DomQuery.byId("input_2").getAsElem(0).value;
|
|
175
|
+
issueStdReq(element);
|
|
176
|
+
|
|
177
|
+
expect(this.requests[0].requestHeaders.Accept.indexOf("application/xml") != -1).to.be.true;
|
|
178
|
+
|
|
179
|
+
} finally {
|
|
180
|
+
send.restore();
|
|
181
|
+
}
|
|
182
|
+
done();
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
describe('Tests after core when it hits response', function () {
|
|
188
|
+
|
|
189
|
+
beforeEach(async function () {
|
|
190
|
+
|
|
191
|
+
let waitForResult = defaultMyFaces23();
|
|
192
|
+
|
|
193
|
+
return waitForResult.then((close) => {
|
|
194
|
+
|
|
195
|
+
this.xhr = sinon.useFakeXMLHttpRequest();
|
|
196
|
+
this.requests = [];
|
|
197
|
+
this.xhr.onCreate = (xhr) => {
|
|
198
|
+
this.requests.push(xhr);
|
|
199
|
+
};
|
|
200
|
+
(<any>global).XMLHttpRequest = this.xhr = sinon.useFakeXMLHttpRequest();
|
|
201
|
+
|
|
202
|
+
// @ts-ignore
|
|
203
|
+
window.XMLHttpRequest = this.xhr = sinon.useFakeXMLHttpRequest() as XMLHttpRequest;
|
|
204
|
+
|
|
205
|
+
this.jsfAjaxResponse = sinon.spy((<any>global).jsf.ajax, "response");
|
|
206
|
+
|
|
207
|
+
this.closeIt = () => {
|
|
208
|
+
(<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
209
|
+
this.jsfAjaxResponse.restore();
|
|
210
|
+
Implementation.reset();
|
|
211
|
+
close();
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
afterEach(function () {
|
|
217
|
+
this.closeIt();
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
it('must have passed all ajax request phase events', function (done) {
|
|
221
|
+
|
|
222
|
+
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
223
|
+
let globalCnt = 0;
|
|
224
|
+
let localCnt = 0;
|
|
225
|
+
try {
|
|
226
|
+
let element = DomQuery.byId("input_2").getAsElem(0).value;
|
|
227
|
+
jsf.ajax.addOnEvent(() => {
|
|
228
|
+
globalCnt++;
|
|
229
|
+
});
|
|
230
|
+
jsf.ajax.request(element, null, {
|
|
231
|
+
execute: "input_1",
|
|
232
|
+
render: "@form",
|
|
233
|
+
pass1: "pass1",
|
|
234
|
+
pass2: "pass2",
|
|
235
|
+
onevent: () => {
|
|
236
|
+
localCnt++;
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
let xhrReq = this.requests[0];
|
|
241
|
+
|
|
242
|
+
xhrReq.respond(200, {'Content-Type': 'text/xml'}, STD_XML);
|
|
243
|
+
expect(this.jsfAjaxResponse.callCount).to.eq(1);
|
|
244
|
+
//success ommitted due to fake response
|
|
245
|
+
expect(globalCnt == 3).to.eq(true);
|
|
246
|
+
expect(localCnt == 3).to.eq(true);
|
|
247
|
+
done();
|
|
248
|
+
} catch (e) {
|
|
249
|
+
console.error(e);
|
|
250
|
+
|
|
251
|
+
} finally {
|
|
252
|
+
send.restore();
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
it('it must have called request and the pass through values must be properly transferred into the context', function (done) {
|
|
258
|
+
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
259
|
+
let globalCnt = 0;
|
|
260
|
+
let localCnt = 0;
|
|
261
|
+
let xhrReq = null;
|
|
262
|
+
|
|
263
|
+
try {
|
|
264
|
+
let element = DomQuery.byId("input_2").getAsElem(0).value;
|
|
265
|
+
jsf.ajax.addOnEvent(() => {
|
|
266
|
+
globalCnt++;
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
jsf.ajax.request(element, null, {
|
|
271
|
+
execute: "input_1",
|
|
272
|
+
render: "@form",
|
|
273
|
+
pass1: "pass1",
|
|
274
|
+
pass2: "pass2",
|
|
275
|
+
onevent: (evt: any) => {
|
|
276
|
+
localCnt++;
|
|
277
|
+
if (evt.status == COMPLETE) {
|
|
278
|
+
expect(!!xhrReq.responseXML).to.be.true;
|
|
279
|
+
}
|
|
280
|
+
if (evt.status == SUCCESS) {
|
|
281
|
+
expect(this.jsfAjaxResponse.callCount).to.eq(1);
|
|
282
|
+
|
|
283
|
+
expect(this.jsfAjaxResponse.firstCall.args[0] instanceof XMLHttpRequest).to.be.true;
|
|
284
|
+
let lastArg = this.jsfAjaxResponse.firstCall.args[1];
|
|
285
|
+
expect(lastArg.onevent != null).to.be.true;
|
|
286
|
+
expect(lastArg.onevent instanceof Function).to.be.true;
|
|
287
|
+
expect(!!lastArg.onError).to.be.false;
|
|
288
|
+
expect(lastArg.pass1 == "pass1").to.be.true;
|
|
289
|
+
expect(lastArg.pass2 == "pass2").to.be.true;
|
|
290
|
+
expect(!!lastArg[P_PARTIAL_SOURCE]).to.be.true;
|
|
291
|
+
expect(!!lastArg[P_AJAX]).to.be.true;
|
|
292
|
+
expect(!!lastArg[P_EXECUTE]).to.be.true;
|
|
293
|
+
expect(!!lastArg[P_RENDER]).to.be.true;
|
|
294
|
+
|
|
295
|
+
expect(this.jsfAjaxResponse.firstCall.args.length).to.eq(2);
|
|
296
|
+
|
|
297
|
+
expect(globalCnt == 2).to.eq(true); //local before global
|
|
298
|
+
expect(localCnt == 3).to.eq(true);
|
|
299
|
+
|
|
300
|
+
done();
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
xhrReq = this.requests[0];
|
|
306
|
+
xhrReq.responsetype = "text/xml";
|
|
307
|
+
xhrReq.respond(200, {'Content-Type': 'text/xml'}, STD_XML);
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
} catch (e) {
|
|
312
|
+
console.error(e);
|
|
313
|
+
|
|
314
|
+
} finally {
|
|
315
|
+
send.restore();
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
it('it must have called onError in the error case', function (done) {
|
|
322
|
+
//on hold until it is clear why sinon is not giving me the response XML as expected
|
|
323
|
+
|
|
324
|
+
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
325
|
+
let xhrReq = null;
|
|
326
|
+
|
|
327
|
+
try {
|
|
328
|
+
let element = DomQuery.byId("input_2").getAsElem(0).value;
|
|
329
|
+
jsf.ajax.request(element, null, {
|
|
330
|
+
execute: "input_1",
|
|
331
|
+
render: "@form",
|
|
332
|
+
pass1: "pass1",
|
|
333
|
+
pass2: "pass2",
|
|
334
|
+
onerror: (error: any) => {
|
|
335
|
+
expect(error.type).to.eq("error");
|
|
336
|
+
expect(!!error.status).to.eq(true);
|
|
337
|
+
expect(!!error.message).to.eq(true);
|
|
338
|
+
expect(!!error.source).to.eq(true);
|
|
339
|
+
expect(!!error.responseCode).to.eq(true);
|
|
340
|
+
expect(!!error.responseText).to.eq(true);
|
|
341
|
+
expect(!error.responseXML).to.eq(true);
|
|
342
|
+
done();
|
|
343
|
+
},
|
|
344
|
+
onevent: (evt: any) => {
|
|
345
|
+
if (evt.status == COMPLETE) {
|
|
346
|
+
throw Error("This error is wanted, ignore the log");
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
xhrReq = this.requests[0];
|
|
352
|
+
xhrReq.responsetype = "text/xml";
|
|
353
|
+
xhrReq.respond(200, {'Content-Type': 'text/xml'}, STD_XML);
|
|
354
|
+
|
|
355
|
+
} catch (e) {
|
|
356
|
+
console.error(e);
|
|
357
|
+
|
|
358
|
+
} finally {
|
|
359
|
+
send.restore();
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
});
|
|
363
|
+
});
|
|
364
|
+
|
|
@@ -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,18 +21,18 @@ import * as sinon from "sinon";
|
|
|
21
21
|
|
|
22
22
|
import {XmlResponses} from "../frameworkBase/_ext/shared/XmlResponses";
|
|
23
23
|
import {expect} from "chai";
|
|
24
|
+
import {DomQuery, DQ} from "mona-dish";
|
|
24
25
|
import protocolPage = StandardInits.protocolPage;
|
|
25
|
-
import
|
|
26
|
-
import {Optional} from "mona-dish";
|
|
26
|
+
import exp from "constants";
|
|
27
27
|
|
|
28
|
-
declare var
|
|
28
|
+
declare var faces: any;
|
|
29
29
|
declare var Implementation: any;
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* response test
|
|
33
33
|
* the idea is simply to pass in a dom
|
|
34
34
|
* the context and a response xml and then check what happens
|
|
35
|
-
* we do not need to
|
|
35
|
+
* we do not need to go through the entire ajax cycle for that.
|
|
36
36
|
*/
|
|
37
37
|
describe('Tests of the various aspects of the response protocol functionality', function () {
|
|
38
38
|
|
|
@@ -54,10 +54,10 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
54
54
|
this.requests.push(xhr);
|
|
55
55
|
};
|
|
56
56
|
(<any>global).XMLHttpRequest = this.xhr;
|
|
57
|
-
|
|
57
|
+
window.XMLHttpRequest = this.xhr;
|
|
58
58
|
|
|
59
59
|
this.closeIt = () => {
|
|
60
|
-
(<any>global).XMLHttpRequest =
|
|
60
|
+
(<any>global).XMLHttpRequest = window.XMLHttpRequest = this.xhr.restore();
|
|
61
61
|
Implementation.reset();
|
|
62
62
|
close();
|
|
63
63
|
}
|
|
@@ -70,8 +70,7 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
70
70
|
|
|
71
71
|
it("must have a simple field updated as well as the viewstate", function (done) {
|
|
72
72
|
//DQ.byId("cmd_update_insert").click();
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
DQ.byId("cmd_update_insert").click();
|
|
75
74
|
this.respond(XmlResponses.UPDATE_INSERT_1);
|
|
76
75
|
|
|
77
76
|
expect(DQ.byId("changesArea")
|
|
@@ -102,8 +101,7 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
102
101
|
|
|
103
102
|
it("must have a simple field updated with the second before update rendering path", function (done) {
|
|
104
103
|
//DQ.byId("cmd_update_insert").click();
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
DQ.byId("cmd_update_insert").click();
|
|
107
105
|
this.respond(XmlResponses.UPDATE_INSERT_2);
|
|
108
106
|
|
|
109
107
|
expect(DQ.byId("changesArea")
|
|
@@ -153,12 +151,12 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
153
151
|
});
|
|
154
152
|
|
|
155
153
|
|
|
156
|
-
it("must have a proper
|
|
154
|
+
it("must have a proper working head replace", function () {
|
|
157
155
|
DQ.byId("cmd_replace").click();
|
|
156
|
+
|
|
158
157
|
this.respond(XmlResponses.HEAD_REPLACEMENT);
|
|
159
158
|
|
|
160
159
|
//basic replacement
|
|
161
|
-
let newHead = DQ.byId(document.head);
|
|
162
160
|
let newBody = DQ.byId(document.body);
|
|
163
161
|
let newContent = <string>newBody.html().value;
|
|
164
162
|
|
|
@@ -205,7 +203,7 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
205
203
|
DQ.byId("cmd_viewstate").click();
|
|
206
204
|
|
|
207
205
|
this.respond(XmlResponses.VIEWSTATE_1);
|
|
208
|
-
let viewStateElem = DQ.byId('
|
|
206
|
+
let viewStateElem = DQ.byId('jakarta.faces.ViewState');
|
|
209
207
|
expect(viewStateElem.inputValue.value == "hello world").to.be.true;
|
|
210
208
|
});
|
|
211
209
|
|
|
@@ -219,8 +217,7 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
219
217
|
});
|
|
220
218
|
|
|
221
219
|
it("must have processed a proper eval of a script given in the eval tag", function () {
|
|
222
|
-
|
|
223
|
-
|
|
220
|
+
DQ.byId("cmd_eval").click();
|
|
224
221
|
this.respond(XmlResponses.EVAL_1);
|
|
225
222
|
|
|
226
223
|
let resultHTML: string = <string>DQ.byId(document.body).html().value;
|
|
@@ -229,13 +226,11 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
229
226
|
});
|
|
230
227
|
|
|
231
228
|
it("must have updated the viewstates properly", function () {
|
|
232
|
-
|
|
233
|
-
let issuer = DQ.byId("cmd_eval").click();
|
|
234
|
-
|
|
229
|
+
DQ.byId("cmd_eval").click();
|
|
235
230
|
/*js full submit form, coming from the integration tests*/
|
|
236
231
|
window.document.body.innerHTML = `<form id="j_id__v_0" name="j_id__v_0" method="post" action="/IntegrationJSTest/integrationtestsjasmine/test7-eventtest.jsf"
|
|
237
232
|
enctype="application/x-www-form-urlencoded"><span id="updatePanel">hello world</span><a href="#"
|
|
238
|
-
onclick="return
|
|
233
|
+
onclick="return faces.util.chain(this, event,'return false;', 'return myfaces.ab(\'j_id_1l\',\'updateTrigger\');');"
|
|
239
234
|
id="updateTrigger"
|
|
240
235
|
name="updateTrigger"
|
|
241
236
|
class="updateTrigger">[Press
|
|
@@ -243,7 +238,7 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
243
238
|
</form>`;
|
|
244
239
|
|
|
245
240
|
|
|
246
|
-
|
|
241
|
+
faces.ajax.request(window.document.getElementById("updateTrigger"), null, {
|
|
247
242
|
render: "updatePanel",
|
|
248
243
|
execute: "updatePanel updateTrigger"
|
|
249
244
|
});
|
|
@@ -253,26 +248,24 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
253
248
|
<partial-response id="j_id__v_0">
|
|
254
249
|
<changes>
|
|
255
250
|
<update id="updatePanel"><![CDATA[<span id="updatePanel">hello world</span>]]></update>
|
|
256
|
-
<update id="j_id__v_0:
|
|
251
|
+
<update id="j_id__v_0:jakarta.faces.ViewState:1"><![CDATA[RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD]]></update>
|
|
257
252
|
</changes>
|
|
258
253
|
</partial-response>`);
|
|
259
254
|
|
|
260
255
|
|
|
261
|
-
expect(DQ.byId("
|
|
256
|
+
expect(DQ.byId("jakarta.faces.ViewState").isAbsent()).to.be.false;
|
|
262
257
|
|
|
263
|
-
expect((<HTMLInputElement>document.getElementById("
|
|
264
|
-
expect(DQ.byId("
|
|
258
|
+
expect((<HTMLInputElement>document.getElementById("jakarta.faces.ViewState")).value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
|
|
259
|
+
expect(DQ.byId("jakarta.faces.ViewState").inputValue.value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
|
|
265
260
|
});
|
|
266
261
|
|
|
267
262
|
|
|
268
263
|
it("must have updated the viewstates properly with lenient update block", function () {
|
|
269
|
-
|
|
270
|
-
let issuer = DQ.byId("cmd_eval").click();
|
|
271
|
-
|
|
264
|
+
DQ.byId("cmd_eval").click();
|
|
272
265
|
/*js full submit form, coming from the integration tests*/
|
|
273
266
|
window.document.body.innerHTML = `<form id="j_id__v_0" name="j_id__v_0" method="post" action="/IntegrationJSTest/integrationtestsjasmine/test7-eventtest.jsf"
|
|
274
267
|
enctype="application/x-www-form-urlencoded"><span id="updatePanel">hello world</span><a href="#"
|
|
275
|
-
onclick="return
|
|
268
|
+
onclick="return faces.util.chain(this, event,'return false;', 'return myfaces.ab(\'j_id_1l\',\'updateTrigger\');');"
|
|
276
269
|
id="updateTrigger"
|
|
277
270
|
name="updateTrigger"
|
|
278
271
|
class="updateTrigger">[Press
|
|
@@ -280,7 +273,7 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
280
273
|
</form>`;
|
|
281
274
|
|
|
282
275
|
|
|
283
|
-
|
|
276
|
+
faces.ajax.request(window.document.getElementById("updateTrigger"), null, {
|
|
284
277
|
render: "updatePanel",
|
|
285
278
|
execute: "updatePanel updateTrigger"
|
|
286
279
|
});
|
|
@@ -290,17 +283,17 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
290
283
|
<partial-response id="j_id__v_0">
|
|
291
284
|
<changes>
|
|
292
285
|
<update id="updatePanel"><![CDATA[<span id="updatePanel">hello world</span>]]></update>
|
|
293
|
-
<update id="j_id__v_0:
|
|
286
|
+
<update id="j_id__v_0:jakarta.faces.ViewState:1"><![CDATA[RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD]]><!--
|
|
294
287
|
Some random junk which is sent by the server
|
|
295
288
|
--></update>
|
|
296
289
|
</changes>
|
|
297
290
|
</partial-response>`);
|
|
298
291
|
|
|
299
292
|
|
|
300
|
-
expect(DQ.byId("
|
|
293
|
+
expect(DQ.byId("jakarta.faces.ViewState").isAbsent()).to.be.false;
|
|
301
294
|
|
|
302
|
-
expect((<HTMLInputElement>document.getElementById("
|
|
303
|
-
expect(DQ.byId("
|
|
295
|
+
expect((<HTMLInputElement>document.getElementById("jakarta.faces.ViewState")).value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
|
|
296
|
+
expect(DQ.byId("jakarta.faces.ViewState").inputValue.value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
|
|
304
297
|
});
|
|
305
298
|
|
|
306
299
|
|
|
@@ -312,7 +305,7 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
312
305
|
it("must have updated the client window tag properly", function () {
|
|
313
306
|
window.document.body.innerHTML = `<tobago-page locale='en' class='container-fluid' id='page'>
|
|
314
307
|
<form action='/IntegrationJSTest/integrationtestsjasmine/tobago-jfwid-test.jsf' id='page::form' method='post' accept-charset='UTF-8' data-tobago-context-path=''>
|
|
315
|
-
<input type='hidden' name='
|
|
308
|
+
<input type='hidden' name='jakarta.faces.source' id='jakarta.faces.source' disabled='disabled'>
|
|
316
309
|
<tobago-focus id='page::lastFocusId'>
|
|
317
310
|
<input type='hidden' name='page::lastFocusId' id='page::lastFocusId::field'>
|
|
318
311
|
</tobago-focus>
|
|
@@ -326,19 +319,19 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
326
319
|
</div>
|
|
327
320
|
<div class='tobago-page-menuStore'></div>
|
|
328
321
|
<span id='page::jsf-state-container'>
|
|
329
|
-
<input type='hidden' name='
|
|
330
|
-
<input type='hidden' name='
|
|
331
|
-
<input type='hidden' id='j_id__v_0:
|
|
322
|
+
<input type='hidden' name='jakarta.faces.ViewState' id='j_id__v_0:jakarta.faces.ViewState:1' value='RkExQ0Q1NTYzOTNCNzg0RjAwMDAwMDE4' autocomplete='off'>
|
|
323
|
+
<input type='hidden' name='jakarta.faces.RenderKitId' value='tobago'>
|
|
324
|
+
<input type='hidden' id='j_id__v_0:jakarta.faces.ClientWindow:1' name='jakarta.faces.ClientWindow' value='5m10kooxi'>
|
|
332
325
|
</span>
|
|
333
326
|
</form>
|
|
334
327
|
</tobago-page>`;
|
|
335
328
|
|
|
336
329
|
expect(DQ.querySelectorAll("#page\\:output tobago-out").textContent() === "").to.be.true;
|
|
337
|
-
expect(DQ.byId("j_id__v_0:
|
|
338
|
-
expect(DQ.byId("j_id__v_0:
|
|
330
|
+
expect(DQ.byId("j_id__v_0:jakarta.faces.ViewState:1").isAbsent()).to.be.false;
|
|
331
|
+
expect(DQ.byId("j_id__v_0:jakarta.faces.ClientWindow:1").isAbsent()).to.be.false;
|
|
339
332
|
|
|
340
|
-
|
|
341
|
-
"
|
|
333
|
+
faces.ajax.request(window.document.getElementById("page:input"), "change", {
|
|
334
|
+
"jakarta.faces.behavior.event": "change",
|
|
342
335
|
execute: "page:input",
|
|
343
336
|
render: "page:output"
|
|
344
337
|
});
|
|
@@ -351,18 +344,80 @@ describe('Tests of the various aspects of the response protocol functionality',
|
|
|
351
344
|
<tobago-out class='form-control-plaintext'>Alice</tobago-out>
|
|
352
345
|
</div>]]>
|
|
353
346
|
</update>
|
|
354
|
-
<update id='j_id__v_0:
|
|
347
|
+
<update id='j_id__v_0:jakarta.faces.ViewState:1'><![CDATA[MDQwQzkxNkU0MTg0RTQxRjAwMDAwMDE3]]>
|
|
355
348
|
</update>
|
|
356
|
-
<update id='j_id__v_0:
|
|
349
|
+
<update id='j_id__v_0:jakarta.faces.ClientWindow:1'><![CDATA[5m10kooxg]]>
|
|
357
350
|
</update>
|
|
358
351
|
</changes>
|
|
359
352
|
</partial-response>`);
|
|
360
353
|
|
|
361
354
|
expect(DQ.querySelectorAll("#page\\:output tobago-out").textContent() === "Alice").to.be.true;
|
|
362
|
-
expect(DQ.byId("j_id__v_0:
|
|
363
|
-
expect(DQ.byId("j_id__v_0:
|
|
355
|
+
expect(DQ.byId("j_id__v_0:jakarta.faces.ViewState:1").isAbsent()).to.be.false;
|
|
356
|
+
expect(DQ.byId("j_id__v_0:jakarta.faces.ClientWindow:1").isAbsent()).to.be.false;
|
|
364
357
|
});
|
|
365
358
|
|
|
366
359
|
|
|
367
|
-
|
|
360
|
+
|
|
361
|
+
it("must handle simple resource responses properly", function(done) {
|
|
362
|
+
|
|
363
|
+
// we need to fake the response as well to see whether the server has loaded the addedViewHead code and has interpreted it
|
|
364
|
+
//(window as any)["test"] = "booga";
|
|
365
|
+
|
|
366
|
+
DQ.byId("cmd_simple_resource").click();
|
|
367
|
+
this.respond(XmlResponses.SIMPLE_RESOURCE_RESPONSE);
|
|
368
|
+
|
|
369
|
+
expect(document.head.innerHTML.indexOf("../../../xhrCore/fixtures/addedViewHead1.js") != -1).to.be.true;
|
|
370
|
+
DQ.byId(document.body).waitUntilDom(() => DQ.byId('resource_area_1').innerHTML === "true")
|
|
371
|
+
.then(() => done())
|
|
372
|
+
.catch(done);
|
|
373
|
+
})
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
it("only single resources are allowed", function(done) {
|
|
377
|
+
// we need to fake the response as well to see whether the server has loaded the addedViewHead code and has interpreted it
|
|
378
|
+
//(window as any)["test"] = "booga";
|
|
379
|
+
for(let cnt = 0; cnt < 10; cnt++) {
|
|
380
|
+
DQ.byId("cmd_simple_resource").click();
|
|
381
|
+
this.respond(XmlResponses.MULTIPLE_RESOURCE_RESPONSE);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
expect(document.head.innerHTML.indexOf("../../../xhrCore/fixtures/addedViewHead2.js") != -1).to.be.true;
|
|
385
|
+
let addedScriptsCnt = DomQuery.byId(document.head).querySelectorAll("script[src='../../../xhrCore/fixtures/addedViewHead2.js']").length;
|
|
386
|
+
expect(addedScriptsCnt).to.eq(1);
|
|
387
|
+
addedScriptsCnt = DomQuery.byId(document.head).querySelectorAll("style[rel='../../../xhrCore/fixtures/addedViewHead2.css']").length;
|
|
388
|
+
expect(addedScriptsCnt).to.eq(1);
|
|
389
|
+
done();
|
|
390
|
+
})
|
|
391
|
+
|
|
392
|
+
//TODO implement secondary response mockup
|
|
393
|
+
it("must handle complex resource responses properly", function(done) {
|
|
394
|
+
DQ.byId("cmd_complex_resource").click();
|
|
395
|
+
this.respond(XmlResponses.MULTIPLE_RESOURCE_RESPONSE);
|
|
396
|
+
|
|
397
|
+
let headHTML = document.head.innerHTML;
|
|
398
|
+
expect(headHTML.indexOf("../../../xhrCore/fixtures/addedViewHead2.js")).not.eq(-1);
|
|
399
|
+
expect(headHTML.indexOf("rel=\"../../../xhrCore/fixtures/addedViewHead2.css\"")).not.eq(-1);
|
|
400
|
+
|
|
401
|
+
DQ.byId(document.body).waitUntilDom(() => DQ.byId('resource_area_2').innerHTML === "true2")
|
|
402
|
+
.then(() => done())
|
|
403
|
+
.catch(done);
|
|
404
|
+
})
|
|
405
|
+
|
|
406
|
+
it("embedded scripts must be evaled", function(done) {
|
|
407
|
+
|
|
408
|
+
DQ.byId("cmd_complex_resource2").click();
|
|
409
|
+
this.respond(XmlResponses.EMBEDDED_SCRIPTS_RESOURCE_RESPONSE);
|
|
410
|
+
// this.respond("debugger; document.getElementById('resource_area_1').innerHTML = 'true3'", {'Content-Type': 'text/javascript'});
|
|
411
|
+
let headHTML = document.head.innerHTML;
|
|
412
|
+
expect(headHTML.indexOf("../../../xhrCore/fixtures/addedViewHead3.js")).not.eq(-1);
|
|
413
|
+
expect(headHTML.indexOf("rel=\"../../../xhrCore/fixtures/addedViewHead2.css\"")).not.eq(-1);
|
|
414
|
+
setTimeout(() => {
|
|
415
|
+
let evalAreaHtml = DQ.byId('resource_area_1').innerHTML;
|
|
416
|
+
//last one must be the last item, order must be preserved
|
|
417
|
+
expect(evalAreaHtml).to.eq("booga");
|
|
418
|
+
done();
|
|
419
|
+
}, 800)
|
|
420
|
+
|
|
421
|
+
})
|
|
422
|
+
|
|
368
423
|
});
|