From 816528de878ef86a2055e1f3f2b31227a854113d Mon Sep 17 00:00:00 2001 From: anhefti Date: Tue, 5 Mar 2024 14:20:44 +0100 Subject: [PATCH 1/2] adapt to new jenkins reporting --- pom.xml | 7 +++++++ .../ch/ethz/seb/sebserver/gbl/client/ProxyDataTest.java | 4 ++-- .../seb/sebserver/gui/integration/GuiIntegrationTest.java | 2 +- .../ethz/seb/sebserver/gui/integration/SEBClientBot.java | 2 +- .../sebserver/gui/integration/UseCasesIntegrationTest.java | 2 +- src/test/resources/application-test.properties | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 9b554dfa..d6e77fb8 100644 --- a/pom.xml +++ b/pom.xml @@ -189,6 +189,13 @@ + + + org.glassfish.jaxb + jaxb-runtime + 2.4.0-b180830.0438 + + diff --git a/src/test/java/ch/ethz/seb/sebserver/gbl/client/ProxyDataTest.java b/src/test/java/ch/ethz/seb/sebserver/gbl/client/ProxyDataTest.java index 54d7019b..e995f0dd 100644 --- a/src/test/java/ch/ethz/seb/sebserver/gbl/client/ProxyDataTest.java +++ b/src/test/java/ch/ethz/seb/sebserver/gbl/client/ProxyDataTest.java @@ -16,9 +16,9 @@ public class ProxyDataTest { @Test public void testCreation() { - final ProxyData proxyData = new ProxyData("proxyName", 8080, new ClientCredentials("user1", "password")); + final ProxyData proxyData = new ProxyData("proxyName", 8888, new ClientCredentials("user1", "password")); assertEquals( - "ProxyData [proxyName=proxyName, proxyPort=8080, clientCredentials=ClientCredentials [clientId=user1]]", + "ProxyData [proxyName=proxyName, proxyPort=8888, clientCredentials=ClientCredentials [clientId=user1]]", proxyData.toString()); } diff --git a/src/test/java/ch/ethz/seb/sebserver/gui/integration/GuiIntegrationTest.java b/src/test/java/ch/ethz/seb/sebserver/gui/integration/GuiIntegrationTest.java index a002194d..19b9807b 100644 --- a/src/test/java/ch/ethz/seb/sebserver/gui/integration/GuiIntegrationTest.java +++ b/src/test/java/ch/ethz/seb/sebserver/gui/integration/GuiIntegrationTest.java @@ -80,7 +80,7 @@ public abstract class GuiIntegrationTest { final HttpSession sessionMock = Mockito.mock(HttpSession.class); final WebserviceURIService webserviceURIService = new WebserviceURIService( - "http", "localhost", "8080", "/", this.endpoint); + "http", "localhost", "8888", "/", this.endpoint); final ClientHttpRequestFactoryService clientHttpRequestFactoryService = Mockito .mock(ClientHttpRequestFactoryService.class); diff --git a/src/test/java/ch/ethz/seb/sebserver/gui/integration/SEBClientBot.java b/src/test/java/ch/ethz/seb/sebserver/gui/integration/SEBClientBot.java index d45fb916..5d9eeb05 100644 --- a/src/test/java/ch/ethz/seb/sebserver/gui/integration/SEBClientBot.java +++ b/src/test/java/ch/ethz/seb/sebserver/gui/integration/SEBClientBot.java @@ -79,7 +79,7 @@ public class SEBClientBot { private final ObjectMapper jsonMapper = new ObjectMapper(); private final Random random = new Random(); - String webserviceAddress = "http://localhost:8080"; + String webserviceAddress = "http://localhost:8888"; String accessTokenEndpoint = "/oauth/token"; String clientId = "test"; String sessionId = null; diff --git a/src/test/java/ch/ethz/seb/sebserver/gui/integration/UseCasesIntegrationTest.java b/src/test/java/ch/ethz/seb/sebserver/gui/integration/UseCasesIntegrationTest.java index 251bfd6f..1e7d1da2 100644 --- a/src/test/java/ch/ethz/seb/sebserver/gui/integration/UseCasesIntegrationTest.java +++ b/src/test/java/ch/ethz/seb/sebserver/gui/integration/UseCasesIntegrationTest.java @@ -2922,7 +2922,7 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest { .getBuilder(NewLmsSetup.class) .withFormParam(Domain.LMS_SETUP.ATTR_NAME, "Test Open edx") .withFormParam(Domain.LMS_SETUP.ATTR_LMS_TYPE, LmsType.OPEN_EDX.name()) - .withFormParam(Domain.LMS_SETUP.ATTR_LMS_URL, "http://localhost:8080/openedxtest") + .withFormParam(Domain.LMS_SETUP.ATTR_LMS_URL, "http://localhost:8888/openedxtest") .withFormParam(Domain.LMS_SETUP.ATTR_LMS_CLIENTNAME, "test") .withFormParam(Domain.LMS_SETUP.ATTR_LMS_CLIENTSECRET, "test") .call(); diff --git a/src/test/resources/application-test.properties b/src/test/resources/application-test.properties index 2747dec0..622fec38 100644 --- a/src/test/resources/application-test.properties +++ b/src/test/resources/application-test.properties @@ -6,7 +6,7 @@ spring.http.encoding.charset=UTF-8 spring.http.encoding.enabled=true server.address=localhost -server.port=8080 +server.port=8888 server.servlet.context-path=/ spring.main.allow-bean-definition-overriding=true From 46c2ca997b3ff1e6afd49865db717cc947356409 Mon Sep 17 00:00:00 2001 From: anhefti Date: Mon, 11 Mar 2024 16:20:37 +0100 Subject: [PATCH 2/2] SEBSERV-455 for 1.6 --- .../examconfig/impl/AttributeMapping.java | 2 -- .../checks/DowngradeSEBSettingsCheck.java | 35 ++++++++++++------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/AttributeMapping.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/AttributeMapping.java index 9bdb8eed..e4eaac7e 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/AttributeMapping.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/examconfig/impl/AttributeMapping.java @@ -12,7 +12,6 @@ import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; -import ch.ethz.seb.sebserver.webservice.datalayer.batis.model.OrientationRecord; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -20,7 +19,6 @@ import org.slf4j.LoggerFactory; import ch.ethz.seb.sebserver.gbl.model.sebconfig.ConfigurationAttribute; import ch.ethz.seb.sebserver.gbl.model.sebconfig.Orientation; import ch.ethz.seb.sebserver.gbl.util.Utils; -import org.springframework.core.io.ClassPathResource; public class AttributeMapping { diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/checks/DowngradeSEBSettingsCheck.java b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/checks/DowngradeSEBSettingsCheck.java index 06a84392..6200d0c4 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/checks/DowngradeSEBSettingsCheck.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/datalayer/checks/DowngradeSEBSettingsCheck.java @@ -3,7 +3,6 @@ package ch.ethz.seb.sebserver.webservice.datalayer.checks; import javax.sql.DataSource; import java.sql.Connection; import java.sql.PreparedStatement; -import java.sql.ResultSet; import java.util.Arrays; import java.util.List; import java.util.Set; @@ -36,17 +35,19 @@ public class DowngradeSEBSettingsCheck implements DBIntegrityCheck { private final ConfigurationAttributeRecordMapper configurationAttributeRecordMapper; private final DataSource dataSource; private final String schemaName; - private final Long lastMigrationVersion = 22L; + private final Long lastMigrationVersion = 27L; private final String versionAttributeIds = - "1,2,3,4,8,10,11,12,13,14,15,16,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,42,43,44,45,46,47,48," + - "50,51,52,53,54,55,56,57,58,59,60,61,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,81,82,85,86,87,88," + - "89,90,91,92,93,94,95,96,97,98,99,100,200,201,202,203,204,205,206,210,220,221,222,223,231,233,234,235,236," + - "237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262," + - "263,264,265,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322," + - "400,401,402,403,404,405,406,407,408,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516," + - "517,518,519,520,804,812,900,901,904,919,928,940,941,942,950,951,952,953,960,961,970,971,972,973,974,975," + - "1100,1101,1102,1103,1104,1105,1106,1108,1116,1120,1121,1122,1123,1124,1125,1129,1130,1131,1132,1133,1500," + - "1501,1502,1503,1504,1505,1506,1508,1516,1530,1531,1532,1533,1551,1578,"; + "1,2,4,8,10,11,12,13,14,15,16,18,19,20,21,22,23,24,25,26,27,28,29,31,32,33,34,35,42,43,44,45,46,47,48,50,51," + + "52,53,54,55,56,57,58,59,60,61,972,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,81,82,85,86,87," + + "88,89,90,91,92,93,94,95,96,97,98,99,100,200,201,202,203,204,205,206,210,220,221,222,223,231,233,234," + + "235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259," + + "260,261,262,263,264,265,300,301,302,303,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319," + + "320,321,322,400,401,402,403,404,405,406,407,408,500,501,502,503,504,505,506,507,508,509,510,511,512," + + "513,514,515,516,517,518,519,520,804,812,900,901,942,940,941,1129,1130,1131,1132,1133,1102,1103,1106," + + "1108,1104,1105,1100,1116,1101,1120,1122,1123,1125,1124,1121,1500,1503,1506,1508,1504,1505,1502,1516," + + "1501,1530,1531,1532,1533,951,952,953,950,960,961,919,928,970,971,973,904,974,975,1578,1551,1300,1301," + + "1302,1303,1305,1306,1320,1321,1322,1564,1580,1581,1582,1200,1590,1591,1568,1577,1567,1550,909,1552,948," + + "1557,943,945,1558,1559,1560,1561,1562,905,1569,1570,1563,1595"; private final boolean fixDowngrade; public DowngradeSEBSettingsCheck( @@ -112,11 +113,19 @@ public class DowngradeSEBSettingsCheck implements DBIntegrityCheck { INIT_LOGGER.error(" ---> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); INIT_LOGGER.error(" ---> !!! Detected a Database version integrity violation, probably due to SEB Server version downgrade."); INIT_LOGGER.error(" ---> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); - INIT_LOGGER.error(" ---> !!!! Please check the following correction and set 'sebserver.init.database.integrity.fix.downgrade'"); - INIT_LOGGER.error(" ---> !!!! to true to apply repair with next startup. Then SEB Server will apply the repair task"); + INIT_LOGGER.error(" ---> !!!! Please check if there was a SEB Server downgrade that causes this or if this is caused by actual development. "); + INIT_LOGGER.error(" ---> !!!! "); + INIT_LOGGER.error(" ---> !!!! If new SEB Settings are added to the default SEB Settings view in actual development, just add the new attributes ids"); + INIT_LOGGER.error(" ---> !!!! To the list in class DowngradeSEBSettingsCheck to fix this issue."); + INIT_LOGGER.error(" ---> !!!! "); + INIT_LOGGER.error(" ---> !!!! If a SEB Server version downgrade is the cause of this issue, please check the following"); + INIT_LOGGER.error(" ---> !!!! correction and set 'sebserver.init.database.integrity.fix.downgrade' to true"); + INIT_LOGGER.error(" ---> !!!! to apply repair with next startup. Then SEB Server will apply the repair task"); INIT_LOGGER.error(" ---> !!!! After successfully repair you can set 'sebserver.init.database.integrity.fix.downgrade' back to false "); + INIT_LOGGER.error(" ---> !!!! "); INIT_LOGGER.error(" ---> !!!! NOTE: Repair will delete the following SEB Settings orientation for Exam Configuration default Views"); INIT_LOGGER.error(" ---> !!!! Exam Configurations built from Configuration Template will stay the same and might have incorrect View Tabs"); + INIT_LOGGER.error(" ---> !!!! "); INIT_LOGGER.error(" ---> !!!! Repair will remove following SEB Settings from default view:\n {}", allNames); INIT_LOGGER.error(" ---> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); throw new WebserviceInitException("Detected a Database version integrity violation, probably due to SEB Server version downgrade. See logs above");