Details
-
Test
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
2.0
-
None
-
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
catch (Exception e)
{ fail(e); }...