diff --git a/Jenkinsfile b/Jenkinsfile index a852909a..e83a1c8b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,12 +14,42 @@ pipeline { stages { stage('Maven build') { steps { - withMaven(maven: 'Maven3.9.6') { + withMaven(maven: 'Maven3.9.6', options: [findbugsPublisher(disabled: true)]) { sh "mvn clean install" } } } + + stage('Reporting') { + steps { + withMaven(maven: 'Maven', options: [findbugsPublisher(disabled: true)]) { + sh "mvn --batch-mode -V -U -e -P let_reporting pmd:pmd pmd:cpd findbugs:findbugs spotbugs:spotbugs" + } + } + } } + post { + always { + junit testResults: '**/target/surefire-reports/TEST-*.xml' + + recordIssues enabledForFailure: true, tool: spotBugs() + recordIssues enabledForFailure: true, tool: pmdParser(pattern: '**/target/pmd.xml') + } + failure { + setBuildStatus("Build failed", "FAILURE"); + emailext body: "The build of the LET Application (${env.JOB_NAME}) failed! See ${env.BUILD_URL}", recipientProviders: [[$class: 'CulpritsRecipientProvider']], subject: 'LET Application Build Failure' + } + success { + setBuildStatus("Build complete", "SUCCESS"); + } + } + options { + timeout(time: 10, unit: 'MINUTES') + buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '7')) + } + triggers { + pollSCM('H/5 * * * *') + } } \ No newline at end of file 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