Enable tests only if test backends are available

This commit is contained in:
Paul Schaub 2023-01-31 18:35:48 +01:00
parent 6fad442cd0
commit 6ac133499c
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
19 changed files with 32 additions and 9 deletions

View file

@ -17,6 +17,11 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
/**
* This implementation of {@link SOPInstanceFactory} reads the JSON file at
* <pre>external-sop/src/main/resources/sop/testsuite/external/config.json</pre>
* to determine configured external test backends
*/
public class ExternalSOPInstanceFactory extends SOPInstanceFactory { public class ExternalSOPInstanceFactory extends SOPInstanceFactory {
@Override @Override

View file

@ -4,8 +4,10 @@
package sop.testsuite.external.operation; package sop.testsuite.external.operation;
import org.junit.jupiter.api.condition.EnabledIf;
import sop.testsuite.operation.ArmorDearmorTest; import sop.testsuite.operation.ArmorDearmorTest;
@EnabledIf("sop.testsuite.operation.AbstractSOPTest#hasBackends")
public class ExternalArmorDearmorTest extends ArmorDearmorTest { public class ExternalArmorDearmorTest extends ArmorDearmorTest {
} }

View file

@ -4,8 +4,10 @@
package sop.testsuite.external.operation; package sop.testsuite.external.operation;
import org.junit.jupiter.api.condition.EnabledIf;
import sop.testsuite.operation.DecryptWithSessionKeyTest; import sop.testsuite.operation.DecryptWithSessionKeyTest;
@EnabledIf("sop.testsuite.operation.AbstractSOPTest#hasBackends")
public class ExternalDecryptWithSessionKeyTest extends DecryptWithSessionKeyTest { public class ExternalDecryptWithSessionKeyTest extends DecryptWithSessionKeyTest {
} }

View file

@ -4,7 +4,9 @@
package sop.testsuite.external.operation; package sop.testsuite.external.operation;
import org.junit.jupiter.api.condition.EnabledIf;
import sop.testsuite.operation.DetachedSignDetachedVerifyTest; import sop.testsuite.operation.DetachedSignDetachedVerifyTest;
@EnabledIf("sop.testsuite.operation.AbstractSOPTest#hasBackends")
public class ExternalDetachedSignDetachedVerifyTest extends DetachedSignDetachedVerifyTest { public class ExternalDetachedSignDetachedVerifyTest extends DetachedSignDetachedVerifyTest {
} }

View file

@ -4,8 +4,10 @@
package sop.testsuite.external.operation; package sop.testsuite.external.operation;
import org.junit.jupiter.api.condition.EnabledIf;
import sop.testsuite.operation.EncryptDecryptTest; import sop.testsuite.operation.EncryptDecryptTest;
@EnabledIf("sop.testsuite.operation.AbstractSOPTest#hasBackends")
public class ExternalEncryptDecryptTest extends EncryptDecryptTest { public class ExternalEncryptDecryptTest extends EncryptDecryptTest {
} }

View file

@ -4,8 +4,10 @@
package sop.testsuite.external.operation; package sop.testsuite.external.operation;
import org.junit.jupiter.api.condition.EnabledIf;
import sop.testsuite.operation.ExtractCertTest; import sop.testsuite.operation.ExtractCertTest;
@EnabledIf("sop.testsuite.operation.AbstractSOPTest#hasBackends")
public class ExternalExtractCertTest extends ExtractCertTest { public class ExternalExtractCertTest extends ExtractCertTest {
} }

View file

@ -4,8 +4,10 @@
package sop.testsuite.external.operation; package sop.testsuite.external.operation;
import org.junit.jupiter.api.condition.EnabledIf;
import sop.testsuite.operation.GenerateKeyTest; import sop.testsuite.operation.GenerateKeyTest;
@EnabledIf("sop.testsuite.operation.AbstractSOPTest#hasBackends")
public class ExternalGenerateKeyTest extends GenerateKeyTest { public class ExternalGenerateKeyTest extends GenerateKeyTest {
} }

View file

@ -4,8 +4,10 @@
package sop.testsuite.external.operation; package sop.testsuite.external.operation;
import org.junit.jupiter.api.condition.EnabledIf;
import sop.testsuite.operation.InlineSignInlineDetachDetachedVerifyTest; import sop.testsuite.operation.InlineSignInlineDetachDetachedVerifyTest;
@EnabledIf("sop.testsuite.operation.AbstractSOPTest#hasBackends")
public class ExternalInlineSignInlineDetachDetachedVerifyTest public class ExternalInlineSignInlineDetachDetachedVerifyTest
extends InlineSignInlineDetachDetachedVerifyTest { extends InlineSignInlineDetachDetachedVerifyTest {

View file

@ -4,8 +4,10 @@
package sop.testsuite.external.operation; package sop.testsuite.external.operation;
import org.junit.jupiter.api.condition.EnabledIf;
import sop.testsuite.operation.InlineSignInlineVerifyTest; import sop.testsuite.operation.InlineSignInlineVerifyTest;
@EnabledIf("sop.testsuite.operation.AbstractSOPTest#hasBackends")
public class ExternalInlineSignInlineVerifyTest extends InlineSignInlineVerifyTest { public class ExternalInlineSignInlineVerifyTest extends InlineSignInlineVerifyTest {
} }

View file

@ -4,8 +4,10 @@
package sop.testsuite.external.operation; package sop.testsuite.external.operation;
import org.junit.jupiter.api.condition.EnabledIf;
import sop.testsuite.operation.VersionTest; import sop.testsuite.operation.VersionTest;
@EnabledIf("sop.testsuite.operation.AbstractSOPTest#hasBackends")
public class ExternalVersionTest extends VersionTest { public class ExternalVersionTest extends VersionTest {
} }

View file

@ -19,7 +19,7 @@ import java.util.stream.Stream;
import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertArrayEquals;
@EnabledIf("sop.operation.AbstractSOPTest#hasBackends") @EnabledIf("sop.testsuite.operation.AbstractSOPTest#hasBackends")
public class ArmorDearmorTest { public class ArmorDearmorTest {
static Stream<Arguments> provideInstances() { static Stream<Arguments> provideInstances() {

View file

@ -21,7 +21,7 @@ import java.util.stream.Stream;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
@EnabledIf("sop.operation.AbstractSOPTest#hasBackends") @EnabledIf("sop.testsuite.operation.AbstractSOPTest#hasBackends")
public class DecryptWithSessionKeyTest extends AbstractSOPTest { public class DecryptWithSessionKeyTest extends AbstractSOPTest {
private static final String CIPHERTEXT = "-----BEGIN PGP MESSAGE-----\n" + private static final String CIPHERTEXT = "-----BEGIN PGP MESSAGE-----\n" +

View file

@ -24,7 +24,7 @@ import java.util.stream.Stream;
import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertThrows;
@EnabledIf("sop.operation.AbstractSOPTest#hasBackends") @EnabledIf("sop.testsuite.operation.AbstractSOPTest#hasBackends")
public class DetachedSignDetachedVerifyTest extends AbstractSOPTest { public class DetachedSignDetachedVerifyTest extends AbstractSOPTest {
static Stream<Arguments> provideInstances() { static Stream<Arguments> provideInstances() {

View file

@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertThrows;
@EnabledIf("sop.operation.AbstractSOPTest#hasBackends") @EnabledIf("sop.testsuite.operation.AbstractSOPTest#hasBackends")
public class EncryptDecryptTest extends AbstractSOPTest { public class EncryptDecryptTest extends AbstractSOPTest {
static Stream<Arguments> provideInstances() { static Stream<Arguments> provideInstances() {

View file

@ -18,7 +18,7 @@ import java.io.InputStream;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.stream.Stream; import java.util.stream.Stream;
@EnabledIf("sop.operation.AbstractSOPTest#hasBackends") @EnabledIf("sop.testsuite.operation.AbstractSOPTest#hasBackends")
public class ExtractCertTest extends AbstractSOPTest { public class ExtractCertTest extends AbstractSOPTest {
static Stream<Arguments> provideInstances() { static Stream<Arguments> provideInstances() {

View file

@ -16,7 +16,7 @@ import sop.testsuite.TestData;
import java.io.IOException; import java.io.IOException;
import java.util.stream.Stream; import java.util.stream.Stream;
@EnabledIf("sop.operation.AbstractSOPTest#hasBackends") @EnabledIf("sop.testsuite.operation.AbstractSOPTest#hasBackends")
public class GenerateKeyTest extends AbstractSOPTest { public class GenerateKeyTest extends AbstractSOPTest {
static Stream<Arguments> provideInstances() { static Stream<Arguments> provideInstances() {

View file

@ -24,7 +24,7 @@ import java.util.stream.Stream;
import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
@EnabledIf("sop.operation.AbstractSOPTest#hasBackends") @EnabledIf("sop.testsuite.operation.AbstractSOPTest#hasBackends")
public class InlineSignInlineDetachDetachedVerifyTest extends AbstractSOPTest { public class InlineSignInlineDetachDetachedVerifyTest extends AbstractSOPTest {
static Stream<Arguments> provideInstances() { static Stream<Arguments> provideInstances() {

View file

@ -26,7 +26,7 @@ import java.util.stream.Stream;
import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertThrows;
@EnabledIf("sop.operation.AbstractSOPTest#hasBackends") @EnabledIf("sop.testsuite.operation.AbstractSOPTest#hasBackends")
public class InlineSignInlineVerifyTest extends AbstractSOPTest { public class InlineSignInlineVerifyTest extends AbstractSOPTest {
static Stream<Arguments> provideInstances() { static Stream<Arguments> provideInstances() {

View file

@ -15,7 +15,7 @@ import java.util.stream.Stream;
import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
@EnabledIf("sop.operation.AbstractSOPTest#hasBackends") @EnabledIf("sop.testsuite.operation.AbstractSOPTest#hasBackends")
public class VersionTest extends AbstractSOPTest { public class VersionTest extends AbstractSOPTest {
static Stream<Arguments> provideInstances() { static Stream<Arguments> provideInstances() {