From 9d0e677fd0d6aab661511b7abbe9b5342cbf82e7 Mon Sep 17 00:00:00 2001 From: Daniel Schramm <xschramm@fi.muni.cz> Date: Wed, 5 May 2021 17:36:57 +0200 Subject: [PATCH] Feature point compilation error fixed --- MeshModel/pom.xml | 2 +- .../FeaturePointImportExportServiceTest.java | 33 +++++++------------ 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/MeshModel/pom.xml b/MeshModel/pom.xml index 50c56320..76283408 100644 --- a/MeshModel/pom.xml +++ b/MeshModel/pom.xml @@ -21,7 +21,7 @@ <publicPackage>cz.fidentis.analyst.mesh.io.*</publicPackage> <publicPackage>cz.fidentis.analyst.mesh.*</publicPackage> <publicPackage>cz.fidentis.analyst.kdtree.*</publicPackage> - <publicPackage>cz.fidentis.analyst.feature</publicPackage> + <publicPackage>cz.fidentis.analyst.feature.*</publicPackage> <!--<publicPackage>cz.fidentis.analyst.mesh.core.MeshFacet</publicPackage>--> <!--<publicPackage>cz.fidentis.analyst.mesh.core.MeshPoint</publicPackage>--> </publicPackages> diff --git a/MeshModel/src/test/java/cz/fidentis/analyst/feature/services/FeaturePointImportExportServiceTest.java b/MeshModel/src/test/java/cz/fidentis/analyst/feature/services/FeaturePointImportExportServiceTest.java index 5cc52b9a..03a0e1c3 100644 --- a/MeshModel/src/test/java/cz/fidentis/analyst/feature/services/FeaturePointImportExportServiceTest.java +++ b/MeshModel/src/test/java/cz/fidentis/analyst/feature/services/FeaturePointImportExportServiceTest.java @@ -1,20 +1,12 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ package cz.fidentis.analyst.feature.services; import cz.fidentis.analyst.feature.FeaturePoint; import cz.fidentis.analyst.feature.provider.FeaturePointTypeProvider; -import cz.fidentis.analyst.mesh.io.MeshObjLoader; import java.io.File; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; -import java.util.Optional; -import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.DisplayName; @@ -38,13 +30,13 @@ public class FeaturePointImportExportServiceTest { @DisplayName("Test loading a CSV file") @Test void importFeaturePointsTest() { - Optional<List<FeaturePoint>> featurePoints = loadFeaturePoints(); - assertTrue(featurePoints.isPresent()); - assertTrue(featurePoints.get().size() > 0); - assertTrue(featurePoints.get().get(0).getX() == -45.3298 - && featurePoints.get().get(0).getY() == 37.1466 - && featurePoints.get().get(0).getZ() == -40.5415 - && featurePoints.get().get(0).getFeaturePointType().equals( + List<FeaturePoint> featurePoints = loadFeaturePoints(); + assertTrue(featurePoints != null); + assertTrue(featurePoints.size() > 0); + assertTrue(featurePoints.get(0).getX() == -45.3298 + && featurePoints.get(0).getY() == 37.1466 + && featurePoints.get(0).getZ() == -40.5415 + && featurePoints.get(0).getFeaturePointType().equals( FeaturePointTypeProvider.getInstance().getFeaturePointTypeByCode("EX_R")) ); } @@ -52,15 +44,12 @@ public class FeaturePointImportExportServiceTest { @DisplayName("Test writing a CSV file") @Test void exportFeaturePointsTest() throws IOException { - FeaturePointImportExportService service = new FeaturePointImportExportService(); - Optional<List<FeaturePoint>> featurePoints = loadFeaturePoints(); - service.exportFeaturePoints(featurePoints.get(), "test_file"); + List<FeaturePoint> featurePoints = loadFeaturePoints(); + FeaturePointImportExportService.exportFeaturePoints(featurePoints, "test_file"); } - private Optional<List<FeaturePoint>> loadFeaturePoints() { - FeaturePointImportExportService service = new FeaturePointImportExportService(); - Optional<List<FeaturePoint>> featurePoints = service.importFeaturePoints(testFileDirectory.toString(), TEST_CSV_FILE); + private List<FeaturePoint> loadFeaturePoints() { + List<FeaturePoint> featurePoints = FeaturePointImportExportService.importFeaturePoints(testFileDirectory.toString(), TEST_CSV_FILE); return featurePoints; - } } -- GitLab