From f3a7ed5d816a8896d78454c021784745af23b469 Mon Sep 17 00:00:00 2001 From: cnathe Date: Fri, 23 Jan 2026 17:34:43 -0600 Subject: [PATCH 1/4] Test fixes for change from quoted values to bold in error messages --- src/org/labkey/test/LabKeySiteWrapper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/labkey/test/LabKeySiteWrapper.java b/src/org/labkey/test/LabKeySiteWrapper.java index ee5863824e..4b5e6ac524 100644 --- a/src/org/labkey/test/LabKeySiteWrapper.java +++ b/src/org/labkey/test/LabKeySiteWrapper.java @@ -1734,10 +1734,10 @@ public String getConversionErrorMessage(Object value, String fieldName, Class if (fieldType.equalsIgnoreCase("date") || fieldType.equalsIgnoreCase("datetime") || fieldType.equalsIgnoreCase("timestamp")) { String parsingMode = useUSDateParsing ? "U.S. date parsing (MDY)" : "Non-U.S. date parsing (DMY)"; - return "'" + value + "' is not a valid " + fieldType + " for " + fieldName + " using " + parsingMode; + return value + " is not a valid " + fieldType + " for " + fieldName + " using " + parsingMode; } - return "Could not convert value '" + value + "' (" + value.getClass().getSimpleName() + ") for " + fieldType + " field '" + fieldName + "'" ; + return "Could not convert value " + value + " (" + value.getClass().getSimpleName() + ") for " + fieldType + " field " + fieldName; } private ProductKey getProductConfiguration() throws IOException, CommandException From 877a2536362f910c83998513437c7c520359f8ac Mon Sep 17 00:00:00 2001 From: cnathe Date: Fri, 23 Jan 2026 17:48:05 -0600 Subject: [PATCH 2/4] Test fixes for change from quoted values to bold in error messages --- src/org/labkey/test/LabKeySiteWrapper.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/org/labkey/test/LabKeySiteWrapper.java b/src/org/labkey/test/LabKeySiteWrapper.java index 4b5e6ac524..026d376841 100644 --- a/src/org/labkey/test/LabKeySiteWrapper.java +++ b/src/org/labkey/test/LabKeySiteWrapper.java @@ -1721,23 +1721,28 @@ protected void deletePipelineJob(@LoggedParam String jobDescription, @LoggedPara public String getConversionErrorMessage(Object value, String fieldName, Class targetClass) { - return getConversionErrorMessage(value, fieldName, targetClass, true); + return getConversionErrorMessage(value, fieldName, targetClass, true, false); } // Note: Keep in sync with ConvertHelper.getStandardConversionErrorMessage() // Example: "Could not convert value '2.34' (Double) for Boolean field 'Medical History.Dep Diagnosed in Last 18 Months'" - public String getConversionErrorMessage(Object value, String fieldName, Class targetClass, boolean useUSDateParsing) + public String getConversionErrorMessage(Object value, String fieldName, Class targetClass, boolean useUSDateParsing, boolean removeSingleQuotes) { + String errorMessage; String fieldType = targetClass.getSimpleName(); // Issue 50768: Need a better error message if date value is not in the expected format. if (fieldType.equalsIgnoreCase("date") || fieldType.equalsIgnoreCase("datetime") || fieldType.equalsIgnoreCase("timestamp")) { String parsingMode = useUSDateParsing ? "U.S. date parsing (MDY)" : "Non-U.S. date parsing (DMY)"; - return value + " is not a valid " + fieldType + " for " + fieldName + " using " + parsingMode; + errorMessage = "'" + value + "' is not a valid " + fieldType + " for " + fieldName + " using " + parsingMode; + } + else + { + errorMessage = "Could not convert value '" + value + "' (" + value.getClass().getSimpleName() + ") for " + fieldType + " field '" + fieldName + "'"; } - return "Could not convert value " + value + " (" + value.getClass().getSimpleName() + ") for " + fieldType + " field " + fieldName; + return removeSingleQuotes ? errorMessage.replace("'", "") : errorMessage; } private ProductKey getProductConfiguration() throws IOException, CommandException From e14dde50a8789e70a245fe380d1b05f1aee990c8 Mon Sep 17 00:00:00 2001 From: cnathe Date: Tue, 27 Jan 2026 08:58:57 -0600 Subject: [PATCH 3/4] getConversionErrorMessage update for cases that don't wrap value and field name in single quotes --- src/org/labkey/test/LabKeySiteWrapper.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/org/labkey/test/LabKeySiteWrapper.java b/src/org/labkey/test/LabKeySiteWrapper.java index 026d376841..1272e53c8e 100644 --- a/src/org/labkey/test/LabKeySiteWrapper.java +++ b/src/org/labkey/test/LabKeySiteWrapper.java @@ -1726,23 +1726,24 @@ public String getConversionErrorMessage(Object value, String fieldName, Class // Note: Keep in sync with ConvertHelper.getStandardConversionErrorMessage() // Example: "Could not convert value '2.34' (Double) for Boolean field 'Medical History.Dep Diagnosed in Last 18 Months'" - public String getConversionErrorMessage(Object value, String fieldName, Class targetClass, boolean useUSDateParsing, boolean removeSingleQuotes) + public String getConversionErrorMessage(Object value, String fieldName, Class targetClass, boolean useUSDateParsing, boolean withoutSingleQuotes) { String errorMessage; String fieldType = targetClass.getSimpleName(); + String quote = withoutSingleQuotes ? "" : "'"; // Issue 50768: Need a better error message if date value is not in the expected format. if (fieldType.equalsIgnoreCase("date") || fieldType.equalsIgnoreCase("datetime") || fieldType.equalsIgnoreCase("timestamp")) { String parsingMode = useUSDateParsing ? "U.S. date parsing (MDY)" : "Non-U.S. date parsing (DMY)"; - errorMessage = "'" + value + "' is not a valid " + fieldType + " for " + fieldName + " using " + parsingMode; + errorMessage = quote + value + quote + " is not a valid " + fieldType + " for " + fieldName + " using " + parsingMode; } else { - errorMessage = "Could not convert value '" + value + "' (" + value.getClass().getSimpleName() + ") for " + fieldType + " field '" + fieldName + "'"; + errorMessage = "Could not convert value " + quote + value + quote + " (" + value.getClass().getSimpleName() + ") for " + fieldType + " field " + quote + fieldName + quote; } - return removeSingleQuotes ? errorMessage.replace("'", "") : errorMessage; + return errorMessage; } private ProductKey getProductConfiguration() throws IOException, CommandException From cc83bc600e1e5b652a496238502249a93c2150d2 Mon Sep 17 00:00:00 2001 From: cnathe Date: Wed, 28 Jan 2026 09:08:13 -0600 Subject: [PATCH 4/4] Update text for "can't upload attachment" error message for consistency --- src/org/labkey/test/tests/InlineImagesListTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/labkey/test/tests/InlineImagesListTest.java b/src/org/labkey/test/tests/InlineImagesListTest.java index fab04e0bb9..07c9d9ddcc 100644 --- a/src/org/labkey/test/tests/InlineImagesListTest.java +++ b/src/org/labkey/test/tests/InlineImagesListTest.java @@ -372,7 +372,7 @@ public final void testList() throws Exception importFilePathError(listImportPage, "1", PDF_FILE.getName()); importFilePathError(listImportPage, "5", PDF_FILE.getName()); - String attachmentError = "Can't upload '%s' to field %s with type Attachment."; + String attachmentError = "Cannot upload '%s' to Attachment type field '%s'."; String attachmentPdfError = String.format(attachmentError, PDF_FILE.getName(), LIST_ATTACHMENT01_NAME); String attachmentAbsentError = String.format(attachmentError, "Absent.txt", LIST_ATTACHMENT01_NAME); verifyQueryAPI("lists", LIST_NAME, Map.of(LIST_KEY_NAME, 5, LIST_ATTACHMENT01_NAME, PDF_FILE.getName()), true, "Row 1: " + attachmentPdfError); @@ -397,7 +397,7 @@ private void importFilePathError(ImportDataPage listImportPage, String key, Stri listImportPage.submitExpectingError(); try { - String expectedError = "Row 1: Can't upload '" + attachmentValue + "' to field " + LIST_ATTACHMENT01_NAME + " with type Attachment."; + String expectedError = "Row 1: Cannot upload '" + attachmentValue + "' to Attachment type field '" + LIST_ATTACHMENT01_NAME + "'."; checker().withScreenshot("import_error").verifyTrue("Invalid attachment error not as expected", isElementPresent(Locator.tagWithClass("div", "labkey-error").withText(expectedError))); } catch(NoSuchElementException nse)