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 java.io.File;
17  
18  import junit.framework.TestCase;
19  
20  public class BundleTest extends TestCase {
21  
22      FrameworkErrorListener fel = new FrameworkErrorListener();
23      CheckingBundleListener mbl = new CheckingBundleListener();
24  
25      FelixHost felixHost = new FelixHost(fel, mbl);
26  
27      protected void setUp() throws Exception {
28          super.setUp();
29          felixHost.doLaunch();
30      }
31  
32      protected void tearDown() throws Exception {
33          super.tearDown();
34          felixHost.stop();
35      }
36  
37      public void testSmoke() {
38          System.out.println("===========" + new File(".").getAbsolutePath());
39          mbl.dumpAll();
40          // check that the bundle was installed
41          assertTrue(mbl.exists("iBundle"));
42          if (fel.errorList.size() != 0) {
43              fel.dumpAll();
44          }
45          // check that no errors occured
46          assertEquals(0, fel.errorList.size());
47      }
48  }