From cc67e94db389afa7debecf1b6645342a0e72ed5d Mon Sep 17 00:00:00 2001 From: Axel Uhl Date: Wed, 13 Jan 2021 17:01:15 +0100 Subject: [PATCH 1/2] ORC tests: added logging; use GET instead of POST for country list --- .../com/sap/sailing/domain/orc/TestORCPerformanceCurve.java | 6 +++++- .../domain/orc/impl/ORCPublicCertificateDatabaseImpl.java | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/orc/TestORCPerformanceCurve.java b/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/orc/TestORCPerformanceCurve.java index c298504160c..af6a44b3411 100644 --- a/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/orc/TestORCPerformanceCurve.java +++ b/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/orc/TestORCPerformanceCurve.java @@ -10,6 +10,7 @@ import java.net.URL; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.logging.Logger; import java.util.stream.StreamSupport; import javax.xml.parsers.ParserConfigurationException; @@ -51,6 +52,8 @@ import com.sap.sse.common.impl.DegreeBearingImpl; * */ public class TestORCPerformanceCurve { + private static final Logger logger = Logger.getLogger(TestORCPerformanceCurve.class.getName()); + // set true to see all the differences i private final boolean collectErrors = true; @@ -97,7 +100,7 @@ public class TestORCPerformanceCurve { legs.add(new ORCPerformanceCurveLegImpl(new NauticalMileDistance(1.03), new DegreeBearingImpl(15))); legs.add(new ORCPerformanceCurveLegImpl(new NauticalMileDistance(1.03), new DegreeBearingImpl(165))); legs.add(new ORCPerformanceCurveLegImpl(new NauticalMileDistance(1.17), new DegreeBearingImpl(180))); - alturaCourse = new ORCPerformanceCurveCourseImpl(legs); //this course is the same course as seen in the Altura "IMS Explanation" sheet + alturaCourse = new ORCPerformanceCurveCourseImpl(legs); // this course is the same course as seen in the Altura "IMS Explanation" sheet // Local File: File fileGER = new File(RESOURCES + "GER2019.json"); importerLocal = new ORCCertificatesJsonImporter().read(new FileInputStream(fileGER)); @@ -109,6 +112,7 @@ public class TestORCPerformanceCurve { .stream(ORCPublicCertificateDatabaseImpl.INSTANCE.getCountriesWithValidCertificates().spliterator(), /* parallel */ false) .max((c1, c2) -> c1.getCertCount() - c2.getCertCount()).get().getIssuingCountry(); + logger.info("Trying to read country certificates for "+countryWithMostValidCertificates); importerOnline = new ORCCertificatesJsonImporter().read(new URL("https://data.orc.org/public/WPub.dll?action=DownBoatRMS&CountryId="+ countryWithMostValidCertificates.getThreeLetterIOCCode()+"&ext=json").openStream()); } diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/orc/impl/ORCPublicCertificateDatabaseImpl.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/orc/impl/ORCPublicCertificateDatabaseImpl.java index 395bb4a81ab..2bb00db1ae3 100755 --- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/orc/impl/ORCPublicCertificateDatabaseImpl.java +++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/orc/impl/ORCPublicCertificateDatabaseImpl.java @@ -391,10 +391,10 @@ public class ORCPublicCertificateDatabaseImpl implements ORCPublicCertificateDat final Set result = new HashSet<>(); final HttpClient client = HttpClientBuilder.create().build(); final List params = new ArrayList<>(); - final HttpPost postRequest = new HttpPost(COUNTRY_OVERVIEW_URL); - addAuthorizationHeader(postRequest); + final HttpGet getRequest = new HttpGet(COUNTRY_OVERVIEW_URL); + addAuthorizationHeader(getRequest); logger.fine(()->"Searching for "+params+"..."); - final HttpResponse processorResponse = client.execute(postRequest); + final HttpResponse processorResponse = client.execute(getRequest); final InputStream content = processorResponse.getEntity().getContent(); final DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); final Document document = builder.parse(content); From b41be73e80a1aadce0d9f463b77ff2bdcdc34027 Mon Sep 17 00:00:00 2001 From: Axel Uhl Date: Wed, 13 Jan 2021 17:14:13 +0100 Subject: [PATCH 2/2] remove jettyextensions from the SSE feature.xml because it no longer exists --- java/com.sap.sse.feature/feature.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/java/com.sap.sse.feature/feature.xml b/java/com.sap.sse.feature/feature.xml index 6a11d9163ee..be9f21ee703 100755 --- a/java/com.sap.sse.feature/feature.xml +++ b/java/com.sap.sse.feature/feature.xml @@ -220,14 +220,6 @@ Computes leaderboard information for sailing races and offers RESTful APIs to al version="0.0.0" unpack="false"/> - -