diff --git a/dev/com.ibm.ws.jsf.2.2_fat/fat/src/com/ibm/ws/jsf22/fat/tests/JSF22InputFileTests.java b/dev/com.ibm.ws.jsf.2.2_fat/fat/src/com/ibm/ws/jsf22/fat/tests/JSF22InputFileTests.java index f2423386fa9..462c3d2df60 100644 --- a/dev/com.ibm.ws.jsf.2.2_fat/fat/src/com/ibm/ws/jsf22/fat/tests/JSF22InputFileTests.java +++ b/dev/com.ibm.ws.jsf.2.2_fat/fat/src/com/ibm/ws/jsf22/fat/tests/JSF22InputFileTests.java @@ -194,6 +194,10 @@ public void testAjaxInputFile() throws Exception { //Ensure the correct content type is used. assertNotNull("The 'multipart/form-data; boundary=' content type was not found!", jsfTestServer2.waitForStringInTraceUsingMark(".*multipart/form-data; boundary=.*")); + Log.info(c, name.getMethodName(), page.getPageSource()); + + page.waitForCondition(driver -> page.isInPage("File Size: 12")); + page.findElement(By.id("form1:uploadButton")).click(); Log.info(c, name.getMethodName(), page.getPageSource()); diff --git a/dev/com.ibm.ws.jsf.2.2_fat/test-applications/JSF22InputFile.war/resources/AjaxFileUploadTest.xhtml b/dev/com.ibm.ws.jsf.2.2_fat/test-applications/JSF22InputFile.war/resources/AjaxFileUploadTest.xhtml index 272ecb8e227..f65cdae3875 100644 --- a/dev/com.ibm.ws.jsf.2.2_fat/test-applications/JSF22InputFile.war/resources/AjaxFileUploadTest.xhtml +++ b/dev/com.ibm.ws.jsf.2.2_fat/test-applications/JSF22InputFile.war/resources/AjaxFileUploadTest.xhtml @@ -23,9 +23,11 @@

Enter a file to upload:

- + +
+
diff --git a/dev/com.ibm.ws.jsf.2.2_fat/test-applications/JSF22InputFile.war/src/com/ibm/ws/jsf22/fat/input/faces40/FileBean.java b/dev/com.ibm.ws.jsf.2.2_fat/test-applications/JSF22InputFile.war/src/com/ibm/ws/jsf22/fat/input/faces40/FileBean.java index 9ef1c72853f..c350bd87315 100644 --- a/dev/com.ibm.ws.jsf.2.2_fat/test-applications/JSF22InputFile.war/src/com/ibm/ws/jsf22/fat/input/faces40/FileBean.java +++ b/dev/com.ibm.ws.jsf.2.2_fat/test-applications/JSF22InputFile.war/src/com/ibm/ws/jsf22/fat/input/faces40/FileBean.java @@ -58,4 +58,12 @@ public void setFile(Part file) { public String getFileContents() { return fileContents; } + + public long getFileSize(){ + if(this.file == null){ + System.out.println("0L"); + return 0L; + } + return this.file.getSize(); + } } diff --git a/dev/com.ibm.ws.jsf.2.2_fat/test-applications/JSF22InputFile.war/src/com/ibm/ws/jsf22/fat/input/jsf22/FileBean.java b/dev/com.ibm.ws.jsf.2.2_fat/test-applications/JSF22InputFile.war/src/com/ibm/ws/jsf22/fat/input/jsf22/FileBean.java index 935d1a9dad8..9e6fa68aa3b 100644 --- a/dev/com.ibm.ws.jsf.2.2_fat/test-applications/JSF22InputFile.war/src/com/ibm/ws/jsf22/fat/input/jsf22/FileBean.java +++ b/dev/com.ibm.ws.jsf.2.2_fat/test-applications/JSF22InputFile.war/src/com/ibm/ws/jsf22/fat/input/jsf22/FileBean.java @@ -51,6 +51,13 @@ public Part getFile() { return file; } + public long getFileSize(){ + if(this.file == null){ + return 0L; + } + return this.file.getSize(); + } + public void setFile(Part file) { this.file = file; }