Class LayersTestBase

java.lang.Object
org.jboss.as.test.shared.LayersTestBase

public abstract class LayersTestBase extends Object
  • Field Details

    • NO_LAYER_COMMON

      public static final String[] NO_LAYER_COMMON
      Packages that are always expected to be included in the return value of getExpectedUnusedInAllLayers().
    • NO_LAYER_WILDFLY_EE

      public static final String[] NO_LAYER_WILDFLY_EE
      Included in the return value of getExpectedUnusedInAllLayers() only when testing provisioning directly from the wildfly-ee feature pack.
    • NO_LAYER_EXPANSION

      public static final String[] NO_LAYER_EXPANSION
      Included in the return value of getExpectedUnusedInAllLayers() when testing provisioning from the wildfly or wildfly-preview feature packs. Use this array for items common between the two feature packs.
    • NO_LAYER_WILDFLY

      public static final String[] NO_LAYER_WILDFLY
      Included in the return value of getExpectedUnusedInAllLayers() only when testing provisioning from the wildfly feature pack.
    • NO_LAYER_WILDFLY_PREVIEW

      public static final String[] NO_LAYER_WILDFLY_PREVIEW
      Included in the return value of getExpectedUnusedInAllLayers() only when testing provisioning from the wildfly-preview feature pack.
    • NOT_REFERENCED_COMMON

      public static final String[] NOT_REFERENCED_COMMON
      Packages that are always expected to be included in the return value of getExpectedUnreferenced().
    • NOT_REFERENCED_WILDFLY_EE

      public static final String[] NOT_REFERENCED_WILDFLY_EE
      Included in the return value of getExpectedUnreferenced() only when testing provisioning directly from the wildfly-ee feature pack.
    • NOT_REFERENCED_EXPANSION

      public static final String[] NOT_REFERENCED_EXPANSION
      Included in the return value of getExpectedUnreferenced() when testing provisioning from the wildfly or wildfly-preview feature packs. Use this array for items common between the two feature packs.
    • NOT_REFERENCED_WILDFLY

      public static final String[] NOT_REFERENCED_WILDFLY
      Included in the return value of getExpectedUnreferenced() only when testing provisioning from the wildfly feature pack.
    • NOT_REFERENCED_WILDFLY_PREVIEW

      public static final String[] NOT_REFERENCED_WILDFLY_PREVIEW
      Included in the return value of getExpectedUnreferenced() only when testing provisioning from the wildfly-preview feature pack.
    • NO_LAYER_OR_REFERENCE_COMMON

      public static final String[] NO_LAYER_OR_REFERENCE_COMMON
      Packages that are always expected to be included in the return value of both getExpectedUnusedInAllLayers() and getExpectedUnreferenced().
    • NO_LAYER_OR_REFERENCE_WILDFLY_EE

      public static final String[] NO_LAYER_OR_REFERENCE_WILDFLY_EE
      Included in the return value of both getExpectedUnusedInAllLayers() and getExpectedUnreferenced(), but only when testing provisioning directly from the wildfly-ee feature pack.
    • root

      protected static String root
  • Constructor Details

    • LayersTestBase

      public LayersTestBase()
  • Method Details

    • getExpectedUnreferenced

      protected abstract Set<String> getExpectedUnreferenced()
      Gets the expected set of packages that are not referenced from the module graph but need to be provisioned. This is the expected set of modules found when scanning the default configuration that are not referenced directly or transitively from a standalone server's root module or from one of the extensions used in standalone.xml.
    • getExpectedUnusedInAllLayers

      protected abstract Set<String> getExpectedUnusedInAllLayers()
      Gets the expected set of packages that are provisioned by the test-standalone-reference installation but not used in the test-all-layers installation. This is the expected set of not provisioned modules when all layers are provisioned; i.e. those that are not associated with any layer included in the test-all-layers installation.
    • concatArrays

      protected static Set<String> concatArrays(String[] first, String[]... others)
      Utility method to combine various module name arrays into sets for use as parameters to this class' methods.
      Parameters:
      first - the first array to combine. Cannot be null
      others - other arrays to combine. Can be null
      Returns:
      a set containing all of the elements in the arrays
    • setUp

      public static void setUp()
    • cleanUp

      public static void cleanUp()
    • testLayersBoot

      public void testLayersBoot() throws Exception
      Checks that the installations found in the given layers.install.root directory can all be started without errors, i.e. with the WFLYSRV0025 log message in the server's stdout stream.

      The @{code test-standalone-reference} installation is not tested as that kind of installation is heavily tested elsewhere.

      Throws:
      Exception - on failure
    • testLayersModuleUse

      public void testLayersModuleUse() throws Exception
      Checks that all modules that were provisioned in the @{code test-standalone-reference} installation are also provisioned in @{test-all-layers}, except those included in the getExpectedUnusedInAllLayers() set. The goals of this test are to check for new modules that should be provided by layers but currently are not and to encourage inclusion of existing modules not used in a layer to have an associated layer.
      Throws:
      Exception - on failure
    • testUnreferencedModules

      public void testUnreferencedModules() throws Exception
      Checks that all modules in the @{code test-standalone-reference} installation are referenced from the installation root module or extension modules configured in standalone.xml, except those included in the getExpectedUnreferenced() set. The goal of this test is to prevent the accumulation of 'orphaned' modules that are not usable.
      Throws:
      Exception - on failure
    • checkBannedModules

      public void checkBannedModules() throws Exception
      Checks that none of the installations found in the given layers.install.root directory include modules marked as 'banned'.
      Throws:
      Exception - on failure
    • testDefaultConfigs

      public void testDefaultConfigs() throws Exception
      Checks that the installation found in the given std.default.install.root directory can be started without errors, i.e. with the WFLYSRV0025 log message in the server's stdout stream.
      Throws:
      Exception - on failure