Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-349

Integration Test for Log4j2-bundles

    XMLWordPrintableJSON

    Details

    • Type: Test
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Environment:

      Apache Felix 4.x or a equivalent OSGi-container (OSGi R4 or R5)

      Description

      All Log4j2 bundles should be tested in a OSGi-Container. For example, whether all necessary packages are exported / imported.

      One option among many:
      create a fragmented test-bundle for integration-tests (Host-bundle is the unit under test) and add following plugin to the pom
      ...
      <plugin>
      <groupId>org.apache.felix</groupId>
      <artifactId>maven-junit4osgi-plugin</artifactId>
      <executions>
      <execution>
      <configuration>
      <deployprojectartifact>true</deployprojectartifact>
      </configuration>
      </execution>
      </executions>
      </plugin>
      ...

      short example...

      public class Integrationtest {

      @Test
      public void testBundleActivator()
      {
      BundleContext context = FrameworkUtil.getBundle(MyActivator.class).getBundleContext();
      BundleActivator uut = new MyActivator();
      try

      { uut.start(context); }

      catch (Exception e)

      { fail(e); }

      ...

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rol Roland Weiglhofer
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: