Class AbstractIntegrationTest

java.lang.Object
org.codice.ddf.itests.common.AbstractIntegrationTest

public abstract class AbstractIntegrationTest extends Object
Abstract integration test with helper methods and configuration at the container level
  • Field Details

  • Constructor Details

    • AbstractIntegrationTest

      public AbstractIntegrationTest()
  • Method Details

    • initFacades

      public void initFacades()
    • waitForBaseSystemFeatures

      public void waitForBaseSystemFeatures()
    • waitForSystemReady

      public void waitForSystemReady()
    • beforeSuite

      public void beforeSuite() throws Exception
      Throws:
      Exception
    • config

      public org.ops4j.pax.exam.Option[] config() throws URISyntaxException, IOException
      Configures the pax exam test container
      Returns:
      list of pax exam options
      Throws:
      URISyntaxException
      IOException
    • combineOptions

      protected org.ops4j.pax.exam.Option[] combineOptions(org.ops4j.pax.exam.Option[]... options)
      Combines all the Option objects contained in multiple Option arrays.
      Parameters:
      options - arrays of Option objects to combine. Arrays can be null or empty.
      Returns:
      array that combines all the Option objects from the arrays provided. null and empty arrays will be ignored, but null Option objects will be added to the result.
    • configureDistribution

      protected org.ops4j.pax.exam.Option[] configureDistribution()
    • configurePaxExam

      protected org.ops4j.pax.exam.Option[] configurePaxExam()
    • configureConfigurationPorts

      protected org.ops4j.pax.exam.Option[] configureConfigurationPorts() throws URISyntaxException, IOException
      Throws:
      URISyntaxException
      IOException
    • configureMavenRepos

      protected org.ops4j.pax.exam.Option[] configureMavenRepos()
    • configureSystemSettings

      protected org.ops4j.pax.exam.Option[] configureSystemSettings()
    • configureLogLevel

      protected org.ops4j.pax.exam.Option[] configureLogLevel()
    • createSetLogLevelOption

      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. See .
      Parameters:
      name - name of the logger to set
      level - String value to set the logger level
      Returns:
      options to set the log level
    • configureIncludeUnstableTests

      protected org.ops4j.pax.exam.Option[] configureIncludeUnstableTests()
    • configureVmOptions

      protected org.ops4j.pax.exam.Option[] configureVmOptions()
    • configureStartScript

      protected org.ops4j.pax.exam.Option[] configureStartScript()
    • configureCustom

      protected org.ops4j.pax.exam.Option[] configureCustom()
      Allows extending classes to add any custom options to the configuration. This is only valid for tests run with the PerClass strategy
    • getFilePermissionsOption

      protected org.ops4j.pax.exam.Option getFilePermissionsOption() throws IOException
      Throws:
      IOException
    • installStartupFile

      protected org.ops4j.pax.exam.Option installStartupFile(String content, String destination) throws IOException
      Copies a String into the destination specified before the container starts up. Useful to add test configuration files before tests are run.
      Parameters:
      content - content to use for file
      destination - destination relative to DDF_HOME
      Returns:
      option object to include in a configureCustom() method
      Throws:
      IOException - thrown if a problem occurs while copying the resource
    • installStartupFile

      protected org.ops4j.pax.exam.Option installStartupFile(URL resource, String destination) throws IOException
      Copies the content of a JAR resource to the destination specified before the container starts up. Useful to add test configuration files before tests are run.
      Parameters:
      resource - URL to the JAR resource to copy
      destination - destination relative to DDF_HOME
      Returns:
      option object to include in a configureCustom() method
      Throws:
      IOException - thrown if a problem occurs while copying the resource
    • getDefaultRequiredApps

      protected String[] getDefaultRequiredApps()
    • getAdminConfig

      protected AdminConfig getAdminConfig()
    • getServiceManager

      protected ServiceManager getServiceManager()
    • getCatalogBundle

      protected CatalogBundle getCatalogBundle()
    • getSecurityPolicy

      protected SecurityPolicyConfigurator getSecurityPolicy()
    • getUrlResourceReaderConfigurator

      protected UrlResourceReaderConfigurator getUrlResourceReaderConfigurator()
    • getBasePort

      protected Integer getBasePort()
    • getFileContentAsStream

      public static InputStream getFileContentAsStream(String filePath)
    • getFileContentAsStream

      public static InputStream getFileContentAsStream(String filePath, Class classRelativeToResource)
    • getFileContent

      public static String getFileContent(String filePath)
    • getFileContent

      public static String getFileContent(String filePath, Map<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.
      Parameters:
      filePath -
      params -
      classRelativeToResource -
      Returns:
    • getFileContent

      public static String getFileContent(String filePath, Map<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 match the parameter names of the method calling getFileContent. Resource is relative to AbstractIntegrationTest class
      Parameters:
      filePath -
      params -
      Returns:
    • configureRestForGuest

      public void configureRestForGuest() throws Exception
      Throws:
      Exception
    • configureRestForBasic

      public void configureRestForBasic() throws Exception
      Throws:
      Exception
    • configureRestForGuest

      public void configureRestForGuest(String whitelist) throws Exception
      Throws:
      Exception
    • configureRestForBasic

      public void configureRestForBasic(String whitelist) throws Exception
      Throws:
      Exception
    • configureRestForSaml

      public void configureRestForSaml(String whitelist) throws Exception
      Throws:
      Exception
    • configureBundle

      protected void configureBundle(String bundleName, String pid, Dictionary<String,Object> properties) throws IOException, org.osgi.framework.BundleException, InterruptedException
      Throws:
      IOException
      org.osgi.framework.BundleException
      InterruptedException
    • clearCatalogAndWait

      public void clearCatalogAndWait()
      Clears out the catalog and catalog cache of all 'resource' metacards. Will not return until all metacards have been removed. Will throw an AssertionError if catalog could not be cleared within 5 minutes.
    • clearCatalog

      public void clearCatalog()
    • isCatalogEmpty

      protected boolean isCatalogEmpty()