aboutsummaryrefslogtreecommitdiffstats
path: root/container-disc/src/test/java/com/yahoo/container/jdisc/DisableOsgiFrameworkTest.java
blob: f6b2424e0e1ce250a4243e4fc68ae1b684308c6d (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container.jdisc;

import org.junit.jupiter.api.Test;
import org.osgi.framework.BundleException;

import static org.junit.jupiter.api.Assertions.assertThrows;

/**
 * @author Ulf Lilleengen
 */
public class DisableOsgiFrameworkTest {

    @Test
    void require_that_installBundle_throws_exception() throws BundleException {
        assertThrows(RuntimeException.class, () -> {
            new DisableOsgiFramework().installBundle("foo");
        });
    }

    @Test
    void require_that_startBundles_throws_exception() throws BundleException {
        assertThrows(RuntimeException.class, () -> {
            new DisableOsgiFramework().startBundles(null, true);
        });
    }

    @Test
    void require_that_bundleContext_throws_exception() throws BundleException {
        assertThrows(RuntimeException.class, () -> {
            new DisableOsgiFramework().bundleContext();
        });
    }

    @Test
    void require_that_refreshPackages_throws_exception() {
        assertThrows(RuntimeException.class, () -> {
            new DisableOsgiFramework().refreshPackages();
        });
    }

    @Test
    void require_that_bundles_throws_exception() {
        assertThrows(RuntimeException.class, () -> {
            new DisableOsgiFramework().bundles();
        });
    }

    @Test
    void require_that_start_throws_exception() throws BundleException {
        assertThrows(RuntimeException.class, () -> {
            new DisableOsgiFramework().start();
        });
    }

    @Test
    void require_that_stop_throws_exception() throws BundleException {
        assertThrows(RuntimeException.class, () -> {
            new DisableOsgiFramework().stop();
        });
    }

}