View Javadoc
1   /**
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2015, QOS.ch. All rights reserved.
4    *
5    * This program and the accompanying materials are dual-licensed under
6    * either the terms of the Eclipse Public License v1.0 as published by
7    * the Eclipse Foundation
8    *
9    *   or (per the licensee's choosing)
10   *
11   * under the terms of the GNU Lesser General Public License version 2.1
12   * as published by the Free Software Foundation.
13   */
14  package org.slf4j.test_osgi;
15  
16  import org.junit.jupiter.api.AfterEach;
17  import org.junit.jupiter.api.BeforeEach;
18  import org.junit.jupiter.api.Test;
19  
20  import java.io.File;
21  
22  import static org.junit.jupiter.api.Assertions.*;
23  
24  public class BundleTest  {
25  
26      FrameworkErrorListener fel = new FrameworkErrorListener();
27      CheckingBundleListener mbl = new CheckingBundleListener();
28  
29      FelixHost felixHost = new FelixHost(fel, mbl);
30  
31      @BeforeEach
32      public void setUp() throws Exception {
33          felixHost.doLaunch();
34      }
35  
36      @AfterEach
37      protected void tearDown() throws Exception {
38          felixHost.stop();
39      }
40  
41      @Test
42      public void testSmoke() {
43          System.out.println("===========" + new File(".").getAbsolutePath());
44          mbl.dumpAll();
45          // check that the bundle was installed
46          assertTrue(mbl.exists("iBundle"));
47          if (fel.errorList.size() != 0) {
48              fel.dumpAll();
49          }
50          // check that no errors occured
51          assertEquals(0, fel.errorList.size());
52      }
53  }