From 8afad6cea838c1f26482741fbf0071636fe8a905 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Mon, 19 Jun 2023 11:26:20 +0200 Subject: [PATCH] Please checkstyle --- .../java/org/pgpainless/wot/WebOfTrust.java | 4 ++++ .../wot/WebOfTrustCertificateStore.java | 4 ++++ .../java/org/pgpainless/wot/package-info.java | 8 +++++++ .../org/pgpainless/wot/dijkstra/Cost.java | 4 ++++ .../org/pgpainless/wot/dijkstra/Dijkstra.java | 4 ++++ .../org/pgpainless/wot/dijkstra/Edge.java | 4 ++++ .../org/pgpainless/wot/dijkstra/Graph.java | 4 ++++ .../pgpainless/wot/dijkstra/IntegerUtils.java | 24 +++++++++++++++++++ .../org/pgpainless/wot/dijkstra/Node.java | 4 ++++ .../org/pgpainless/wot/dijkstra/Path.java | 4 ++++ .../wot/dijkstra/ShortestPathDijkstra.java | 4 ++++ .../pgpainless/wot/dijkstra/SimpleEdge.java | 4 ++++ .../pgpainless/wot/dijkstra/TrustEdge.java | 6 ++++- .../pgpainless/wot/dijkstra/WotDijkstra.java | 4 ++++ .../pgpainless/wot/dijkstra/package-info.java | 8 +++++++ .../wot/dijkstra/sq/CertSynopsis.java | 4 ++++ .../wot/dijkstra/sq/Certification.java | 8 +++++-- .../wot/dijkstra/sq/CertificationSet.java | 8 +++++-- .../org/pgpainless/wot/dijkstra/sq/Depth.java | 10 ++++++-- .../pgpainless/wot/dijkstra/sq/Network.java | 9 ++++--- .../pgpainless/wot/dijkstra/sq/Optional.java | 6 ++++- .../org/pgpainless/wot/dijkstra/sq/Path.java | 4 ++++ .../org/pgpainless/wot/dijkstra/sq/Paths.java | 4 ++++ .../wot/dijkstra/sq/ReferenceTime.java | 4 ++++ .../pgpainless/wot/dijkstra/sq/RegexSet.java | 6 ++++- .../wot/dijkstra/sq/package-info.java | 8 +++++++ .../BasicShortestPathDijkstraTest.java | 4 ++++ .../org/pgpainless/wot/dijkstra/NodeTest.java | 4 ++++ .../pgpainless/wot/dijkstra/sq/DepthTest.java | 4 ++++ .../wot/dijkstra/sq/NetworkTest.java | 13 ++++------ .../wot/dijkstra/sq/WotTestVectors.java | 6 +++++ 31 files changed, 172 insertions(+), 20 deletions(-) create mode 100644 pgpainless-wot/src/main/java/org/pgpainless/wot/package-info.java create mode 100644 wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/IntegerUtils.java create mode 100644 wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/package-info.java create mode 100644 wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/package-info.java diff --git a/pgpainless-wot/src/main/java/org/pgpainless/wot/WebOfTrust.java b/pgpainless-wot/src/main/java/org/pgpainless/wot/WebOfTrust.java index a582885f..6c885207 100644 --- a/pgpainless-wot/src/main/java/org/pgpainless/wot/WebOfTrust.java +++ b/pgpainless-wot/src/main/java/org/pgpainless/wot/WebOfTrust.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot; import org.bouncycastle.openpgp.PGPPublicKeyRing; diff --git a/pgpainless-wot/src/main/java/org/pgpainless/wot/WebOfTrustCertificateStore.java b/pgpainless-wot/src/main/java/org/pgpainless/wot/WebOfTrustCertificateStore.java index a3a55590..e3a94295 100644 --- a/pgpainless-wot/src/main/java/org/pgpainless/wot/WebOfTrustCertificateStore.java +++ b/pgpainless-wot/src/main/java/org/pgpainless/wot/WebOfTrustCertificateStore.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot; import pgp.cert_d.PGPCertificateDirectory; diff --git a/pgpainless-wot/src/main/java/org/pgpainless/wot/package-info.java b/pgpainless-wot/src/main/java/org/pgpainless/wot/package-info.java new file mode 100644 index 00000000..c35fe768 --- /dev/null +++ b/pgpainless-wot/src/main/java/org/pgpainless/wot/package-info.java @@ -0,0 +1,8 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + +/** + * PGPainless API for Web of Trust. + */ +package org.pgpainless.wot; diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Cost.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Cost.java index e8ca7de9..7497c433 100644 --- a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Cost.java +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Cost.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra; public class Cost { diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Dijkstra.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Dijkstra.java index 7f340c2d..e23fc57a 100644 --- a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Dijkstra.java +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Dijkstra.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra; import javax.annotation.Nullable; diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Edge.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Edge.java index 2f6d9256..ea373a68 100644 --- a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Edge.java +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Edge.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra; public abstract class Edge implements Comparable { diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Graph.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Graph.java index 3069c92f..f4bc8977 100644 --- a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Graph.java +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Graph.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra; import java.util.Collection; diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/IntegerUtils.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/IntegerUtils.java new file mode 100644 index 00000000..378858f3 --- /dev/null +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/IntegerUtils.java @@ -0,0 +1,24 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + +package org.pgpainless.wot.dijkstra; + +public final class IntegerUtils { + + private IntegerUtils() { + + } + + /** + * Backported method from Java 8. + * + * @param x x + * @param y y + * @return result of comparison + */ + public static int compare(int x, int y) { + // noinspection UseCompareMethod + return x < y ? -1 : (x == y ? 0 : 1); + } +} diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Node.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Node.java index 5d125301..9bdd2b43 100644 --- a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Node.java +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Node.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra; public class Node { diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Path.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Path.java index 10469d12..38887589 100644 --- a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Path.java +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/Path.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra; import java.util.Arrays; diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/ShortestPathDijkstra.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/ShortestPathDijkstra.java index 6d2436d9..26016acb 100644 --- a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/ShortestPathDijkstra.java +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/ShortestPathDijkstra.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra; import javax.annotation.Nullable; diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/SimpleEdge.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/SimpleEdge.java index 4b8d5900..76562c08 100644 --- a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/SimpleEdge.java +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/SimpleEdge.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra; public class SimpleEdge extends Edge { diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/TrustEdge.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/TrustEdge.java index 753fceec..bc134e41 100644 --- a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/TrustEdge.java +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/TrustEdge.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra; import javax.annotation.Nonnull; @@ -12,7 +16,7 @@ public class TrustEdge extends Edge { public int compareTo(@Nonnull Cost.TrustCost o) { int depthCompare = Double.compare(cost.getDepth(), o.getDepth()); if (depthCompare != 0) { - return - depthCompare; + return -depthCompare; } return Double.compare(cost.getAmount(), o.getAmount()); } diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/WotDijkstra.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/WotDijkstra.java index 5a63d3b8..359138f4 100644 --- a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/WotDijkstra.java +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/WotDijkstra.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra; import javax.annotation.Nullable; diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/package-info.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/package-info.java new file mode 100644 index 00000000..4b95a2dc --- /dev/null +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/package-info.java @@ -0,0 +1,8 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + +/** + * Dijkstra-based WoT implementation using a flow network. + */ +package org.pgpainless.wot.dijkstra; diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/CertSynopsis.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/CertSynopsis.java index f7f8d9c7..43d3ef18 100644 --- a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/CertSynopsis.java +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/CertSynopsis.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra.sq; import org.pgpainless.algorithm.RevocationState; diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Certification.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Certification.java index 91615c04..23e1e36a 100644 --- a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Certification.java +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Certification.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra.sq; import java.util.Date; @@ -38,7 +42,7 @@ public class Certification { this.creationTime = creationTime; this.expirationTime = expirationTime; this.exportable = exportable; - this.trustAmount= trustAmount; + this.trustAmount = trustAmount; this.trustDepth = trustDepth; this.regex = regex; } @@ -110,7 +114,7 @@ public class Certification { } /** - * Get the creation time of the certification, + * Get the creation time of the certification. * * @return creation time */ diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/CertificationSet.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/CertificationSet.java index a74c28e2..5a073cc1 100644 --- a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/CertificationSet.java +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/CertificationSet.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra.sq; import java.util.ArrayList; @@ -9,7 +13,7 @@ import org.bouncycastle.openpgp.PGPSignature; import javax.annotation.Nonnull; -public class CertificationSet { +public final class CertificationSet { private final CertSynopsis issuer; private final CertSynopsis target; @@ -98,7 +102,7 @@ public class CertificationSet { } List certificationsForUserId = certifications.get(certification.getUserId()); - //noinspection Java8MapApi + // noinspection Java8MapApi if (certificationsForUserId == null) { certificationsForUserId = new ArrayList<>(); certifications.put(certification.getUserId(), certificationsForUserId); diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Depth.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Depth.java index 78cf0238..18968424 100644 --- a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Depth.java +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Depth.java @@ -1,8 +1,14 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra.sq; +import org.pgpainless.wot.dijkstra.IntegerUtils; + import javax.annotation.Nonnull; -public class Depth implements Comparable { +public final class Depth implements Comparable { private final Optional depth; @@ -55,7 +61,7 @@ public class Depth implements Comparable { if (o.isUnconstrained()) { return -1; } else { - return Integer.compare(getLimit().get(), o.getLimit().get()); + return IntegerUtils.compare(getLimit().get(), o.getLimit().get()); } } } diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Network.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Network.java index e237f9ce..171431c9 100644 --- a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Network.java +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Network.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra.sq; import java.util.ArrayList; @@ -12,7 +16,6 @@ import org.bouncycastle.openpgp.PGPPublicKeyRing; import org.bouncycastle.openpgp.PGPSignature; import org.pgpainless.algorithm.KeyFlag; import org.pgpainless.algorithm.RevocationState; -import org.pgpainless.algorithm.RevocationStateType; import org.pgpainless.key.OpenPgpFingerprint; import org.pgpainless.key.info.KeyRingInfo; import org.pgpainless.key.util.RevocationAttributes; @@ -96,13 +99,13 @@ public class Network { Map certSynopsisMap = new HashMap<>(); for (KeyRingInfo cert : validatedCertificates) { - //noinspection Java8MapApi + // noinspection Java8MapApi if (byFingerprint.get(cert.getFingerprint()) == null) { byFingerprint.put(cert.getFingerprint(), cert); } List byKeyIdEntry = byKeyId.get(cert.getKeyId()); - //noinspection Java8MapApi + // noinspection Java8MapApi if (byKeyIdEntry == null) { byKeyIdEntry = new ArrayList<>(); byKeyId.put(cert.getKeyId(), byKeyIdEntry); diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Optional.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Optional.java index c0457fd1..57875fcd 100644 --- a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Optional.java +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Optional.java @@ -1,9 +1,13 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra.sq; import javax.annotation.Nonnull; import javax.annotation.Nullable; -public class Optional { +public final class Optional { private final T item; diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Path.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Path.java index 69f3526a..1f40c9ca 100644 --- a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Path.java +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Path.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra.sq; import java.util.ArrayList; diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Paths.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Paths.java index 928564a5..0e96ef35 100644 --- a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Paths.java +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/Paths.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra.sq; import java.util.ArrayList; diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/ReferenceTime.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/ReferenceTime.java index 1e525891..7db98a0e 100644 --- a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/ReferenceTime.java +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/ReferenceTime.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra.sq; import javax.annotation.Nonnull; diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/RegexSet.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/RegexSet.java index 3af6a578..65d80f2e 100644 --- a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/RegexSet.java +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/RegexSet.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra.sq; import java.util.Collections; @@ -10,7 +14,7 @@ import javax.annotation.Nonnull; import org.bouncycastle.bcpg.sig.RegularExpression; -public class RegexSet { +public final class RegexSet { private final Set regexStrings; diff --git a/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/package-info.java b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/package-info.java new file mode 100644 index 00000000..74c154b2 --- /dev/null +++ b/wot-dijkstra/src/main/java/org/pgpainless/wot/dijkstra/sq/package-info.java @@ -0,0 +1,8 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + +/** + * Web of Trust implementation. + */ +package org.pgpainless.wot.dijkstra.sq; diff --git a/wot-dijkstra/src/test/java/org/pgpainless/wot/dijkstra/BasicShortestPathDijkstraTest.java b/wot-dijkstra/src/test/java/org/pgpainless/wot/dijkstra/BasicShortestPathDijkstraTest.java index 00a7fc8c..0aa71363 100644 --- a/wot-dijkstra/src/test/java/org/pgpainless/wot/dijkstra/BasicShortestPathDijkstraTest.java +++ b/wot-dijkstra/src/test/java/org/pgpainless/wot/dijkstra/BasicShortestPathDijkstraTest.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/wot-dijkstra/src/test/java/org/pgpainless/wot/dijkstra/NodeTest.java b/wot-dijkstra/src/test/java/org/pgpainless/wot/dijkstra/NodeTest.java index 8cd5e886..417a15e4 100644 --- a/wot-dijkstra/src/test/java/org/pgpainless/wot/dijkstra/NodeTest.java +++ b/wot-dijkstra/src/test/java/org/pgpainless/wot/dijkstra/NodeTest.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra; import org.junit.jupiter.api.Test; diff --git a/wot-dijkstra/src/test/java/org/pgpainless/wot/dijkstra/sq/DepthTest.java b/wot-dijkstra/src/test/java/org/pgpainless/wot/dijkstra/sq/DepthTest.java index fe89a858..64ffa395 100644 --- a/wot-dijkstra/src/test/java/org/pgpainless/wot/dijkstra/sq/DepthTest.java +++ b/wot-dijkstra/src/test/java/org/pgpainless/wot/dijkstra/sq/DepthTest.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra.sq; import org.junit.jupiter.api.Test; diff --git a/wot-dijkstra/src/test/java/org/pgpainless/wot/dijkstra/sq/NetworkTest.java b/wot-dijkstra/src/test/java/org/pgpainless/wot/dijkstra/sq/NetworkTest.java index f95d116a..f1c69b98 100644 --- a/wot-dijkstra/src/test/java/org/pgpainless/wot/dijkstra/sq/NetworkTest.java +++ b/wot-dijkstra/src/test/java/org/pgpainless/wot/dijkstra/sq/NetworkTest.java @@ -1,17 +1,13 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra.sq; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; -import org.bouncycastle.openpgp.PGPException; -import org.bouncycastle.openpgp.PGPPublicKey; -import org.bouncycastle.openpgp.PGPPublicKeyRing; -import org.bouncycastle.openpgp.PGPSecretKeyRing; import org.junit.jupiter.api.Test; -import org.pgpainless.PGPainless; - -import java.security.InvalidAlgorithmParameterException; -import java.security.NoSuchAlgorithmException; public class NetworkTest { @@ -29,6 +25,7 @@ public class NetworkTest { @Test public void testNetworkFromCertificates() { ReferenceTime referenceTime = ReferenceTime.now(); + // TODO: Implement } diff --git a/wot-dijkstra/src/test/java/org/pgpainless/wot/dijkstra/sq/WotTestVectors.java b/wot-dijkstra/src/test/java/org/pgpainless/wot/dijkstra/sq/WotTestVectors.java index a7ab9813..217b1a70 100644 --- a/wot-dijkstra/src/test/java/org/pgpainless/wot/dijkstra/sq/WotTestVectors.java +++ b/wot-dijkstra/src/test/java/org/pgpainless/wot/dijkstra/sq/WotTestVectors.java @@ -1,3 +1,7 @@ +// SPDX-FileCopyrightText: 2023 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + package org.pgpainless.wot.dijkstra.sq; import java.io.IOException; @@ -249,6 +253,7 @@ public class WotTestVectors { }) .getCertifiedCertificate(); + // CHECKSTYLE:OFF System.out.println("Foo Employee"); System.out.println(PGPainless.asciiArmor(caCertifiedFooBankEmployeeCert)); @@ -263,6 +268,7 @@ public class WotTestVectors { System.out.println("Bar Employee"); System.out.println(PGPainless.asciiArmor(barCaCertifiedEmployeeCert)); + // CHECKSTYLE:ON } private static InputStream getTestResourceInputStream(String resource) {