aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-osgi-testrunner/src/test/java/com/yahoo/vespa/test/samples/FailingBeforeAllTestFactoryTest.java
blob: 675c3fd4443eb79f0049ab254b3903a093a4a10f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.test.samples;

import com.yahoo.vespa.testrunner.Expect;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.DynamicTest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestFactory;

import java.util.stream.IntStream;
import java.util.stream.Stream;

@Expect(skipped = 1, status = 5)
public class FailingBeforeAllTestFactoryTest {

    @BeforeAll
    static void fail() { throw new RuntimeException(); }

    @TestFactory
    Stream<DynamicTest> tests() {
        return IntStream.range(0, 3).mapToObj(i -> DynamicTest.dynamicTest("test-" + i, () -> { }));
    }

    @Test
    void fest() { }

}