The project uses JAXB through the Maven plugin cxf-xjc-plugin to generate classes from XML schema.
The test commands TestLoadBalancingCommand and TestStickynessCommand uses the command InvokeHttpGetMethodCommand for HTTP invocations.
The InvokeHttpGetMethodCommand uses the Apache HTTP Client. The HTTPClient is configured to used a SecureProtocolSocketFactory implementation which accepts all SSL certificates. The used implementation is EasySSLProtocolSocketFactory which is configured with the trust manager AcceptingSSLTrustManager which accepts all certificate chains.
The consequence is that certificate validation is disabled for SSL and all certificates are accepted. The certificates are not stored permanently in the key store of the used Java installation.
The plugin uses Log4j for logging. Each project which links to this project must provide a Log4j configuration which is accessible at runtime as a result of the build process.
The plugin component does not provide a Log4j configuration as part of its production build. A log4j configuration file is defined in the project in the directory src/test/resources/log4.properties for testing.
The test configuration configures Log4j to write to the log file to ${user.home}/.pineapple/logs/pineapple.log.
The plugin contains a configuration file which defines a Spring application context. The Spring application context defines the input unmarshalling for the plugin. The file is located in src/main/resources/com.alpha.pineapple.plugin.net-config.xml.
Commonly used constants in the unit tests are defined in the class com.alpha.testutils.InfrastructurePluginTestConstants.
Integration tests for the project are placed in the same packages as the unit tests. The integration tests are postfixed with IntegrationTest where the unit test have the postfix Test.
Example: The unit test for the class InvokeHTTPGetCommand is named InvokeHTTPGetCommandTest and the integration test is named InvokeHTTPGetCommandIntegrationTest.
Helper classes:
com.alpha.testutils.ObjectMotherContent is an implementation of the ObjectMother pattern. The class provides helper functions for testing by creating content for operations.
com.alpha.testutils.ObjectMotherHttpServer is an implementation of the ObjectMother pattern. The class provides helper functions for creating HTTP server instances.
The factory method ObjectMotherHttpServer.createHttpServer(..) creates a HTTP server which listens @ 127.0.0.1:3000. The HTTP server is configured with:
The factory method ObjectMotherHttpServer.createHttpServerWithRedirect(..) a HTTP server which listens @ 127.0.0.1:3000. The HTTP server is configured with:
The class is used by integration tests. e.g. the class is used by the class InvokeHTTPGetCommandIntegrationTest.
The package com.alpha.pineapple.plugin.net is the root package of the plugin and contains the plugin class PluginImpl.
The package com.alpha.pineapple.plugin.net.operation contains the operation classes for the plugin.
The plugin implement these default operations:
The package com.alpha.pineapple.plugin.net.model contains a helper class named AssertionValuesPropertyGetter which reads properties from the model class AssertionValues into a hash map and provides an interface for property lookup by name.
The class MapperImpl which implements the interface Mapper implements mapping between the schema generated classes to the command context using the proper command keys. The class is used by the operation class to map data to the command context prior to command invocation.