diff --git a/src/org/labkey/test/pages/core/admin/ShowAdminPage.java b/src/org/labkey/test/pages/core/admin/ShowAdminPage.java index a23ee09e45..9ba38a6290 100644 --- a/src/org/labkey/test/pages/core/admin/ShowAdminPage.java +++ b/src/org/labkey/test/pages/core/admin/ShowAdminPage.java @@ -240,6 +240,12 @@ public void clickCredits() clickAndWait(elementCache().creditsLink); } + public void clickViewPrimarySiteLogFile() + { + goToSettingsSection(); + clickAndWait(elementCache().viewPrimarySiteLogFileLink); + } + public void clickPostgresActivity() { goToSettingsSection(); @@ -296,6 +302,7 @@ protected class ElementCache extends LabKeyPage.ElementCache protected WebElement systemPropertiesLink = Locator.linkContainingText("system properties").findWhenNeeded(this); protected WebElement viewsAndScriptingLink = Locator.linkWithText("views and scripting").findWhenNeeded(this); protected WebElement creditsLink = Locator.linkWithText("credits").findWhenNeeded(this); + protected WebElement viewPrimarySiteLogFileLink = Locator.linkWithText("view primary site log file").findWhenNeeded(this); protected WebElement postgresActivityLink = Locator.linkWithText("postgres activity").findWhenNeeded(this); protected WebElement postgresLocksLink = Locator.linkWithText("postgres locks").findWhenNeeded(this); diff --git a/src/org/labkey/test/tests/BasicTest.java b/src/org/labkey/test/tests/BasicTest.java index 4773490d7d..e90f67adee 100644 --- a/src/org/labkey/test/tests/BasicTest.java +++ b/src/org/labkey/test/tests/BasicTest.java @@ -28,6 +28,7 @@ import org.labkey.test.categories.Git; import org.labkey.test.categories.Hosting; import org.labkey.test.categories.Smoke; +import org.labkey.test.pages.core.admin.ShowAdminPage; import org.labkey.test.util.Order; import java.util.List; @@ -61,6 +62,21 @@ public void testScripts() assertTextNotPresent("WARNING:"); } + @Test + public void testStartupLogging() + { + ShowAdminPage adminPage = goToAdminConsole(); + adminPage.clickViewPrimarySiteLogFile(); + + // Issue 52684: Ensure Log4J is capturing startup logging from: + assertTextPresent( + "Starting LabKeyServer using", // Our "embedded" code (the primary entry point) + "Starting Servlet engine", // Spring Boot and Tomcat + "Exploding module archives", // Our "bootstrap" code (extracts modules and sets up webapp classloading) + "LabKey-managed modules to ensure they're recent enough to upgrade" // Our code inside the webapp + ); + } + @Override public List getAssociatedModules() { diff --git a/src/org/labkey/test/tests/TriggerScriptTest.java b/src/org/labkey/test/tests/TriggerScriptTest.java index 0c726ef5f6..5aa8e7b6e7 100644 --- a/src/org/labkey/test/tests/TriggerScriptTest.java +++ b/src/org/labkey/test/tests/TriggerScriptTest.java @@ -34,6 +34,7 @@ import org.labkey.test.WebTestHelper; import org.labkey.test.categories.Daily; import org.labkey.test.categories.Data; +import org.labkey.test.components.html.SiteNavBar; import org.labkey.test.pages.ImportDataPage; import org.labkey.test.params.FieldDefinition; import org.labkey.test.params.FieldDefinition.ColumnType; @@ -448,7 +449,22 @@ public void testDataClassIndividualTriggers() throws Exception GoToDataUI goToDataClass = () -> goTo("Data Classes", DATA_CLASSES_NAME); setupDataClass(); + + // Go to the log view to start capturing messages + new SiteNavBar(getDriver()).clickAdminMenuItem(false, "Developer Links", "Server JavaScript Console"); + switchToWindow(1); + waitForText("Message"); + + switchToMainWindow(); doIndividualTriggerTest("query", goToDataClass, "Name", false, "Yes, Delete", false); + + // Go back to the console window + switchToWindow(1); + waitForText("init got triggered with event: delete", + "exp.data: this is from the shared function", + "complete got triggered with event: delete"); + getDriver().close(); + switchToMainWindow(); }