public abstract class AbstractIntegrationTest extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AbstractIntegrationTest.DynamicPort
An enum that returns a port number based on the class variable
basePort . |
static class |
AbstractIntegrationTest.DynamicUrl
A class used to give a dynamic
String that evaluates when called rather than at compile
time. |
Constructor and Description |
---|
AbstractIntegrationTest() |
Modifier and Type | Method and Description |
---|---|
void |
clearCache() |
void |
clearCatalog() |
void |
clearCatalogAndWait()
Clears out the catalog and catalog cache of all 'resource' metacards.
|
protected org.ops4j.pax.exam.Option[] |
combineOptions(org.ops4j.pax.exam.Option[]... options)
Combines all the
Option objects contained in multiple Option arrays. |
org.ops4j.pax.exam.Option[] |
config()
Configures the pax exam test container
|
protected void |
configureBundle(String bundleName,
String pid,
Dictionary<String,Object> properties) |
protected org.ops4j.pax.exam.Option[] |
configureConfigurationPorts() |
protected org.ops4j.pax.exam.Option[] |
configureCustom()
Allows extending classes to add any custom options to the configuration.
|
protected org.ops4j.pax.exam.Option[] |
configureDistribution() |
protected org.ops4j.pax.exam.Option[] |
configureIncludeUnstableTests() |
protected org.ops4j.pax.exam.Option[] |
configureLogLevel() |
protected org.ops4j.pax.exam.Option[] |
configureMavenRepos() |
protected org.ops4j.pax.exam.Option[] |
configurePaxExam() |
void |
configureRestForBasic() |
void |
configureRestForBasic(String whitelist) |
void |
configureRestForGuest() |
void |
configureRestForGuest(String whitelist) |
protected org.ops4j.pax.exam.Option[] |
configureStartScript() |
protected org.ops4j.pax.exam.Option[] |
configureSystemSettings() |
protected org.ops4j.pax.exam.Option[] |
configureVmOptions() |
protected org.ops4j.pax.exam.Option[] |
createSetLogLevelOption(String name,
String level)
Creates options to add log configuration lines to the etc/org.ops4j.pax.logging.cfg file.
|
protected AdminConfig |
getAdminConfig() |
protected Integer |
getBasePort() |
protected CatalogBundle |
getCatalogBundle() |
protected String[] |
getDefaultRequiredApps() |
static String |
getFileContent(String filePath) |
static String |
getFileContent(String filePath,
com.google.common.collect.ImmutableMap<String,String> params)
Variables to be replaced in a resource file should be in the format: $variableName$ The
variable to replace in the file should also also match the parameter names of the method
calling getFileContent.
|
static String |
getFileContent(String filePath,
com.google.common.collect.ImmutableMap<String,String> params,
Class classRelativeToResource)
Variables to be replaced in a resource file should be in the format: $variableName$ The
variable to replace in the file should also also match the parameter names of the method
calling getFileContent.
|
static InputStream |
getFileContentAsStream(String filePath) |
static InputStream |
getFileContentAsStream(String filePath,
Class classRelativeToResource) |
protected SecurityPolicyConfigurator |
getSecurityPolicy() |
protected ServiceManager |
getServiceManager() |
protected UrlResourceReaderConfigurator |
getUrlResourceReaderConfigurator() |
void |
initFacades() |
protected org.ops4j.pax.exam.Option |
installStartupFile(String content,
String destination)
Copies a String into the destination specified before the container starts up.
|
protected org.ops4j.pax.exam.Option |
installStartupFile(URL resource,
String destination)
Copies the content of a JAR resource to the destination specified before the container starts
up.
|
protected boolean |
isCatalogEmpty() |
void |
waitForBaseSystemFeatures() |
void |
waitForSystemReady() |
public static final String JSON_RECORD_RESOURCE_PATH
public static final String CSW_RECORD_RESOURCE_PATH
public static final String XML_RECORD_RESOURCE_PATH
public static final String CSW_REQUEST_RESOURCE_PATH
public static final String SYSTEM_PROPERTIES_PATH
protected static final org.slf4j.Logger LOGGER
protected static final String LOGGER_CONFIGURATION_FILE_PATH
protected static final String DEFAULT_LOG_LEVEL
protected static final String TEST_LOG_LEVEL_PROPERTY
protected static final String TEST_SECURITY_LOG_LEVEL_PROPERTY
protected static final String KARAF_VERSION
protected static final String OPENSEARCH_SOURCE_ID
protected static final String CSW_SOURCE_ID
protected static final String SYSTEM_ADMIN_USER
protected static final String SYSTEM_ADMIN_USER_PASSWORD
public static final String RESOURCE_VARIABLE_DELIMETER
public static final String REMOVE_ALL
protected static ServerSocket placeHolderSocket
protected static Integer basePort
protected static final String DDF_HOME_PROPERTY
protected static String ddfHome
public PaxExamRule paxExamRule
@Inject protected org.osgi.service.cm.ConfigurationAdmin configAdmin
@Inject protected org.apache.karaf.features.FeaturesService features
@Inject protected org.apache.karaf.shell.api.console.SessionFactory sessionFactory
@Inject protected org.osgi.service.metatype.MetaTypeService metatype
protected static final String[] DEFAULT_REQUIRED_APPS
protected KarafConsole console
public static final AbstractIntegrationTest.DynamicPort BASE_PORT
public static final AbstractIntegrationTest.DynamicPort HTTP_PORT
public static final AbstractIntegrationTest.DynamicPort HTTPS_PORT
public static final AbstractIntegrationTest.DynamicPort DEFAULT_PORT
public static final AbstractIntegrationTest.DynamicPort SSH_PORT
public static final AbstractIntegrationTest.DynamicPort RMI_SERVER_PORT
public static final AbstractIntegrationTest.DynamicPort RMI_REG_PORT
public static final AbstractIntegrationTest.DynamicUrl SERVICE_ROOT
public static final AbstractIntegrationTest.DynamicUrl INSECURE_SERVICE_ROOT
public static final AbstractIntegrationTest.DynamicUrl SEARCH_ROOT
public static final AbstractIntegrationTest.DynamicUrl REST_PATH
public static final AbstractIntegrationTest.DynamicUrl OPENSEARCH_PATH
public static final AbstractIntegrationTest.DynamicUrl CSW_PATH
public static final AbstractIntegrationTest.DynamicUrl CSW_SUBSCRIPTION_PATH
public static final AbstractIntegrationTest.DynamicUrl CSW_EVENT_PATH
public static final AbstractIntegrationTest.DynamicUrl ADMIN_ALL_SOURCES_PATH
public static final AbstractIntegrationTest.DynamicUrl ADMIN_STATUS_PATH
public static final AbstractIntegrationTest.DynamicUrl RESOURCE_DOWNLOAD_ENDPOINT_ROOT
public static final AbstractIntegrationTest.DynamicUrl COMETD_ENDPOINT
public void initFacades()
public void waitForBaseSystemFeatures()
public org.ops4j.pax.exam.Option[] config() throws URISyntaxException, IOException
URISyntaxException
IOException
protected org.ops4j.pax.exam.Option[] combineOptions(org.ops4j.pax.exam.Option[]... options)
Option
objects contained in multiple Option
arrays.options
- arrays of Option
objects to combine. Arrays can be null
or
empty.Option
objects from the arrays provided. null
and empty arrays will be ignored, but null
Option
objects will be
added to the result.protected org.ops4j.pax.exam.Option[] configureDistribution()
protected org.ops4j.pax.exam.Option[] configurePaxExam()
protected org.ops4j.pax.exam.Option[] configureConfigurationPorts() throws URISyntaxException, IOException
URISyntaxException
IOException
protected org.ops4j.pax.exam.Option[] configureMavenRepos()
protected org.ops4j.pax.exam.Option[] configureSystemSettings()
protected org.ops4j.pax.exam.Option[] configureLogLevel()
protected org.ops4j.pax.exam.Option[] createSetLogLevelOption(String name, String level)
org.apache.karaf.log.core.internal.LogServiceLog4j2Impl
.name
- name of the logger to setlevel
- String value to set the logger levelprotected org.ops4j.pax.exam.Option[] configureIncludeUnstableTests()
protected org.ops4j.pax.exam.Option[] configureVmOptions()
protected org.ops4j.pax.exam.Option[] configureStartScript()
protected org.ops4j.pax.exam.Option[] configureCustom()
protected org.ops4j.pax.exam.Option installStartupFile(String content, String destination) throws IOException
content
- content to use for filedestination
- destination relative to DDF_HOMEconfigureCustom()
methodIOException
- thrown if a problem occurs while copying the resourceprotected org.ops4j.pax.exam.Option installStartupFile(URL resource, String destination) throws IOException
resource
- URL to the JAR resource to copydestination
- destination relative to DDF_HOMEconfigureCustom()
methodIOException
- thrown if a problem occurs while copying the resourceprotected String[] getDefaultRequiredApps()
protected AdminConfig getAdminConfig()
protected ServiceManager getServiceManager()
protected CatalogBundle getCatalogBundle()
protected SecurityPolicyConfigurator getSecurityPolicy()
protected UrlResourceReaderConfigurator getUrlResourceReaderConfigurator()
protected Integer getBasePort()
public static InputStream getFileContentAsStream(String filePath)
public static InputStream getFileContentAsStream(String filePath, Class classRelativeToResource)
public static String getFileContent(String filePath, com.google.common.collect.ImmutableMap<String,String> params, Class classRelativeToResource)
filePath
- params
- classRelativeToResource
- public static String getFileContent(String filePath, com.google.common.collect.ImmutableMap<String,String> params)
filePath
- params
- public void configureRestForGuest(String whitelist) throws Exception
Exception
public void configureRestForBasic(String whitelist) throws Exception
Exception
protected void configureBundle(String bundleName, String pid, Dictionary<String,Object> properties) throws IOException, org.osgi.framework.BundleException, InterruptedException
IOException
org.osgi.framework.BundleException
InterruptedException
public void clearCatalogAndWait()
public void clearCatalog()
public void clearCache()
protected boolean isCatalogEmpty()
This work is licensed under a Creative Commons Attribution 4.0 International License.