Skip to content

Instantly share code, notes, and snippets.

@chengfang
Last active June 24, 2023 01:19
Show Gist options
  • Save chengfang/dc3b534c0e2ee1e62a9fc7a9c9215d74 to your computer and use it in GitHub Desktop.
Save chengfang/dc3b534c0e2ee1e62a9fc7a9c9215d74 to your computer and use it in GitHub Desktop.
wildfly-discovery test plan

wildfly-discovery test plan

Tests for component classes

Some classes in wildfly-discovery project are relatively self-contained, and form the basic building blocks of discovery tasks. This section outlines the plans for verifying these component classes. These classes are under the package org.wildfly.discovery, and are referenced with their simple class names.

Test methodology

Generally the following types of tests should be written for each class:

  • basic contract of overriding java object methods:
    • equals
      • equals(self)
      • equals(other)
      • other.equals(this)
      • equals(null)
      • equals(clone)
      • equals(otherType)
    • hashcode
      • compare to clone.hashcode()
    • toString
      • at least no exception
      • compare to an expected output
    • clone, if cloneable
  • builder and factory methods
  • inherited public methods
  • declared public methods
  • important non-public methods

Component classes to be tested

  • AttributeValue and its children
    • BooleanAttributeValue
    • NumericAttributeValue
    • StringAttributeValue
    • OpaqueAttributeValue
  • FilterSpec and its children
    • GreaterEqualFilterSpec
    • LessEqualFilterSpec
    • AnyFilterSpec
    • AllFilterSpec
    • NotFilterSpec
    • SubstringFilterSpec
    • EqualsFilterSpec
    • HasFilterSpec
    • BooleanFilterSpec
  • classes related to service description and registration
    • ServiceDesignation
    • ServiceURL
    • ServiceType
    • ServicesQueue and BlockingQueueServicesQueue
    • ServiceDescription
    • ServiceRegistration and AggregateServiceRegistration
  • classes related to configuration and its parsing
    • ExternalDiscoveryConfigurator and DiscoveryXmlParser
    • InvalidDiscoveryConfigurationException
  • classes for discovery invocation
    • DiscoveryRequest
    • DiscoveryResult
  • Discovery provider and registration provider classes
    • StaticDiscoveryProvider
    • MutableDiscoveryProvider
    • AggregateDiscoveryProvider
    • MutableRegistryProvider
    • AggregateRegistryProvider
    • LocalRegistryAndDiscoveryProvider
    • LocalRegistryAndDiscoveryProvider

Tests for discovery behavior

Set up various discovery and registry providers, perform discovery with various filter specs, and verify that the discovery results meet expectation.

discovery providers:

  • StaticDiscoveryProvider
  • MutableRegistryProvider
  • MutableDiscoveryProvider
  • LocalRegistryAndDiscoveryProvider
  • AggregateRegistryProvider
  • AggregateDiscoveryProvider

discovery parameters:

  • various FilterSpec instances
  • various ServiceType instances
  • various ServiceDescription instances
  • various timeout values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment