Search in sources :

Example 1 with TestAbortedException

use of org.opentest4j.TestAbortedException in project spring-security by spring-projects.

the class CryptoAssumptions method assumeAes256.

private static void assumeAes256(CipherAlgorithm cipherAlgorithm) {
    boolean aes256Available = false;
    try {
        Cipher.getInstance(cipherAlgorithm.toString());
        aes256Available = Cipher.getMaxAllowedKeyLength("AES") >= 256;
    } catch (NoSuchAlgorithmException ex) {
        throw new TestAbortedException(cipherAlgorithm + " not available, skipping test", ex);
    } catch (NoSuchPaddingException ex) {
        throw new TestAbortedException(cipherAlgorithm + " padding not available, skipping test", ex);
    }
    Assumptions.assumeTrue(aes256Available, "AES key length of 256 not allowed, skipping test");
}
Also used : TestAbortedException(org.opentest4j.TestAbortedException) NoSuchPaddingException(javax.crypto.NoSuchPaddingException) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException)

Example 2 with TestAbortedException

use of org.opentest4j.TestAbortedException in project netty by netty.

the class EpollSocketChannelConfigTest method testInvalidLowTcpNotSentLowAt.

@Test
public void testInvalidLowTcpNotSentLowAt() {
    try {
        final long value = -1;
        ch.config().setTcpNotSentLowAt(value);
    } catch (IllegalArgumentException e) {
        return;
    } catch (RuntimeException e) {
        throw new TestAbortedException("assumeNoException", e);
    }
    fail();
}
Also used : TestAbortedException(org.opentest4j.TestAbortedException) RepeatedIfExceptionsTest(io.github.artsok.RepeatedIfExceptionsTest) Test(org.junit.jupiter.api.Test)

Example 3 with TestAbortedException

use of org.opentest4j.TestAbortedException in project netty by netty.

the class EpollSocketChannelConfigTest method testInvalidHighTcpNotSentLowAt.

@Test
public void testInvalidHighTcpNotSentLowAt() {
    try {
        final long value = 0xFFFFFFFFL + 1;
        ch.config().setTcpNotSentLowAt(value);
    } catch (IllegalArgumentException e) {
        return;
    } catch (RuntimeException e) {
        throw new TestAbortedException("assumeNoException", e);
    }
    fail();
}
Also used : TestAbortedException(org.opentest4j.TestAbortedException) RepeatedIfExceptionsTest(io.github.artsok.RepeatedIfExceptionsTest) Test(org.junit.jupiter.api.Test)

Example 4 with TestAbortedException

use of org.opentest4j.TestAbortedException in project netty by netty.

the class KQueueSocketChannelConfigTest method testRandomSndLowAt.

@Test
public void testRandomSndLowAt() {
    final int expected = Math.min(BSD_SND_LOW_AT_MAX, Math.abs(rand.nextInt()));
    final int actual;
    try {
        ch.config().setSndLowAt(expected);
        actual = ch.config().getSndLowAt();
    } catch (RuntimeException e) {
        throw new TestAbortedException("assumeNoException", e);
    }
    assertEquals(expected, actual);
}
Also used : TestAbortedException(org.opentest4j.TestAbortedException) Test(org.junit.jupiter.api.Test)

Example 5 with TestAbortedException

use of org.opentest4j.TestAbortedException in project spock by spockframework.

the class PendingFeatureBaseInterceptor method testAborted.

protected TestAbortedException testAborted(StackTraceElement[] stackTrace) {
    TestAbortedException testAbortedException = new TestAbortedException("Feature not yet implemented correctly." + ("".equals(reason) ? "" : " Reason: " + reason));
    testAbortedException.setStackTrace(stackTrace);
    return testAbortedException;
}
Also used : TestAbortedException(org.opentest4j.TestAbortedException)

Aggregations

TestAbortedException (org.opentest4j.TestAbortedException)17 Test (org.junit.jupiter.api.Test)11 RepeatedIfExceptionsTest (io.github.artsok.RepeatedIfExceptionsTest)3 TestExecutionResult (org.junit.platform.engine.TestExecutionResult)3 StubStepDefinition (io.cucumber.core.backend.StubStepDefinition)2 Feature (io.cucumber.core.gherkin.Feature)2 StubBackendSupplier (io.cucumber.core.runtime.StubBackendSupplier)2 StubFeatureSupplier (io.cucumber.core.runtime.StubFeatureSupplier)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 Properties (java.util.Properties)2 InOrder (org.mockito.InOrder)2 Session (com.datastax.driver.core.Session)1 TimeServiceEventBus (io.cucumber.core.runtime.TimeServiceEventBus)1 Result (io.cucumber.plugin.event.Result)1 TestCaseFinished (io.cucumber.plugin.event.TestCaseFinished)1 TestCaseStarted (io.cucumber.plugin.event.TestCaseStarted)1 TestStepFinished (io.cucumber.plugin.event.TestStepFinished)1 TestStepStarted (io.cucumber.plugin.event.TestStepStarted)1 IOException (java.io.IOException)1 InetSocketAddress (java.net.InetSocketAddress)1