From fdd0973a0b440d8eb0f6d35b57ea38232d91305d Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Sun, 9 Jul 2023 13:03:57 +0200 Subject: [PATCH] Refactor package names --- .../kotlin/org/pgpainless/wot/cli/WotCLI.kt | 4 +-- .../wot/cli/subcommands/AuthenticateCmd.kt | 4 +-- .../cli/subcommands/AuthenticateCmdTest.kt | 4 ++- .../kotlin/org/pgpainless/wot/WebOfTrust.kt | 4 +-- .../wot/util/CertificationFactory.kt | 10 ++++---- .../test/kotlin/org/pgpainless/wot/PGPDSL.kt | 6 ++--- .../org/pgpainless/wot/WebOfTrustTest.kt | 6 ++--- .../wot/testfixtures/AdHocVectors.kt | 2 +- .../org/pgpainless/wot/api/AuthenticateAPI.kt | 4 +-- .../org/pgpainless/wot/api/IdentifyAPI.kt | 4 +-- .../kotlin/org/pgpainless/wot/api/ListAPI.kt | 2 +- .../org/pgpainless/wot/api/LookupAPI.kt | 2 +- .../kotlin/org/pgpainless/wot/api/PathAPI.kt | 2 +- .../kotlin/org/pgpainless/wot/api/WoTAPI.kt | 6 ++--- .../wot/{dijkstra/sq => network}/Depth.kt | 2 +- .../wot/{dijkstra/sq => network}/Edge.kt | 2 +- .../{dijkstra/sq => network}/EdgeComponent.kt | 2 +- .../{dijkstra/sq => network}/Fingerprint.kt | 2 +- .../wot/{dijkstra/sq => network}/Network.kt | 2 +- .../wot/{dijkstra/sq => network}/Node.kt | 2 +- .../{dijkstra/sq => network}/ReferenceTime.kt | 2 +- .../wot/{dijkstra/sq => network}/RegexSet.kt | 2 +- .../sq => network}/RevocationState.kt | 2 +- .../wot/{dijkstra/sq => query}/Path.kt | 5 +++- .../wot/{dijkstra/sq => query}/Paths.kt | 2 +- .../wot/dijkstra/sq/RegexSetTest.kt | 25 ------------------- .../wot/{dijkstra => network}/DepthTest.kt | 9 +++---- .../EdgeComponentTest.kt | 10 ++++---- .../wot/{dijkstra => network}/EdgeTest.kt | 3 +-- .../{dijkstra => network}/FingerprintTest.kt | 4 +-- .../wot/{dijkstra => network}/NetworkDSL.kt | 3 +-- .../wot/{dijkstra => network}/NetworkTest.kt | 8 +++--- .../wot/{dijkstra => network}/NodeTest.kt | 2 +- .../wot/{dijkstra => network}/RegexSetTest.kt | 21 ++++++++++++++-- .../RevocationStateTest.kt | 6 ++--- .../wot/{dijkstra => query}/PathTest.kt | 6 +++-- .../wot/{dijkstra => query}/PathsTest.kt | 5 ++-- 37 files changed, 91 insertions(+), 96 deletions(-) rename wot-dijkstra/src/main/kotlin/org/pgpainless/wot/{dijkstra/sq => network}/Depth.kt (98%) rename wot-dijkstra/src/main/kotlin/org/pgpainless/wot/{dijkstra/sq => network}/Edge.kt (99%) rename wot-dijkstra/src/main/kotlin/org/pgpainless/wot/{dijkstra/sq => network}/EdgeComponent.kt (98%) rename wot-dijkstra/src/main/kotlin/org/pgpainless/wot/{dijkstra/sq => network}/Fingerprint.kt (94%) rename wot-dijkstra/src/main/kotlin/org/pgpainless/wot/{dijkstra/sq => network}/Network.kt (98%) rename wot-dijkstra/src/main/kotlin/org/pgpainless/wot/{dijkstra/sq => network}/Node.kt (96%) rename wot-dijkstra/src/main/kotlin/org/pgpainless/wot/{dijkstra/sq => network}/ReferenceTime.kt (95%) rename wot-dijkstra/src/main/kotlin/org/pgpainless/wot/{dijkstra/sq => network}/RegexSet.kt (97%) rename wot-dijkstra/src/main/kotlin/org/pgpainless/wot/{dijkstra/sq => network}/RevocationState.kt (97%) rename wot-dijkstra/src/main/kotlin/org/pgpainless/wot/{dijkstra/sq => query}/Path.kt (96%) rename wot-dijkstra/src/main/kotlin/org/pgpainless/wot/{dijkstra/sq => query}/Paths.kt (96%) delete mode 100644 wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/sq/RegexSetTest.kt rename wot-dijkstra/src/test/kotlin/org/pgpainless/wot/{dijkstra => network}/DepthTest.kt (94%) rename wot-dijkstra/src/test/kotlin/org/pgpainless/wot/{dijkstra => network}/EdgeComponentTest.kt (86%) rename wot-dijkstra/src/test/kotlin/org/pgpainless/wot/{dijkstra => network}/EdgeTest.kt (98%) rename wot-dijkstra/src/test/kotlin/org/pgpainless/wot/{dijkstra => network}/FingerprintTest.kt (93%) rename wot-dijkstra/src/test/kotlin/org/pgpainless/wot/{dijkstra => network}/NetworkDSL.kt (98%) rename wot-dijkstra/src/test/kotlin/org/pgpainless/wot/{dijkstra => network}/NetworkTest.kt (90%) rename wot-dijkstra/src/test/kotlin/org/pgpainless/wot/{dijkstra => network}/NodeTest.kt (94%) rename wot-dijkstra/src/test/kotlin/org/pgpainless/wot/{dijkstra => network}/RegexSetTest.kt (74%) rename wot-dijkstra/src/test/kotlin/org/pgpainless/wot/{dijkstra => network}/RevocationStateTest.kt (96%) rename wot-dijkstra/src/test/kotlin/org/pgpainless/wot/{dijkstra => query}/PathTest.kt (95%) rename wot-dijkstra/src/test/kotlin/org/pgpainless/wot/{dijkstra => query}/PathsTest.kt (92%) diff --git a/pgpainless-wot-cli/src/main/kotlin/org/pgpainless/wot/cli/WotCLI.kt b/pgpainless-wot-cli/src/main/kotlin/org/pgpainless/wot/cli/WotCLI.kt index 493717c2..4d27cb81 100644 --- a/pgpainless-wot-cli/src/main/kotlin/org/pgpainless/wot/cli/WotCLI.kt +++ b/pgpainless-wot-cli/src/main/kotlin/org/pgpainless/wot/cli/WotCLI.kt @@ -11,8 +11,8 @@ import org.pgpainless.wot.KeyRingCertificateStore import org.pgpainless.wot.WebOfTrust import org.pgpainless.wot.api.WoTAPI import org.pgpainless.wot.cli.subcommands.* -import org.pgpainless.wot.dijkstra.sq.Fingerprint -import org.pgpainless.wot.dijkstra.sq.ReferenceTime +import org.pgpainless.wot.network.Fingerprint +import org.pgpainless.wot.network.ReferenceTime import pgp.cert_d.PGPCertificateStoreAdapter import pgp.cert_d.subkey_lookup.InMemorySubkeyLookupFactory import pgp.certificate_store.PGPCertificateStore diff --git a/pgpainless-wot-cli/src/main/kotlin/org/pgpainless/wot/cli/subcommands/AuthenticateCmd.kt b/pgpainless-wot-cli/src/main/kotlin/org/pgpainless/wot/cli/subcommands/AuthenticateCmd.kt index 92e0140d..2258a964 100644 --- a/pgpainless-wot-cli/src/main/kotlin/org/pgpainless/wot/cli/subcommands/AuthenticateCmd.kt +++ b/pgpainless-wot-cli/src/main/kotlin/org/pgpainless/wot/cli/subcommands/AuthenticateCmd.kt @@ -6,8 +6,8 @@ package org.pgpainless.wot.cli.subcommands import org.pgpainless.wot.api.AuthenticateAPI import org.pgpainless.wot.cli.WotCLI -import org.pgpainless.wot.dijkstra.sq.Fingerprint -import org.pgpainless.wot.dijkstra.sq.Path +import org.pgpainless.wot.network.Fingerprint +import org.pgpainless.wot.query.Path import picocli.CommandLine import picocli.CommandLine.Command import picocli.CommandLine.Parameters diff --git a/pgpainless-wot-cli/src/test/kotlin/org/pgpainless/wot/cli/subcommands/AuthenticateCmdTest.kt b/pgpainless-wot-cli/src/test/kotlin/org/pgpainless/wot/cli/subcommands/AuthenticateCmdTest.kt index cb1310d8..6d75423a 100644 --- a/pgpainless-wot-cli/src/test/kotlin/org/pgpainless/wot/cli/subcommands/AuthenticateCmdTest.kt +++ b/pgpainless-wot-cli/src/test/kotlin/org/pgpainless/wot/cli/subcommands/AuthenticateCmdTest.kt @@ -2,7 +2,9 @@ package org.pgpainless.wot.cli.subcommands import org.junit.jupiter.api.Test import org.pgpainless.wot.api.AuthenticateAPI -import org.pgpainless.wot.dijkstra.sq.* +import org.pgpainless.wot.network.* +import org.pgpainless.wot.query.Path +import org.pgpainless.wot.query.Paths import java.text.SimpleDateFormat import kotlin.test.assertEquals diff --git a/pgpainless-wot/src/main/kotlin/org/pgpainless/wot/WebOfTrust.kt b/pgpainless-wot/src/main/kotlin/org/pgpainless/wot/WebOfTrust.kt index 1f6dbfea..9837b66e 100644 --- a/pgpainless-wot/src/main/kotlin/org/pgpainless/wot/WebOfTrust.kt +++ b/pgpainless-wot/src/main/kotlin/org/pgpainless/wot/WebOfTrust.kt @@ -17,8 +17,8 @@ import org.pgpainless.policy.Policy import org.pgpainless.signature.SignatureUtils import org.pgpainless.signature.consumer.SignatureVerifier import org.pgpainless.signature.subpackets.SignatureSubpacketsUtil -import org.pgpainless.wot.dijkstra.sq.* -import org.pgpainless.wot.dijkstra.sq.ReferenceTime.Companion.now +import org.pgpainless.wot.network.* +import org.pgpainless.wot.network.ReferenceTime.Companion.now import org.pgpainless.wot.util.CertificationFactory.Companion.fromCertification import org.pgpainless.wot.util.CertificationFactory.Companion.fromDelegation import org.slf4j.LoggerFactory diff --git a/pgpainless-wot/src/main/kotlin/org/pgpainless/wot/util/CertificationFactory.kt b/pgpainless-wot/src/main/kotlin/org/pgpainless/wot/util/CertificationFactory.kt index 7bad1869..822ce30b 100644 --- a/pgpainless-wot/src/main/kotlin/org/pgpainless/wot/util/CertificationFactory.kt +++ b/pgpainless-wot/src/main/kotlin/org/pgpainless/wot/util/CertificationFactory.kt @@ -6,11 +6,11 @@ package org.pgpainless.wot.util import org.bouncycastle.openpgp.PGPSignature import org.pgpainless.signature.subpackets.SignatureSubpacketsUtil -import org.pgpainless.wot.dijkstra.sq.Node -import org.pgpainless.wot.dijkstra.sq.EdgeComponent -import org.pgpainless.wot.dijkstra.sq.Depth -import org.pgpainless.wot.dijkstra.sq.RegexSet -import org.pgpainless.wot.dijkstra.sq.RegexSet.Companion.fromExpressionList +import org.pgpainless.wot.network.Node +import org.pgpainless.wot.network.EdgeComponent +import org.pgpainless.wot.network.Depth +import org.pgpainless.wot.network.RegexSet +import org.pgpainless.wot.network.RegexSet.Companion.fromExpressionList class CertificationFactory { diff --git a/pgpainless-wot/src/test/kotlin/org/pgpainless/wot/PGPDSL.kt b/pgpainless-wot/src/test/kotlin/org/pgpainless/wot/PGPDSL.kt index 73547ef6..6a92224c 100644 --- a/pgpainless-wot/src/test/kotlin/org/pgpainless/wot/PGPDSL.kt +++ b/pgpainless-wot/src/test/kotlin/org/pgpainless/wot/PGPDSL.kt @@ -5,9 +5,9 @@ import org.bouncycastle.openpgp.PGPSignature import org.pgpainless.algorithm.RevocationStateType import org.pgpainless.key.OpenPgpFingerprint import org.pgpainless.key.info.KeyRingInfo -import org.pgpainless.wot.dijkstra.sq.Node -import org.pgpainless.wot.dijkstra.sq.Fingerprint -import org.pgpainless.wot.dijkstra.sq.RevocationState +import org.pgpainless.wot.network.Node +import org.pgpainless.wot.network.Fingerprint +import org.pgpainless.wot.network.RevocationState interface PGPDSL { diff --git a/pgpainless-wot/src/test/kotlin/org/pgpainless/wot/WebOfTrustTest.kt b/pgpainless-wot/src/test/kotlin/org/pgpainless/wot/WebOfTrustTest.kt index 426a1d70..10a874fb 100644 --- a/pgpainless-wot/src/test/kotlin/org/pgpainless/wot/WebOfTrustTest.kt +++ b/pgpainless-wot/src/test/kotlin/org/pgpainless/wot/WebOfTrustTest.kt @@ -7,9 +7,9 @@ package org.pgpainless.wot import org.bouncycastle.openpgp.PGPPublicKeyRing import org.pgpainless.key.OpenPgpFingerprint -import org.pgpainless.wot.dijkstra.sq.Edge -import org.pgpainless.wot.dijkstra.sq.Fingerprint -import org.pgpainless.wot.dijkstra.sq.Network +import org.pgpainless.wot.network.Edge +import org.pgpainless.wot.network.Fingerprint +import org.pgpainless.wot.network.Network import org.pgpainless.wot.testfixtures.TestCertificateStores import org.pgpainless.wot.testfixtures.WotTestVectors import kotlin.test.assertEquals diff --git a/pgpainless-wot/src/testFixtures/kotlin/org/pgpainless/wot/testfixtures/AdHocVectors.kt b/pgpainless-wot/src/testFixtures/kotlin/org/pgpainless/wot/testfixtures/AdHocVectors.kt index 20f1c4f1..dded80c7 100644 --- a/pgpainless-wot/src/testFixtures/kotlin/org/pgpainless/wot/testfixtures/AdHocVectors.kt +++ b/pgpainless-wot/src/testFixtures/kotlin/org/pgpainless/wot/testfixtures/AdHocVectors.kt @@ -11,7 +11,7 @@ import org.pgpainless.key.protection.SecretKeyRingProtector import org.pgpainless.signature.subpackets.CertificationSubpackets import org.pgpainless.signature.subpackets.CertificationSubpackets.Callback import org.pgpainless.wot.KeyRingCertificateStore -import org.pgpainless.wot.dijkstra.sq.Fingerprint +import org.pgpainless.wot.network.Fingerprint import pgp.certificate_store.PGPCertificateStore interface AdHocVectors { diff --git a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/AuthenticateAPI.kt b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/AuthenticateAPI.kt index cd19a7e4..e90f8008 100644 --- a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/AuthenticateAPI.kt +++ b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/AuthenticateAPI.kt @@ -4,8 +4,8 @@ package org.pgpainless.wot.api -import org.pgpainless.wot.dijkstra.sq.Fingerprint -import org.pgpainless.wot.dijkstra.sq.Paths +import org.pgpainless.wot.network.Fingerprint +import org.pgpainless.wot.query.Paths /** * Authenticate a binding. diff --git a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/IdentifyAPI.kt b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/IdentifyAPI.kt index 647fdafb..67e3809e 100644 --- a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/IdentifyAPI.kt +++ b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/IdentifyAPI.kt @@ -4,8 +4,8 @@ package org.pgpainless.wot.api -import org.pgpainless.wot.dijkstra.sq.Fingerprint -import org.pgpainless.wot.dijkstra.sq.Paths +import org.pgpainless.wot.network.Fingerprint +import org.pgpainless.wot.query.Paths interface IdentifyAPI { diff --git a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/ListAPI.kt b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/ListAPI.kt index cf64e056..3c321d50 100644 --- a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/ListAPI.kt +++ b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/ListAPI.kt @@ -4,7 +4,7 @@ package org.pgpainless.wot.api -import org.pgpainless.wot.dijkstra.sq.Paths +import org.pgpainless.wot.query.Paths interface ListAPI { diff --git a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/LookupAPI.kt b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/LookupAPI.kt index 09ff9f75..bb4f5725 100644 --- a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/LookupAPI.kt +++ b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/LookupAPI.kt @@ -4,7 +4,7 @@ package org.pgpainless.wot.api -import org.pgpainless.wot.dijkstra.sq.Paths +import org.pgpainless.wot.query.Paths interface LookupAPI { diff --git a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/PathAPI.kt b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/PathAPI.kt index 01faa9f9..b3b5af16 100644 --- a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/PathAPI.kt +++ b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/PathAPI.kt @@ -4,7 +4,7 @@ package org.pgpainless.wot.api -import org.pgpainless.wot.dijkstra.sq.Fingerprint +import org.pgpainless.wot.network.Fingerprint interface PathAPI { diff --git a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/WoTAPI.kt b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/WoTAPI.kt index ce778c32..9dc11e78 100644 --- a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/WoTAPI.kt +++ b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/api/WoTAPI.kt @@ -4,9 +4,9 @@ package org.pgpainless.wot.api -import org.pgpainless.wot.dijkstra.sq.Fingerprint -import org.pgpainless.wot.dijkstra.sq.Network -import org.pgpainless.wot.dijkstra.sq.ReferenceTime +import org.pgpainless.wot.network.Fingerprint +import org.pgpainless.wot.network.Network +import org.pgpainless.wot.network.ReferenceTime /** * Web of Trust API, offering different operations. diff --git a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Depth.kt b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/Depth.kt similarity index 98% rename from wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Depth.kt rename to wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/Depth.kt index 9c0bbe0d..6864c760 100644 --- a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Depth.kt +++ b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/Depth.kt @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: Apache-2.0 -package org.pgpainless.wot.dijkstra.sq +package org.pgpainless.wot.network /** * Depth of a trust signature. diff --git a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Edge.kt b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/Edge.kt similarity index 99% rename from wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Edge.kt rename to wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/Edge.kt index 5b75cffa..2042cdbb 100644 --- a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Edge.kt +++ b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/Edge.kt @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: Apache-2.0 -package org.pgpainless.wot.dijkstra.sq +package org.pgpainless.wot.network /** * An [Edge] is a set of [components][EdgeComponent] made by the same issuer, on the same diff --git a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/EdgeComponent.kt b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/EdgeComponent.kt similarity index 98% rename from wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/EdgeComponent.kt rename to wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/EdgeComponent.kt index e1ca6abd..2d33bca6 100644 --- a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/EdgeComponent.kt +++ b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/EdgeComponent.kt @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: Apache-2.0 -package org.pgpainless.wot.dijkstra.sq +package org.pgpainless.wot.network import java.util.* diff --git a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Fingerprint.kt b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/Fingerprint.kt similarity index 94% rename from wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Fingerprint.kt rename to wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/Fingerprint.kt index f05b4ff6..4e3ae215 100644 --- a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Fingerprint.kt +++ b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/Fingerprint.kt @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: Apache-2.0 -package org.pgpainless.wot.dijkstra.sq +package org.pgpainless.wot.network class Fingerprint(fingerprint: String) : Comparable { diff --git a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Network.kt b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/Network.kt similarity index 98% rename from wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Network.kt rename to wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/Network.kt index 69ddf0e0..e1f699d7 100644 --- a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Network.kt +++ b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/Network.kt @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: Apache-2.0 -package org.pgpainless.wot.dijkstra.sq +package org.pgpainless.wot.network /** * A network consists of nodes, and edges between them. diff --git a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Node.kt b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/Node.kt similarity index 96% rename from wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Node.kt rename to wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/Node.kt index 662ba134..f372231e 100644 --- a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Node.kt +++ b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/Node.kt @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: Apache-2.0 -package org.pgpainless.wot.dijkstra.sq +package org.pgpainless.wot.network import java.util.* diff --git a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/ReferenceTime.kt b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/ReferenceTime.kt similarity index 95% rename from wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/ReferenceTime.kt rename to wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/ReferenceTime.kt index 178420dc..878fc1c5 100644 --- a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/ReferenceTime.kt +++ b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/ReferenceTime.kt @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: Apache-2.0 -package org.pgpainless.wot.dijkstra.sq +package org.pgpainless.wot.network import java.util.* diff --git a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/RegexSet.kt b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/RegexSet.kt similarity index 97% rename from wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/RegexSet.kt rename to wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/RegexSet.kt index d9230db7..9b2f8de8 100644 --- a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/RegexSet.kt +++ b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/RegexSet.kt @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: Apache-2.0 -package org.pgpainless.wot.dijkstra.sq +package org.pgpainless.wot.network import java.util.regex.Pattern diff --git a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/RevocationState.kt b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/RevocationState.kt similarity index 97% rename from wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/RevocationState.kt rename to wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/RevocationState.kt index b04c3dba..6f2466b0 100644 --- a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/RevocationState.kt +++ b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/network/RevocationState.kt @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: Apache-2.0 -package org.pgpainless.wot.dijkstra.sq +package org.pgpainless.wot.network import java.util.* import kotlin.math.abs diff --git a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Path.kt b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/query/Path.kt similarity index 96% rename from wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Path.kt rename to wot-dijkstra/src/main/kotlin/org/pgpainless/wot/query/Path.kt index fd2429a5..777f710c 100644 --- a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Path.kt +++ b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/query/Path.kt @@ -2,8 +2,11 @@ // // SPDX-License-Identifier: Apache-2.0 -package org.pgpainless.wot.dijkstra.sq +package org.pgpainless.wot.query +import org.pgpainless.wot.network.Depth +import org.pgpainless.wot.network.EdgeComponent +import org.pgpainless.wot.network.Node import kotlin.math.min /** diff --git a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Paths.kt b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/query/Paths.kt similarity index 96% rename from wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Paths.kt rename to wot-dijkstra/src/main/kotlin/org/pgpainless/wot/query/Paths.kt index 175bbdad..e618acb3 100644 --- a/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/dijkstra/sq/Paths.kt +++ b/wot-dijkstra/src/main/kotlin/org/pgpainless/wot/query/Paths.kt @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: Apache-2.0 -package org.pgpainless.wot.dijkstra.sq +package org.pgpainless.wot.query /** * List of individual [Paths][Path]. diff --git a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/sq/RegexSetTest.kt b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/sq/RegexSetTest.kt deleted file mode 100644 index daa7a17f..00000000 --- a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/sq/RegexSetTest.kt +++ /dev/null @@ -1,25 +0,0 @@ -package org.pgpainless.wot.dijkstra.sq - -import kotlin.test.Test - -class RegexSetTest { - - @Test - fun simpleMatch() { - val stringList: List = listOf("<[^>]+[@.]foobank\\.com>$") - val rs = RegexSet.fromExpressionList(stringList); - - assert(rs.matches("Foo Bank Employee ")) - assert(rs.matches("")) - } - - @Test - fun simpleNonMatch() { - val stringList: List = listOf("<[^>]+[@.]foobank\\.com>$") - val rs = RegexSet.fromExpressionList(stringList); - - assert(!rs.matches("Bar Bank Employee ")) - assert(!rs.matches("")) - } - -} \ No newline at end of file diff --git a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/DepthTest.kt b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/DepthTest.kt similarity index 94% rename from wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/DepthTest.kt rename to wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/DepthTest.kt index 8eb4d14d..855fc604 100644 --- a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/DepthTest.kt +++ b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/DepthTest.kt @@ -2,14 +2,13 @@ // // SPDX-License-Identifier: Apache-2.0 -package org.pgpainless.wot.dijkstra +package org.pgpainless.wot.network import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows -import org.pgpainless.wot.dijkstra.sq.Depth -import org.pgpainless.wot.dijkstra.sq.Depth.Companion.auto -import org.pgpainless.wot.dijkstra.sq.Depth.Companion.limited -import org.pgpainless.wot.dijkstra.sq.Depth.Companion.unconstrained +import org.pgpainless.wot.network.Depth.Companion.auto +import org.pgpainless.wot.network.Depth.Companion.limited +import org.pgpainless.wot.network.Depth.Companion.unconstrained import kotlin.test.* class DepthTest { diff --git a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/EdgeComponentTest.kt b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/EdgeComponentTest.kt similarity index 86% rename from wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/EdgeComponentTest.kt rename to wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/EdgeComponentTest.kt index 06d2a519..e008dfc6 100644 --- a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/EdgeComponentTest.kt +++ b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/EdgeComponentTest.kt @@ -1,10 +1,10 @@ -package org.pgpainless.wot.dijkstra +package org.pgpainless.wot.network import org.junit.jupiter.api.Test -import org.pgpainless.wot.dijkstra.sq.Node -import org.pgpainless.wot.dijkstra.sq.EdgeComponent -import org.pgpainless.wot.dijkstra.sq.Fingerprint -import org.pgpainless.wot.dijkstra.sq.RevocationState +import org.pgpainless.wot.network.Node +import org.pgpainless.wot.network.EdgeComponent +import org.pgpainless.wot.network.Fingerprint +import org.pgpainless.wot.network.RevocationState import java.util.* import kotlin.test.assertEquals diff --git a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/EdgeTest.kt b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/EdgeTest.kt similarity index 98% rename from wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/EdgeTest.kt rename to wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/EdgeTest.kt index da4b1946..42199c12 100644 --- a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/EdgeTest.kt +++ b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/EdgeTest.kt @@ -2,11 +2,10 @@ // // SPDX-License-Identifier: Apache-2.0 -package org.pgpainless.wot.dijkstra +package org.pgpainless.wot.network import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows -import org.pgpainless.wot.dijkstra.sq.* import java.util.* import kotlin.test.assertEquals import kotlin.test.assertTrue diff --git a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/FingerprintTest.kt b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/FingerprintTest.kt similarity index 93% rename from wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/FingerprintTest.kt rename to wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/FingerprintTest.kt index f710c337..3c017f87 100644 --- a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/FingerprintTest.kt +++ b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/FingerprintTest.kt @@ -1,7 +1,7 @@ -package org.pgpainless.wot.dijkstra +package org.pgpainless.wot.network import org.junit.jupiter.api.Test -import org.pgpainless.wot.dijkstra.sq.Fingerprint +import org.pgpainless.wot.network.Fingerprint import kotlin.test.assertEquals import kotlin.test.assertFalse diff --git a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/NetworkDSL.kt b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/NetworkDSL.kt similarity index 98% rename from wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/NetworkDSL.kt rename to wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/NetworkDSL.kt index fb52748a..24230680 100644 --- a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/NetworkDSL.kt +++ b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/NetworkDSL.kt @@ -2,9 +2,8 @@ // // SPDX-License-Identifier: Apache-2.0 -package org.pgpainless.wot.dijkstra +package org.pgpainless.wot.network -import org.pgpainless.wot.dijkstra.sq.* import java.util.* /** diff --git a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/NetworkTest.kt b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/NetworkTest.kt similarity index 90% rename from wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/NetworkTest.kt rename to wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/NetworkTest.kt index 0e96b434..c6b6ec28 100644 --- a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/NetworkTest.kt +++ b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/NetworkTest.kt @@ -2,13 +2,11 @@ // // SPDX-License-Identifier: Apache-2.0 -package org.pgpainless.wot.dijkstra +package org.pgpainless.wot.network import org.junit.jupiter.api.Test -import org.pgpainless.wot.dijkstra.sq.Fingerprint -import org.pgpainless.wot.dijkstra.sq.Network.Companion.empty -import org.pgpainless.wot.dijkstra.sq.ReferenceTime.Companion.now -import org.pgpainless.wot.dijkstra.sq.RegexSet +import org.pgpainless.wot.network.Network.Companion.empty +import org.pgpainless.wot.network.ReferenceTime.Companion.now import kotlin.test.assertEquals import kotlin.test.assertTrue diff --git a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/NodeTest.kt b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/NodeTest.kt similarity index 94% rename from wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/NodeTest.kt rename to wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/NodeTest.kt index dcda67fb..04592dcf 100644 --- a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/NodeTest.kt +++ b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/NodeTest.kt @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: Apache-2.0 -package org.pgpainless.wot.dijkstra +package org.pgpainless.wot.network import org.junit.jupiter.api.Test import kotlin.test.assertEquals diff --git a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/RegexSetTest.kt b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/RegexSetTest.kt similarity index 74% rename from wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/RegexSetTest.kt rename to wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/RegexSetTest.kt index 0b133224..4414e47c 100644 --- a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/RegexSetTest.kt +++ b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/RegexSetTest.kt @@ -1,7 +1,6 @@ -package org.pgpainless.wot.dijkstra +package org.pgpainless.wot.network import org.junit.jupiter.api.Test -import org.pgpainless.wot.dijkstra.sq.RegexSet import kotlin.test.assertFalse import kotlin.test.assertTrue @@ -10,6 +9,24 @@ class RegexSetTest: NetworkDSL { private val exampleComRegex = "<[^>]+[@.]example\\.com>\$" private val pgpainlessOrgRegex = "<[^>]+[@.]pgpainless\\.org>\$" + @Test + fun simpleMatch() { + val stringList: List = listOf("<[^>]+[@.]foobank\\.com>$") + val rs = RegexSet.fromExpressionList(stringList); + + assert(rs.matches("Foo Bank Employee ")) + assert(rs.matches("")) + } + + @Test + fun simpleNonMatch() { + val stringList: List = listOf("<[^>]+[@.]foobank\\.com>$") + val rs = RegexSet.fromExpressionList(stringList); + + assert(!rs.matches("Bar Bank Employee ")) + assert(!rs.matches("")) + } + @Test fun `verify that the wildcard RegexSet matches anything`() { val wildcard = RegexSet.wildcard() diff --git a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/RevocationStateTest.kt b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/RevocationStateTest.kt similarity index 96% rename from wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/RevocationStateTest.kt rename to wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/RevocationStateTest.kt index 4182c37a..b71c505f 100644 --- a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/RevocationStateTest.kt +++ b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/network/RevocationStateTest.kt @@ -1,8 +1,8 @@ -package org.pgpainless.wot.dijkstra +package org.pgpainless.wot.network import org.junit.jupiter.api.Test -import org.pgpainless.wot.dijkstra.sq.ReferenceTime -import org.pgpainless.wot.dijkstra.sq.RevocationState +import org.pgpainless.wot.network.ReferenceTime +import org.pgpainless.wot.network.RevocationState import java.util.* import kotlin.test.assertFalse import kotlin.test.assertTrue diff --git a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/PathTest.kt b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/query/PathTest.kt similarity index 95% rename from wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/PathTest.kt rename to wot-dijkstra/src/test/kotlin/org/pgpainless/wot/query/PathTest.kt index 3b2188db..99441d92 100644 --- a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/PathTest.kt +++ b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/query/PathTest.kt @@ -1,8 +1,10 @@ -package org.pgpainless.wot.dijkstra +package org.pgpainless.wot.query import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows -import org.pgpainless.wot.dijkstra.sq.* +import org.pgpainless.wot.network.Depth +import org.pgpainless.wot.network.NetworkDSL +import org.pgpainless.wot.query.Path import kotlin.test.assertEquals import kotlin.test.assertTrue diff --git a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/PathsTest.kt b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/query/PathsTest.kt similarity index 92% rename from wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/PathsTest.kt rename to wot-dijkstra/src/test/kotlin/org/pgpainless/wot/query/PathsTest.kt index 0f2b3993..f2f54bb1 100644 --- a/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/dijkstra/PathsTest.kt +++ b/wot-dijkstra/src/test/kotlin/org/pgpainless/wot/query/PathsTest.kt @@ -1,8 +1,9 @@ -package org.pgpainless.wot.dijkstra +package org.pgpainless.wot.query import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows -import org.pgpainless.wot.dijkstra.sq.* +import org.pgpainless.wot.network.Depth +import org.pgpainless.wot.network.NetworkDSL import kotlin.test.assertEquals class PathsTest: NetworkDSL {