From bc093cc69adb58b34298644df2dfb76d9b1ae32c Mon Sep 17 00:00:00 2001 From: "Brian M. Long" Date: Thu, 6 Feb 2025 12:20:50 -0500 Subject: [PATCH] added APS integration test tile --- beedk-aps-ext-it-tile/.gitignore | 9 ++ beedk-aps-ext-it-tile/README.md | 84 ++++++++++++ beedk-aps-ext-it-tile/pom.xml | 55 ++++++++ beedk-aps-ext-it-tile/tile.xml | 220 +++++++++++++++++++++++++++++++ beedk-aps-ext-rad-tile/README.md | 2 +- pom.xml | 1 + 6 files changed, 370 insertions(+), 1 deletion(-) create mode 100644 beedk-aps-ext-it-tile/.gitignore create mode 100644 beedk-aps-ext-it-tile/README.md create mode 100644 beedk-aps-ext-it-tile/pom.xml create mode 100644 beedk-aps-ext-it-tile/tile.xml diff --git a/beedk-aps-ext-it-tile/.gitignore b/beedk-aps-ext-it-tile/.gitignore new file mode 100644 index 0000000..8c37f05 --- /dev/null +++ b/beedk-aps-ext-it-tile/.gitignore @@ -0,0 +1,9 @@ +# Eclipse +.project +.classpath +.settings + +# Maven +pom.xml.versionsBackup +target + diff --git a/beedk-aps-ext-it-tile/README.md b/beedk-aps-ext-it-tile/README.md new file mode 100644 index 0000000..6fd583b --- /dev/null +++ b/beedk-aps-ext-it-tile/README.md @@ -0,0 +1,84 @@ +# BeeDK APS Extension Maven Tile for Integration Tests + +This is a component within the proposed [BeeDK](/inteligr8/ootbee-beedk). It is considered to be part of the **Public 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 APS extension. + +## 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 + + ... + + ... + + + io.repaint.maven + tiles-maven-plugin + [2.0,3.0) + true + + + ... + + com.inteligr8.ootbee:beedk-aps-ext-it-tile:[1.1.0,2.0.0) + + + + ... + + ... + + ... + +``` + +## 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 | +| -------------------------- |:--------:| --------------- | ----------- | +| `aps.war.groupId` | | `org.alfresco` | | +| `aps.war.artifactId` | | `activiti-app` | | +| `aps.war.version` | **Yes** | | | +| `aps.port` | | 8080 | The port to expose on `localhost` for the developer; not for other applications or users. | +| `aps-postgres.port` | | 5432 | The port to expose on `localhost` for the developer; not for other applications or users. | +| `aps.debugger.port` | | 8000 | The port to expose on `localhost` for the developer; not for other applications or users. | +| `aps.tomcat.opts` | | | Additional `CATALINA_OPTS` to add to the Apache Tomcat startup.
*May be overridden by any POM parent or Maven Tile.* | +| `aps.timeout` | | 120000 | The time to wait for the startup to complete, in milliseconds. | +| `alfresco.license.directory` | | `${user.home}/alfresco/license` | The base path to search for Alfresco licenses. | +| `aps.license.directory` | | `${alfresco.license.directory}/aps` | The base path to search for an APS license. | +| `tomcat-rad.version` | | *not important* | The version of the [Apache Tomcat Rapid Application Development Docker container](/inteligr8/tomcat-rad-docker). | +| `aps-postgres.version` | | *not important* | The version of PostgreSQL to use in the integration testing infrastructure. | + +### Private API + +The following properties are only intended to be defined by BeeDK components. + +| Maven Property | Required | Default | Description | +| ------------------------------------ |:--------:| ------------------ | ----------- | +| `beedk.deploy.aps.warFile` | **Yes** | | The WAR file to deploy in the Apache Tomcat instance. | +| `beedk.deploy.aps.classesDirectory` | | | An additional classpath directory to sideload into the web application. | +| `beedk.deploy.aps.testClassesDirectory` | | | An additional test classpath directory to sideload into the web application. | +| `beedk.deploy.aps.extDirectory` | | | An additional directory of JARs to sideload into the web application. | +| `beedk.deploy.aps.warDirectory` | | `${project.build.warDirectory}` | A build directory for WAR files. | +| `beedk.deploy.aps.dataDirectory` | | `${project.build.directory}/alf_data` | The temporary binary storage location for ACS. | + +### Other APIs + +Additional less important configurations are inherited from the following Maven Tiles. + +* [`beedk-run-tile`](/inteligr8/ootbee-beedk/src/stable/beedk-run-tile) + +## Results + +The APS app and database will be started and stopped during the `pre-integration-test` and `post-integration-test` Maven phases, respectively. diff --git a/beedk-aps-ext-it-tile/pom.xml b/beedk-aps-ext-it-tile/pom.xml new file mode 100644 index 0000000..9a45815 --- /dev/null +++ b/beedk-aps-ext-it-tile/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + + beedk-aps-ext-it-tile + tile + + + com.inteligr8.ootbee + beedk-parent + 1.1.12 + .. + + + Order of the Bee Development Kit: Integration Testing for APS Extensions + https://bitbucket.org/inteligr8/ootbee-beedk + + + + GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 + https://www.gnu.org/licenses/lgpl-3.0.txt + + + + + scm:git:https://bitbucket.org/inteligr8/ootbee-beedk.git + scm:git:git@bitbucket.org:inteligr8/ootbee-beedk.git + https://bitbucket.org/inteligr8/ootbee-beedk + + + Order of the Bee + https://orderofthebee.net + + + + brian.long + Brian Long + brian@inteligr8.com + Inteligr8 + https://www.inteligr8.com + https://twitter.com/brianmlong + + + + + + + io.repaint.maven + tiles-maven-plugin + + + + diff --git a/beedk-aps-ext-it-tile/tile.xml b/beedk-aps-ext-it-tile/tile.xml new file mode 100644 index 0000000..b48f859 --- /dev/null +++ b/beedk-aps-ext-it-tile/tile.xml @@ -0,0 +1,220 @@ + + + + + + + + + maven-dependency-plugin + 3.6.1 + + + + download-jars + pre-integration-test + copy-dependencies + + provided + jar + ${beedk.deploy.aps.extDirectory} + + + + + download-webapp + pre-integration-test + copy + + + + ${aps.war.groupId} + ${aps.war.artifactId} + ${aps.war.version} + war + + + ${beedk.deploy.aps.warDirectory} + + + + + + + io.fabric8 + docker-maven-plugin + + + start-aps-app + pre-integration-test + start + + true + + + postgres:${aps-postgres.version} + aps-db + + ${skipTests} + + alfresco + alfresco + activiti + + + ${aps-postgres.port}:5432 + + + custom + ${project.artifactId} + + + + + docker.inteligr8.com/inteligr8/tomcat-rad:${tomcat-rad.version} + aps-app + + ${skipTests} + + ${aps.memory} + false + false + --add-opens java.base/java.net=ALL-UNNAMED \ + -Djava.awt.headless=true \ + -Ddatasource.driver=org.postgresql.Driver -Ddatasource.url=jdbc:postgresql://${project.artifactId}-aps-db:5432/activiti \ + -Djavascript.secure-scripting.enabled=false -Djavascript.secure-scripting.enable-class-whitelisting=false \ + -Dbeans.whitelisting.enabled=false \ + -Del.whitelisting.enabled=false \ + -Dshell.whitelisting.enabled=false \ + -Dservice.task.class.whitelisting.enabled=false \ + ${aps.tomcat.opts} + + + ${aps.port}:8080 + ${aps.debugger.port}:8000 + + + aps-db + + + custom + ${project.artifactId} + + + + ${aps.license.directory}:/root/.activiti/enterprise-license:ro + ${project.build.warFile}:/var/lib/tomcat/webapps/activiti-app.war:ro + ${beedk.deploy.aps.classesDirectory}:/var/lib/tomcat/dev/post-rsrc:ro + ${beedk.deploy.aps.testClassesDirectory}:/var/lib/tomcat/dev/post-rsrc-extra1:ro + ${beedk.deploy.aps.extDirectory}:/var/lib/tomcat/dev/lib:ro + + + + + http://admin%40app.activiti.com:admin@localhost:${aps.port}/activiti-app/api/management/engine + GET + 200 + + + + + + + + + + stop-aps-app + post-integration-test + stop + + + + postgres:${acs-postgres.version} + acs-db + + + docker.inteligr8.com/inteligr8/tomcat-rad:${tomcat-rad.version} + acs-platform + + + + + + + + + + + + + tomcat-opts-unspecified + + + !aps.tomcat.opts + + + + + + + + default-props + + + !some-prop-that-never-exists + + + + + com.activiti + activiti-app + ${aps.version} + ${project.build.directory}/war + ${project.build.outputDirectory} + ${project.build.testOutputDirectory} + ${project.build.directory}/ext + ${project.build.warDirectory} + 60000 + 512m + true + ${user.home}/alfresco/license + ${alfresco.license.directory}/aps + + + 5433 + 8080 + 8000 + + + 12 + 2.4.6 + 9-2.2 + + + ${project.build.warDirectory}/${aps.war.artifactId}-${aps.war.version}.war + + + + + + + @project.groupId@:beedk-run-tile:@project.version@ + + + diff --git a/beedk-aps-ext-rad-tile/README.md b/beedk-aps-ext-rad-tile/README.md index 6c3f99e..87bfe54 100644 --- a/beedk-aps-ext-rad-tile/README.md +++ b/beedk-aps-ext-rad-tile/README.md @@ -85,4 +85,4 @@ Additional less important configurations are inherited from the following Maven ## Results -The ACS Platform, database, and MQ components will be started during the `process-classes` Maven phase. +The APS app and database will be started during the `process-classes` Maven phase. diff --git a/pom.xml b/pom.xml index 1908112..3b962a7 100644 --- a/pom.xml +++ b/pom.xml @@ -101,6 +101,7 @@ beedk-acs-platform-artifact-it-tile beedk-acs-share-self-it-tile beedk-ate-it-tile + beedk-aps-ext-it-tile beedk-acs-module-tile beedk-acs-platform-module-tile