initial checkin

This commit is contained in:
2021-04-22 15:58:20 -04:00
commit a7fef4641b
278 changed files with 14028 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
# Eclipse
.project
.classpath
.settings
# Maven
pom.xml.versionsBackup
target

View File

@@ -0,0 +1,72 @@
# BeeDK ACS Share Integration Test Maven Tile for Share Projects
This is a component within the proposed [BeeDK](/inteligr8/ootbee-beedk). It is considered to be part of the **Private API** of the BeeDK.
## Purpose
This project creates a [Maven Tile](https://github.com/repaint-io/maven-tiles) that provides the basis for integration testing any ACS Share module, extension, service, or web application.
## Usage
To use this plugin, just reference it with the Maven Tiles plugin as shown in the following snippet. Do not forget the `extensions` element in the *plugin* configuration.
```xml
<project ...>
...
<build>
...
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>[2.0,3.0)</version>
<extensions>true</extensions>
<configuration>
<tiles>
...
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-share-self-it-tile -->
<tile>com.inteligr8.ootbee:beedk-acs-share-self-it-tile:[1.0.0,2.0.0)</tile>
</tiles>
</configuration>
</plugin>
...
</plugins>
...
</build>
...
</project>
```
## Configuration
In your Maven project, set the following properties to define the behavior of this Maven Tile. Unless otherwise stated, they can only be overridden in the project POM or other Maven Tiles loaded earlier than this Maven Tile.
### Public API
The following properties are intended to be exposed by inheriting Public API Maven Tiles.
| Maven Property | Required | Default | Description |
| ---------------------------------- |:--------:| ------------------ | ----------- |
| `alfresco.sdk.version` | **YES** | | For a list of versions and more details, see the [Alfresco SDK](https://github.com/Alfresco/alfresco-sdk).<br/>*Inherited from [`beedk-acs-webapp-artifact-it-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-it-tile)* |
| `alfresco.share.version` | *Maybe* | | The Alfresco Share version to use for integration testing. See below for more details. |
| `alfresco.war.artifactId` | | `share` | The Maven `artifactId` of a Maven `war` Type Project defined in a Maven Repository.<br/>*Inherited from [`beedk-acs-webapp-artifact-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-tile)* |
| `alfresco.war.version` | *Maybe* | *See Below* | The Maven `version` of a Maven `war` Type Project defined in a Maven Repository.<br/>*Inherited from [`beedk-acs-webapp-artifact-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-tile)* |
| `project.build.shareExtDirectory` | | `${project.build.directory}/ext/share` | An additional directory of JARs to add to the ACS Share at runtime. |
| `acs-platform.url` | | *See Below* | The URL of the backend ACS Platform to be used. |
| `acs-share.port` | | 8180 | The port to expose on `localhost` for scripts to use during integration testing to verify the state of the application; not for a developer or user. |
| `acs-share.timeout` | | 45000 | The time to wait for the startup to complete, in milliseconds. |
| `tomcat-rad.version` | | *not important* | The version of the [Apache Tomcat Rapid Application Development Docker container](/inteligr8/tomcat-rad-docker). |
* The `alfresco.share.version` is used to default the `alfresco.war.version`. It is expected to be used by other Maven Tiles, so it is here for convenience. You must specify either property for this tile to function.
* The `acs-platform.url` will default to the appropriate value when using the `beedk-acs-platform-*-it-tile` tiles. This should be overridden if you are not using those tiles and are instead using some other ACS Platform instance.
### Other APIs
Additional less important configurations are inherited from the following Maven Tiles.
* [`beedk-run-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-run-tile)
* [`beedk-acs-webapp-artifact-it-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-it-tile)
## Results
ACS Share will be started and stopped during the `pre-integration-test` and `post-integration-test` Maven phases, respectively.

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.inteligr8.ootbee</groupId>
<artifactId>beedk-acs-share-self-it-tile</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>tile</packaging>
<name>Order of the Bee Development Kit: Integration Testing for ACS Share</name>
<scm>
<url>https://bitbucket.org/inteligr8/ootbee-beedk</url>
</scm>
<organization>
<name>Order of the Bee</name>
<url>https://orderofthebee.net</url>
</organization>
<developers>
<developer>
<name>Brian Long</name>
<email>brian@inteligr8.com</email>
<organization>Inteligr8</organization>
<organizationUrl>https://www.inteligr8.com</organizationUrl>
<url>https://twitter.com/brianmlong</url>
</developer>
</developers>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.20</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>com.inteligr8:maven-public-deploy-tile:[1.0.0,2.0.0)</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,167 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://tiles.bluetrainsoftware.com/maven/tiles/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tiles.bluetrainsoftware.com/maven/tiles/1.1.0 https://bitbucket.org/inteligr8/maven-tiles/raw/xsd/src/main/resources/maven-tiles.xsd">
<build>
<plugins>
<!-- This plugin downloads the Share JAR-based extension modules and runtime/test dependencies -->
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<executions>
<!-- This execution downloads the dependency JARs, including JAR modules -->
<execution>
<id>download-share-jars</id>
<phase>pre-integration-test</phase>
<goals><goal>copy-dependencies</goal></goals>
<configuration>
<excludeScope>provided</excludeScope>
<includeTypes>jar</includeTypes>
<outputDirectory>${project.build.shareExtDirectory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- This plugin downloads the Alfresco SDK configuration for Share -->
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<version>1.6.1</version>
<executions>
<execution>
<id>download-share-config</id>
<phase>pre-integration-test</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>https://raw.githubusercontent.com/Alfresco/alfresco-sdk/alfresco-sdk-aggregator-${alfresco.sdk.version}/archetypes/alfresco-share-jar-archetype/src/main/resources/archetype-resources/src/main/docker/share-config-custom.xml</url>
<outputDirectory>${project.build.directory}/download</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- This plugin configures the Share configuration for the BeeDK -->
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>maven-replacer-plugin</artifactId>
<version>1.4.1</version>
<executions>
<execution>
<phase>pre-integration-test</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<basedir>${basedir}/target/download</basedir>
<outputBasedir>${basedir}/target/test-classes</outputBasedir>
<file>share-config-custom.xml</file>
<outputDir>alfresco/web-extension</outputDir>
<replacements>
<replacement>
<token>http://\$\{acs\.host\}:8080</token>
<value>${acs-platform.url}</value>
</replacement>
</replacements>
</configuration>
</plugin>
<!-- Using Docker to host the web application -->
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${beedk.plugins.fabric8.docker.version}</version>
<executions>
<execution>
<id>start-acs-share</id>
<phase>pre-integration-test</phase>
<goals><goal>start</goal></goals>
<configuration>
<images>
<image>
<name>docker.inteligr8.com/inteligr8/tomcat-rad:${tomcat-rad.version}</name>
<alias>acs-share</alias>
<run>
<skip>${skipTests}</skip>
<ports>
<port>${acs-share.port}:8080</port>
</ports>
<network>
<mode>custom</mode>
<name>${project.artifactId}</name>
</network>
<volumes>
<bind>
<volume>${project.build.warFile}:/var/lib/tomcat/webapps/share.war:ro</volume>
<volume>${project.build.testOutputDirectory}:/var/lib/tomcat/dev/classes:ro</volume>
<volume>${project.build.shareExtDirectory}:/var/lib/tomcat/dev/lib:ro</volume>
</bind>
</volumes>
<wait>
<http>
<url>http://localhost:${acs-share.port}/share</url>
<method>GET</method>
<status>200..399</status>
</http>
<time>${acs-share.timeout}</time>
</wait>
</run>
</image>
</images>
</configuration>
</execution>
<execution>
<id>stop-acs-share</id>
<phase>post-integration-test</phase>
<goals><goal>stop</goal></goals>
<configuration>
<images>
<image>
<name>docker.inteligr8.com/inteligr8/tomcat-rad:${tomcat-rad.version}</name>
<alias>acs-share</alias>
</image>
</images>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>default-props</id>
<activation>
<property>
<name>!some-prop-that-never-exists</name>
</property>
</activation>
<properties>
<!-- configurable -->
<acs-platform.url>http://${project.artifactId}-acs-platform:8080</acs-platform.url>
<acs-share.timeout>45000</acs-share.timeout>
<project.build.shareExtDirectory>${project.build.directory}/ext/share</project.build.shareExtDirectory>
<!-- ports -->
<acs-share.port>8180</acs-share.port>
<!-- versions -->
<tomcat-rad.version>9-1.3</tomcat-rad.version>
<!-- configuring beedk-acs-webapp-artifact-tile -->
<alfresco.war.artifactId>share</alfresco.war.artifactId>
<alfresco.war.version>${alfresco.share.version}</alfresco.war.version>
</properties>
</profile>
</profiles>
<tiles>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-run-tile -->
<tile>com.inteligr8.ootbee:beedk-run-tile:1.0-SNAPSHOT</tile>
<!-- Documentation: https://bitbucket.org/inteligr8/ootbee-beedk/src/stable/beedk-acs-webapp-artifact-it-tile -->
<tile>com.inteligr8.ootbee:beedk-acs-webapp-artifact-it-tile:1.0-SNAPSHOT</tile>
</tiles>
</project>