From 9183eeb8e66543a417aba6162ce7c764bc4628fb Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Sun, 9 Jul 2023 12:03:58 +0200 Subject: [PATCH] Move Network DSL to testFixtures so we can reuse it in pgpainless-wot tests --- wot-dijkstra/build.gradle | 1 + .../src/test/kotlin/org/pgpainless/wot/network/NetworkTest.kt | 1 + .../src/test/kotlin/org/pgpainless/wot/network/NodeTest.kt | 1 + .../src/test/kotlin/org/pgpainless/wot/network/RegexSetTest.kt | 3 +-- .../src/test/kotlin/org/pgpainless/wot/query/PathTest.kt | 3 +-- .../src/test/kotlin/org/pgpainless/wot/query/PathsTest.kt | 2 +- .../kotlin/org/pgpainless/wot/dsl}/NetworkDSL.kt | 3 ++- 7 files changed, 8 insertions(+), 6 deletions(-) rename wot-dijkstra/src/{test/kotlin/org/pgpainless/wot/network => testFixtures/kotlin/org/pgpainless/wot/dsl}/NetworkDSL.kt (99%) diff --git a/wot-dijkstra/build.gradle b/wot-dijkstra/build.gradle index 59597c52..f7e219f9 100644 --- a/wot-dijkstra/build.gradle +++ b/wot-dijkstra/build.gradle @@ -13,6 +13,7 @@ buildscript { plugins { id 'java-library' + id 'java-test-fixtures' id 'org.jetbrains.kotlin.jvm' version "$kotlinVersion" } diff --git a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/NetworkTest.kt b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/NetworkTest.kt index c6b6ec28..72e35a8d 100644 --- a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/NetworkTest.kt +++ b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/NetworkTest.kt @@ -5,6 +5,7 @@ package org.pgpainless.wot.network import org.junit.jupiter.api.Test +import org.pgpainless.wot.dsl.NetworkDSL import org.pgpainless.wot.network.Network.Companion.empty import org.pgpainless.wot.network.ReferenceTime.Companion.now import kotlin.test.assertEquals diff --git a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/NodeTest.kt b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/NodeTest.kt index 04592dcf..3411b838 100644 --- a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/NodeTest.kt +++ b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/NodeTest.kt @@ -5,6 +5,7 @@ package org.pgpainless.wot.network import org.junit.jupiter.api.Test +import org.pgpainless.wot.dsl.NetworkDSL import kotlin.test.assertEquals class NodeTest: NetworkDSL { diff --git a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/RegexSetTest.kt b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/RegexSetTest.kt index 9aa8431a..c926a913 100644 --- a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/RegexSetTest.kt +++ b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/RegexSetTest.kt @@ -1,8 +1,7 @@ package org.pgpainless.wot.network import org.junit.jupiter.api.Test -import org.pgpainless.wot.network.NetworkDSL -import org.pgpainless.wot.network.RegexSet +import org.pgpainless.wot.dsl.NetworkDSL import kotlin.test.assertFalse import kotlin.test.assertTrue diff --git a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/query/PathTest.kt b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/query/PathTest.kt index 49e9afbb..4561c5ac 100644 --- a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/query/PathTest.kt +++ b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/query/PathTest.kt @@ -3,8 +3,7 @@ package org.pgpainless.wot.query import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import org.pgpainless.wot.network.Depth -import org.pgpainless.wot.network.NetworkDSL -import org.pgpainless.wot.query.Path +import org.pgpainless.wot.dsl.NetworkDSL import kotlin.test.assertEquals import kotlin.test.assertTrue diff --git a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/query/PathsTest.kt b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/query/PathsTest.kt index 9f960331..79079df4 100644 --- a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/query/PathsTest.kt +++ b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/query/PathsTest.kt @@ -3,7 +3,7 @@ package org.pgpainless.wot.query import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import org.pgpainless.wot.network.Depth -import org.pgpainless.wot.network.NetworkDSL +import org.pgpainless.wot.dsl.NetworkDSL import kotlin.test.assertEquals class PathsTest: NetworkDSL { diff --git a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/NetworkDSL.kt b/wot-dijkstra/src/testFixtures/kotlin/org/pgpainless/wot/dsl/NetworkDSL.kt similarity index 99% rename from wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/NetworkDSL.kt rename to wot-dijkstra/src/testFixtures/kotlin/org/pgpainless/wot/dsl/NetworkDSL.kt index 5352add7..3709216a 100644 --- a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/NetworkDSL.kt +++ b/wot-dijkstra/src/testFixtures/kotlin/org/pgpainless/wot/dsl/NetworkDSL.kt @@ -2,8 +2,9 @@ // // SPDX-License-Identifier: Apache-2.0 -package org.pgpainless.wot.network +package org.pgpainless.wot.dsl +import org.pgpainless.wot.network.* import java.util.* /**