Class KarafTestCase


  • public abstract class KarafTestCase
    extends Object
    • Constructor Detail

      • KarafTestCase

        public KarafTestCase()
    • Method Detail

      • getKarafVersion

        protected static String getKarafVersion()
      • findPom

        protected static File findPom​(File root)
      • getOpenNMSVersion

        protected static String getOpenNMSVersion()
      • before

        public void before()
      • probeConfiguration

        public org.ops4j.pax.exam.TestProbeBuilder probeConfiguration​(org.ops4j.pax.exam.TestProbeBuilder probe)
        This ProbeBuilder can be used to add OSGi metadata to the test probe bundle. We only use it to give the bundle a nice human-readable name of "org.opennms.core.test.karaf.test".
      • config

        public org.ops4j.pax.exam.Option[] config()
        This is the default Configuration for any Pax Exam tests that use this abstract base class. If you wish to add more Configuration parameters, you should call configAsList(), append the Option values to the list, and then return it in a Configuration function that overrides config().
      • configAsList

        protected List<org.ops4j.pax.exam.Option> configAsList()
      • configAsArray

        protected org.ops4j.pax.exam.Option[] configAsArray()
      • getFrameworkUrl

        protected org.ops4j.pax.exam.options.MavenUrlReference getFrameworkUrl()
        Use the vanilla Apache Karaf container. Override this method to use a different Karaf-compatible framework artifact.
      • getSystemPackages

        protected String[] getSystemPackages()
        Override this method to add system packages to the test container.
      • addFeaturesUrl

        protected void addFeaturesUrl​(String url)
      • installFeature

        protected void installFeature​(String featureName)
      • installFeature

        protected void installFeature​(String featureName,
                                      EnumSet<org.apache.karaf.features.FeaturesService.Option> options)
      • installFeature

        protected void installFeature​(String featureName,
                                      String version)
      • executeCommand

        protected String executeCommand​(String command)
        Executes a shell command and returns output as a String. Commands have a default timeout of 10 seconds.
        Parameters:
        command -
        Returns:
      • getOsgiService

        protected <T> T getOsgiService​(Class<T> type)