summaryrefslogtreecommitdiffstats
path: root/jdisc_core/src/test/java/com/yahoo/jdisc/core/FelixFrameworkTestCase.java
blob: 69696ff62ecec68f03d150a5fbc2007d9bd79dc8 (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
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.jdisc.core;

import com.yahoo.jdisc.test.TestDriver;
import org.junit.Test;
import org.osgi.framework.BundleException;

import static org.junit.Assert.fail;


/**
 * @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen</a>
 */
public class FelixFrameworkTestCase {

    @Test
    public void requireThatLifecycleWorks() throws BundleException {
        FelixFramework felix = TestDriver.newOsgiFramework();
        felix.start();
        felix.stop();
    }

    @Test
    public void requireThatStopWithoutStartDoesNotThrowException() throws BundleException {
        FelixFramework felix = TestDriver.newOsgiFramework();
        felix.stop();
    }

    @Test
    public void requireThatInstallCanThrowException() throws BundleException {
        FelixFramework felix = TestDriver.newOsgiFramework();
        felix.start();
        try {
            felix.installBundle("file:notfound.jar");
            fail();
        } catch (BundleException e) {

        }
        felix.stop();
    }
}