public abstract class KarafTestCase extends Object
Modifier and Type | Field and Description |
---|---|
protected org.osgi.framework.BundleContext |
bundleContext |
protected org.apache.karaf.features.FeaturesService |
featuresService |
static String |
MAX_HTTP_PORT |
static String |
MAX_RMI_REG_PORT |
static String |
MAX_RMI_SERVER_PORT |
static String |
MAX_SSH_PORT |
static String |
MIN_HTTP_PORT |
static String |
MIN_RMI_REG_PORT |
static String |
MIN_RMI_SERVER_PORT |
static String |
MIN_SSH_PORT |
protected org.apache.karaf.shell.api.console.SessionFactory |
sessionFactory |
Constructor and Description |
---|
KarafTestCase() |
Modifier and Type | Method and Description |
---|---|
protected void |
addFeaturesUrl(String url) |
void |
before() |
org.ops4j.pax.exam.Option[] |
config()
This is the default
Configuration for any Pax Exam tests that
use this abstract base class. |
protected org.ops4j.pax.exam.Option[] |
configAsArray() |
protected List<org.ops4j.pax.exam.Option> |
configAsList() |
protected String |
executeCommand(String command)
Executes a shell command and returns output as a String.
|
protected static File |
findPom(File root) |
protected org.ops4j.pax.exam.options.MavenUrlReference |
getFrameworkUrl()
Use the vanilla Apache Karaf container.
|
protected static String |
getKarafVersion() |
protected static String |
getOpenNMSVersion() |
protected <T> T |
getOsgiService(Class<T> type) |
protected String[] |
getSystemPackages()
Override this method to add system packages to the test container.
|
protected void |
installFeature(String featureName) |
protected void |
installFeature(String featureName,
EnumSet<org.apache.karaf.features.FeaturesService.Option> options) |
protected void |
installFeature(String featureName,
String version) |
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. |
public static final String MIN_RMI_SERVER_PORT
public static final String MAX_RMI_SERVER_PORT
public static final String MIN_HTTP_PORT
public static final String MAX_HTTP_PORT
public static final String MIN_RMI_REG_PORT
public static final String MAX_RMI_REG_PORT
public static final String MIN_SSH_PORT
public static final String MAX_SSH_PORT
@Inject protected org.osgi.framework.BundleContext bundleContext
@Inject protected org.apache.karaf.features.FeaturesService featuresService
@Inject protected org.apache.karaf.shell.api.console.SessionFactory sessionFactory
protected static String getKarafVersion()
protected static String getOpenNMSVersion()
public void before()
public org.ops4j.pax.exam.TestProbeBuilder probeConfiguration(org.ops4j.pax.exam.TestProbeBuilder probe)
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".public org.ops4j.pax.exam.Option[] config()
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()
.protected List<org.ops4j.pax.exam.Option> configAsList()
protected org.ops4j.pax.exam.Option[] configAsArray()
protected org.ops4j.pax.exam.options.MavenUrlReference getFrameworkUrl()
protected String[] getSystemPackages()
protected void addFeaturesUrl(String url)
protected void installFeature(String featureName)
protected void installFeature(String featureName, EnumSet<org.apache.karaf.features.FeaturesService.Option> options)
protected String executeCommand(String command)
command
- protected <T> T getOsgiService(Class<T> type)
Copyright © 2020. All rights reserved.