diff --git a/build.gradle b/build.gradle index 341786b3..6e016b2e 100644 --- a/build.gradle +++ b/build.gradle @@ -22,7 +22,6 @@ group = 'com.github.ie3-institute' description = 'OSMoGrid' version = '1.0-SNAPSHOT' - apply from: scriptsLocation + 'tests.gradle' apply from: scriptsLocation + 'pmd.gradle' apply from: scriptsLocation + 'spotbugs.gradle' @@ -41,7 +40,7 @@ repositories { dependencies { // ie³ power system utils - compile('com.github.ie3-institute:PowerSystemUtils:1.5.3') { + implementation('com.github.ie3-institute:PowerSystemUtils:1.5.3') { exclude group: 'org.slf4j', module: 'slf4j-api' exclude group: 'com.github.ie3-institute' exclude group: 'tec.uom.se' @@ -49,59 +48,58 @@ dependencies { } // ie³ power system data model - compile('com.github.ie3-institute:PowerSystemDataModel:2.0.0') { + implementation('com.github.ie3-institute:PowerSystemDataModel:2.0.0') { exclude group: 'org.slf4j', module: 'slf4j-api' exclude group: 'com.github.ie3-institute' } // JTS Topology Suite for GeoPositions, License: EPL 1.0 / EDL 1.0 - compile 'org.locationtech.jts:jts-core:1.16.1' - compile 'org.locationtech.jts.io:jts-io-common:1.16.1' + implementation 'org.locationtech.jts:jts-core:1.16.1' + implementation 'org.locationtech.jts.io:jts-io-common:1.16.1' // Graphs - compile 'org.jgrapht:jgrapht-core:1.5.1' + implementation 'org.jgrapht:jgrapht-core:1.5.1' // logging - compile 'org.apache.logging.log4j:log4j-api:2.14.1' // log4j - compile 'org.apache.logging.log4j:log4j-core:2.14.1' // log4j - compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.14.1' // log4j -> slf4j + implementation 'org.apache.logging.log4j:log4j-api:2.14.1' // log4j + implementation 'org.apache.logging.log4j:log4j-core:2.14.1' // log4j + implementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.14.1' // log4j -> slf4j // pbf parser - compile group: 'com.github.johanneshiry', name: 'OSMonaut', version: 'v1.1.1' + implementation group: 'com.github.johanneshiry', name: 'OSMonaut', version: 'v1.1.1' // javafx - compile group: 'org.openjfx', name: 'javafx-fxml', version: javaVersion.toString() - compile group: 'org.openjfx', name: 'javafx-swing', version: javaVersion.toString() - compile group: 'org.openjfx', name: 'javafx-graphics', version: javaVersion.toString() - compile group: 'org.openjfx', name: 'javafx-web', version: javaVersion.toString() + implementation group: 'org.openjfx', name: 'javafx-fxml', version: javaVersion.toString() + implementation group: 'org.openjfx', name: 'javafx-swing', version: javaVersion.toString() + implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaVersion.toString() + implementation group: 'org.openjfx', name: 'javafx-web', version: javaVersion.toString() - compile 'org.jxmapviewer:jxmapviewer2:2.6' // osm map viewer - compile 'org.glassfish.jaxb:jaxb-runtime:3.0.1' + implementation 'org.jxmapviewer:jxmapviewer2:2.6' // osm map viewer + implementation 'org.glassfish.jaxb:jaxb-runtime:3.0.1' // required for xml parser (javax.xml.bind) (see: https://stackoverflow.com/questions/48204141/replacements-for-deprecated-jpms-modules-with-java-ee-apis/48279048#48279048) - compile 'javax.xml.bind:jaxb-api:2.3.1' // xml parsing - compile 'org.apache.commons:commons-lang3:3.12.0' // for HashCodeBuilder - compile group: 'math.geom2d', name: 'javaGeom', version: '0.11.1' - compile 'info.picocli:picocli:4.6.1' // command line interface + implementation 'javax.xml.bind:jaxb-api:2.3.1' // xml parsing + implementation 'org.apache.commons:commons-lang3:3.12.0' // for HashCodeBuilder + implementation group: 'math.geom2d', name: 'javaGeom', version: '0.11.1' + implementation 'info.picocli:picocli:4.6.1' // command line interface spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:+' // testing - testCompile 'junit:junit:4.13.2' - testCompile 'cglib:cglib-nodep:3.3.0' // enables mocking of classes (in addition to interfaces) - compile 'org.mockito:mockito-core:3.10.0' // mocking framework - testCompile 'org.spockframework:spock-core:2.0-M3-groovy-3.0' - testCompile 'org.objenesis:objenesis:3.2' // Mock creation with constructor parameters - + testImplementation 'junit:junit:4.13.2' + testImplementation 'cglib:cglib-nodep:3.3.0' // enables mocking of classes (in addition to interfaces) + testImplementation 'org.mockito:mockito-core:3.10.0' // mocking framework + testImplementation 'org.spockframework:spock-core:2.0-M3-groovy-3.0' + testImplementation 'org.objenesis:objenesis:3.2' // Mock creation with constructor parameters // config // implementation 'com.typesafe:config:1.4.1' - compile('com.github.carueda:tscfg_2.13:' + tscfgVersion) + implementation "com.github.carueda:tscfg_2.13:$tscfgVersion" } wrapper { - gradleVersion = '6.5.1' + gradleVersion = '7.0' } tasks.withType(JavaCompile) { diff --git a/gradle/scripts/pmd.gradle b/gradle/scripts/pmd.gradle index 8242fe1f..60eedf2a 100644 --- a/gradle/scripts/pmd.gradle +++ b/gradle/scripts/pmd.gradle @@ -1,11 +1,7 @@ // pmd is a code check tool, working on source code pmd { - ignoreFailures true // dont let the build fail on rule violations - + consoleOutput = true toolVersion = "6.24.0" - - // pmd rule priority is a range from 1 to 5, with 1 being the highest priority - // the default rule priority is 5 - rulePriority 2 + rulesMinimumPriority = 2 } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index bb8b2fc2..f371643e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/test/groovy/graphController/GraphControllerTest.groovy b/src/test/groovy/graphController/GraphControllerTest.groovy index a382fb22..6a9ef964 100644 --- a/src/test/groovy/graphController/GraphControllerTest.groovy +++ b/src/test/groovy/graphController/GraphControllerTest.groovy @@ -8,12 +8,14 @@ package graphController import com.typesafe.config.ConfigFactory import de.osmogrid.config.OsmogridConfig import de.osmogrid.controller.graph.GraphController +import de.osmogrid.model.graph.OsmGraph import de.osmogrid.model.graph.OsmGridNode import edu.ie3.datamodel.graph.DistanceWeightedGraph import edu.ie3.util.quantities.PowerSystemUnits import org.apache.commons.lang3.tuple.Pair import spock.lang.Shared import spock.lang.Specification +import tech.units.indriya.quantity.Quantities import utils.TestObjectFactory import java.util.stream.Collectors @@ -46,7 +48,7 @@ class GraphControllerTest extends Specification { when: /* Get the actual node to lat lon mapping */ - def actual = ((DistanceWeightedGraph) graphController["fullGraph"]). + def actual = ((OsmGraph) graphController["fullGraph"]). vertexSet(). parallelStream(). filter({node -> Objects.nonNull(node.getHouseConnectionPoint())}).