From 3a3475c306e5dc24e91ea366691b79db4a147b74 Mon Sep 17 00:00:00 2001 From: Michael Seaton Date: Sun, 17 Nov 2024 11:07:09 -0500 Subject: [PATCH 1/6] SDK-357 - Follow maven recommended best practices for unit and integration tests --- integration-tests/.gitignore | 12 ----- integration-tests/pom.xml | 50 ------------------- .../openmrs/maven/plugins/AbstractSdkIT.java | 3 +- .../maven/plugins/AddDependencyIT.java | 4 +- .../openmrs/maven/plugins/AddExclusionIT.java | 2 +- .../openmrs/maven/plugins/BuildDistroIT.java | 2 +- .../org/openmrs/maven/plugins/BuildIT.java | 2 +- .../org/openmrs/maven/plugins/CloneIT.java | 2 +- .../maven/plugins/CreateProjectIT.java | 2 +- .../org/openmrs/maven/plugins/DeployIT.java | 3 +- .../org/openmrs/maven/plugins/FetchIT.java | 2 +- .../org/openmrs/maven/plugins/PullIT.java | 2 +- .../maven/plugins/RemoveDependencyIT.java | 2 +- .../org/openmrs/maven/plugins/ResetIT.java | 9 +--- .../openmrs/maven/plugins/SdkMatchers.java | 0 .../org/openmrs/maven/plugins/SetupIT.java | 2 +- .../integration-test/buildIT/app/css/test.css | 0 .../integration-test/buildIT/app/index.html | 0 .../buildIT/app/js/main/main.component.js | 0 .../buildIT/app/js/main/main.controller.js | 0 .../buildIT/app/js/main/main.html | 0 .../buildIT/app/js/main/main.js | 0 .../integration-test/buildIT/app/js/test.js | 0 .../buildIT/app/manifest.webapp | 0 .../integration-test/buildIT/config.json | 0 .../buildIT/module1/api/pom.xml | 0 .../module/module1/module1Activator.java | 0 .../src/main/resources/messages.properties | 0 .../src/main/resources/messages_es.properties | 0 .../src/main/resources/messages_fr.properties | 0 .../resources/moduleApplicationContext.xml | 0 .../buildIT/module1/omod/pom.xml | 0 .../omod/src/main/resources/config.xml | 0 .../resources/webModuleApplicationContext.xml | 0 .../integration-test/buildIT/module1/pom.xml | 0 .../buildIT/module2/api/pom.xml | 0 .../module/module2/module2Activator.java | 0 .../src/main/resources/messages.properties | 0 .../src/main/resources/messages_es.properties | 0 .../src/main/resources/messages_fr.properties | 0 .../resources/moduleApplicationContext.xml | 0 .../buildIT/module2/omod/pom.xml | 0 .../omod/src/main/resources/config.xml | 0 .../resources/webModuleApplicationContext.xml | 0 .../integration-test/buildIT/module2/pom.xml | 0 .../integration-test/buildIT/package.json | 0 .../integration-test/buildIT/pom.xml | 0 .../buildIT/sdk-stats.properties | 0 .../buildIT/webpack.config.js | 0 ...openmrs-distro-parent-as-distro.properties | 0 ...openmrs-distro-parent-as-parent.properties | 0 .../openmrs-distro-spa-artifacts.properties | 0 .../openmrs-distro-spa-build.properties | 0 .../openmrs-distro.properties | 0 .../test/resources/integration-test/pom.xml | 0 pom.xml | 34 +++++++++++-- 56 files changed, 44 insertions(+), 89 deletions(-) delete mode 100644 integration-tests/.gitignore delete mode 100644 integration-tests/pom.xml rename integration-tests/src/test/java/org/openmrs/maven/plugins/AbstractSdkIntegrationTest.java => maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractSdkIT.java (99%) rename integration-tests/src/test/java/org/openmrs/maven/plugins/AddDependencyTest.java => maven-plugin/src/test/java/org/openmrs/maven/plugins/AddDependencyIT.java (97%) rename integration-tests/src/test/java/org/openmrs/maven/plugins/AddExclusionIntegrationTest.java => maven-plugin/src/test/java/org/openmrs/maven/plugins/AddExclusionIT.java (98%) rename integration-tests/src/test/java/org/openmrs/maven/plugins/BuildDistroIntegrationTest.java => maven-plugin/src/test/java/org/openmrs/maven/plugins/BuildDistroIT.java (98%) rename integration-tests/src/test/java/org/openmrs/maven/plugins/BuildIntegrationTest.java => maven-plugin/src/test/java/org/openmrs/maven/plugins/BuildIT.java (96%) rename integration-tests/src/test/java/org/openmrs/maven/plugins/CloneIntegrationTest.java => maven-plugin/src/test/java/org/openmrs/maven/plugins/CloneIT.java (95%) rename integration-tests/src/test/java/org/openmrs/maven/plugins/CreateProjectIntegrationTest.java => maven-plugin/src/test/java/org/openmrs/maven/plugins/CreateProjectIT.java (98%) rename integration-tests/src/test/java/org/openmrs/maven/plugins/DeployIntegrationTest.java => maven-plugin/src/test/java/org/openmrs/maven/plugins/DeployIT.java (98%) rename integration-tests/src/test/java/org/openmrs/maven/plugins/FetchIntegrationTest.java => maven-plugin/src/test/java/org/openmrs/maven/plugins/FetchIT.java (97%) rename integration-tests/src/test/java/org/openmrs/maven/plugins/PullIntegrationTest.java => maven-plugin/src/test/java/org/openmrs/maven/plugins/PullIT.java (97%) rename integration-tests/src/test/java/org/openmrs/maven/plugins/RemoveDependencyTest.java => maven-plugin/src/test/java/org/openmrs/maven/plugins/RemoveDependencyIT.java (93%) rename integration-tests/src/test/java/org/openmrs/maven/plugins/ResetIntegrationTest.java => maven-plugin/src/test/java/org/openmrs/maven/plugins/ResetIT.java (69%) rename {integration-tests => maven-plugin}/src/test/java/org/openmrs/maven/plugins/SdkMatchers.java (100%) rename integration-tests/src/test/java/org/openmrs/maven/plugins/SetupIntegrationTest.java => maven-plugin/src/test/java/org/openmrs/maven/plugins/SetupIT.java (99%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/app/css/test.css (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/app/index.html (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/app/js/main/main.component.js (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/app/js/main/main.controller.js (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/app/js/main/main.html (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/app/js/main/main.js (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/app/js/test.js (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/app/manifest.webapp (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/config.json (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/module1/api/pom.xml (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/module1/api/src/main/java/org/openmrs/module/module1/module1Activator.java (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/module1/api/src/main/resources/messages.properties (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/module1/api/src/main/resources/messages_es.properties (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/module1/api/src/main/resources/messages_fr.properties (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/module1/api/src/main/resources/moduleApplicationContext.xml (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/module1/omod/pom.xml (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/module1/omod/src/main/resources/config.xml (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/module1/omod/src/main/resources/webModuleApplicationContext.xml (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/module1/pom.xml (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/module2/api/pom.xml (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/module2/api/src/main/java/org/openmrs/module/module2/module2Activator.java (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/module2/api/src/main/resources/messages.properties (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/module2/api/src/main/resources/messages_es.properties (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/module2/api/src/main/resources/messages_fr.properties (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/module2/api/src/main/resources/moduleApplicationContext.xml (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/module2/omod/pom.xml (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/module2/omod/src/main/resources/config.xml (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/module2/omod/src/main/resources/webModuleApplicationContext.xml (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/module2/pom.xml (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/package.json (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/pom.xml (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/sdk-stats.properties (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/buildIT/webpack.config.js (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/openmrs-distro-parent-as-distro.properties (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/openmrs-distro-parent-as-parent.properties (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/openmrs-distro-spa-artifacts.properties (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/openmrs-distro-spa-build.properties (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/openmrs-distro.properties (100%) rename {integration-tests => maven-plugin}/src/test/resources/integration-test/pom.xml (100%) diff --git a/integration-tests/.gitignore b/integration-tests/.gitignore deleted file mode 100644 index bcfe27ba7..000000000 --- a/integration-tests/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -*.iml -target/ -.idea/ -*~ -/openmrs-sdk.bat - -*.class - -/.settings -/.project -/.classpath -.DS_Store \ No newline at end of file diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml deleted file mode 100644 index 582e7a6c4..000000000 --- a/integration-tests/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - 4.0.0 - - - org.openmrs.maven - openmrs-sdk - 6.1.0-SNAPSHOT - - - openmrs-sdk-integration-tests - - OpenMRS SDK Integration Tests - Set of integration tests for OpenMRS SDK Maven Plugin - https://wiki.openmrs.org/display/docs/OpenMRS+SDK - - - - - org.openmrs.maven.plugins - openmrs-sdk-maven-plugin - ${project.parent.version} - - - - org.apache.maven.shared - maven-verifier - test - - - junit - junit - test - - - org.hamcrest - hamcrest-core - test - - - org.hamcrest - hamcrest-library - test - - - org.semver4j - semver4j - - - diff --git a/integration-tests/src/test/java/org/openmrs/maven/plugins/AbstractSdkIntegrationTest.java b/maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractSdkIT.java similarity index 99% rename from integration-tests/src/test/java/org/openmrs/maven/plugins/AbstractSdkIntegrationTest.java rename to maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractSdkIT.java index 5a81f35a6..a9f8bbeac 100644 --- a/integration-tests/src/test/java/org/openmrs/maven/plugins/AbstractSdkIntegrationTest.java +++ b/maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractSdkIT.java @@ -1,7 +1,6 @@ package org.openmrs.maven.plugins; import org.apache.commons.io.FileUtils; -import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; import org.apache.maven.it.VerificationException; import org.apache.maven.it.Verifier; @@ -48,7 +47,7 @@ @RunWith(BlockJUnit4ClassRunner.class) -public abstract class AbstractSdkIntegrationTest { +public abstract class AbstractSdkIT { /** * contains name of directory in project's target dir, where integration tests are conducted diff --git a/integration-tests/src/test/java/org/openmrs/maven/plugins/AddDependencyTest.java b/maven-plugin/src/test/java/org/openmrs/maven/plugins/AddDependencyIT.java similarity index 97% rename from integration-tests/src/test/java/org/openmrs/maven/plugins/AddDependencyTest.java rename to maven-plugin/src/test/java/org/openmrs/maven/plugins/AddDependencyIT.java index dd6292432..de67c1b01 100644 --- a/integration-tests/src/test/java/org/openmrs/maven/plugins/AddDependencyTest.java +++ b/maven-plugin/src/test/java/org/openmrs/maven/plugins/AddDependencyIT.java @@ -4,13 +4,11 @@ import org.openmrs.maven.plugins.model.DistroProperties; import org.openmrs.maven.plugins.utility.DistroHelper; -import java.io.File; - import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -public class AddDependencyTest extends AbstractSdkIntegrationTest { +public class AddDependencyIT extends AbstractSdkIT { @Test public void shouldAddOmodDependency() throws Exception { diff --git a/integration-tests/src/test/java/org/openmrs/maven/plugins/AddExclusionIntegrationTest.java b/maven-plugin/src/test/java/org/openmrs/maven/plugins/AddExclusionIT.java similarity index 98% rename from integration-tests/src/test/java/org/openmrs/maven/plugins/AddExclusionIntegrationTest.java rename to maven-plugin/src/test/java/org/openmrs/maven/plugins/AddExclusionIT.java index 003c08cf0..5fb02863e 100644 --- a/integration-tests/src/test/java/org/openmrs/maven/plugins/AddExclusionIntegrationTest.java +++ b/maven-plugin/src/test/java/org/openmrs/maven/plugins/AddExclusionIT.java @@ -12,7 +12,7 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; -public class AddExclusionIntegrationTest extends AbstractSdkIntegrationTest { +public class AddExclusionIT extends AbstractSdkIT { public DistroProperties getDistroProperties() { return DistroHelper.getDistroPropertiesFromFile(distroFile); diff --git a/integration-tests/src/test/java/org/openmrs/maven/plugins/BuildDistroIntegrationTest.java b/maven-plugin/src/test/java/org/openmrs/maven/plugins/BuildDistroIT.java similarity index 98% rename from integration-tests/src/test/java/org/openmrs/maven/plugins/BuildDistroIntegrationTest.java rename to maven-plugin/src/test/java/org/openmrs/maven/plugins/BuildDistroIT.java index b95b681ff..56d2f8de4 100644 --- a/integration-tests/src/test/java/org/openmrs/maven/plugins/BuildDistroIntegrationTest.java +++ b/maven-plugin/src/test/java/org/openmrs/maven/plugins/BuildDistroIT.java @@ -2,7 +2,7 @@ import org.junit.Test; -public class BuildDistroIntegrationTest extends AbstractSdkIntegrationTest { +public class BuildDistroIT extends AbstractSdkIT { @Test public void testBuildDistroFromDistroFile() throws Exception { diff --git a/integration-tests/src/test/java/org/openmrs/maven/plugins/BuildIntegrationTest.java b/maven-plugin/src/test/java/org/openmrs/maven/plugins/BuildIT.java similarity index 96% rename from integration-tests/src/test/java/org/openmrs/maven/plugins/BuildIntegrationTest.java rename to maven-plugin/src/test/java/org/openmrs/maven/plugins/BuildIT.java index b879d1abc..aecce120e 100644 --- a/integration-tests/src/test/java/org/openmrs/maven/plugins/BuildIntegrationTest.java +++ b/maven-plugin/src/test/java/org/openmrs/maven/plugins/BuildIT.java @@ -8,7 +8,7 @@ import java.io.File; -public class BuildIntegrationTest extends AbstractSdkIntegrationTest { +public class BuildIT extends AbstractSdkIT { private String serverId; diff --git a/integration-tests/src/test/java/org/openmrs/maven/plugins/CloneIntegrationTest.java b/maven-plugin/src/test/java/org/openmrs/maven/plugins/CloneIT.java similarity index 95% rename from integration-tests/src/test/java/org/openmrs/maven/plugins/CloneIntegrationTest.java rename to maven-plugin/src/test/java/org/openmrs/maven/plugins/CloneIT.java index f65e41bfa..3ba86dc7e 100644 --- a/integration-tests/src/test/java/org/openmrs/maven/plugins/CloneIntegrationTest.java +++ b/maven-plugin/src/test/java/org/openmrs/maven/plugins/CloneIT.java @@ -11,7 +11,7 @@ import static org.hamcrest.CoreMatchers.hasItem; import static org.hamcrest.MatcherAssert.assertThat; -public class CloneIntegrationTest extends AbstractSdkIntegrationTest { +public class CloneIT extends AbstractSdkIT { @Test public void clone_shouldCloneRepository() throws Exception { diff --git a/integration-tests/src/test/java/org/openmrs/maven/plugins/CreateProjectIntegrationTest.java b/maven-plugin/src/test/java/org/openmrs/maven/plugins/CreateProjectIT.java similarity index 98% rename from integration-tests/src/test/java/org/openmrs/maven/plugins/CreateProjectIntegrationTest.java rename to maven-plugin/src/test/java/org/openmrs/maven/plugins/CreateProjectIT.java index 974ff87f5..9112f5fa4 100644 --- a/integration-tests/src/test/java/org/openmrs/maven/plugins/CreateProjectIntegrationTest.java +++ b/maven-plugin/src/test/java/org/openmrs/maven/plugins/CreateProjectIT.java @@ -5,7 +5,7 @@ import org.junit.Before; import org.junit.Test; -public class CreateProjectIntegrationTest extends AbstractSdkIntegrationTest { +public class CreateProjectIT extends AbstractSdkIT { Model model; diff --git a/integration-tests/src/test/java/org/openmrs/maven/plugins/DeployIntegrationTest.java b/maven-plugin/src/test/java/org/openmrs/maven/plugins/DeployIT.java similarity index 98% rename from integration-tests/src/test/java/org/openmrs/maven/plugins/DeployIntegrationTest.java rename to maven-plugin/src/test/java/org/openmrs/maven/plugins/DeployIT.java index 69bedf426..cb87c0c7d 100644 --- a/integration-tests/src/test/java/org/openmrs/maven/plugins/DeployIntegrationTest.java +++ b/maven-plugin/src/test/java/org/openmrs/maven/plugins/DeployIT.java @@ -1,6 +1,5 @@ package org.openmrs.maven.plugins; -import org.junit.After; import org.junit.Before; import org.junit.Test; import org.openmrs.maven.plugins.model.Artifact; @@ -16,7 +15,7 @@ import static org.openmrs.maven.plugins.SdkMatchers.hasUserOwa; import static org.openmrs.maven.plugins.SdkMatchers.serverHasVersion; -public class DeployIntegrationTest extends AbstractSdkIntegrationTest { +public class DeployIT extends AbstractSdkIT { private static String testServerId; diff --git a/integration-tests/src/test/java/org/openmrs/maven/plugins/FetchIntegrationTest.java b/maven-plugin/src/test/java/org/openmrs/maven/plugins/FetchIT.java similarity index 97% rename from integration-tests/src/test/java/org/openmrs/maven/plugins/FetchIntegrationTest.java rename to maven-plugin/src/test/java/org/openmrs/maven/plugins/FetchIT.java index c7c17a0ee..6829dc2e8 100644 --- a/integration-tests/src/test/java/org/openmrs/maven/plugins/FetchIntegrationTest.java +++ b/maven-plugin/src/test/java/org/openmrs/maven/plugins/FetchIT.java @@ -5,7 +5,7 @@ import java.io.File; -public class FetchIntegrationTest extends AbstractSdkIntegrationTest{ +public class FetchIT extends AbstractSdkIT { private final static String FETCH_DIRECTORY_NAME = "fetch"; diff --git a/integration-tests/src/test/java/org/openmrs/maven/plugins/PullIntegrationTest.java b/maven-plugin/src/test/java/org/openmrs/maven/plugins/PullIT.java similarity index 97% rename from integration-tests/src/test/java/org/openmrs/maven/plugins/PullIntegrationTest.java rename to maven-plugin/src/test/java/org/openmrs/maven/plugins/PullIT.java index cb8b0239b..602a0dda7 100644 --- a/integration-tests/src/test/java/org/openmrs/maven/plugins/PullIntegrationTest.java +++ b/maven-plugin/src/test/java/org/openmrs/maven/plugins/PullIT.java @@ -11,7 +11,7 @@ import java.io.File; -public class PullIntegrationTest extends AbstractSdkIntegrationTest { +public class PullIT extends AbstractSdkIT { private static final String OPENMRS_MODULE_IDGEN = "openmrs-module-idgen"; private static final String PULL_GOAL = "pull"; diff --git a/integration-tests/src/test/java/org/openmrs/maven/plugins/RemoveDependencyTest.java b/maven-plugin/src/test/java/org/openmrs/maven/plugins/RemoveDependencyIT.java similarity index 93% rename from integration-tests/src/test/java/org/openmrs/maven/plugins/RemoveDependencyTest.java rename to maven-plugin/src/test/java/org/openmrs/maven/plugins/RemoveDependencyIT.java index ff914ec0b..56006bb86 100644 --- a/integration-tests/src/test/java/org/openmrs/maven/plugins/RemoveDependencyTest.java +++ b/maven-plugin/src/test/java/org/openmrs/maven/plugins/RemoveDependencyIT.java @@ -8,7 +8,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -public class RemoveDependencyTest extends AbstractSdkIntegrationTest { +public class RemoveDependencyIT extends AbstractSdkIT { @Test public void shouldRemoveExistingDependency() throws Exception { diff --git a/integration-tests/src/test/java/org/openmrs/maven/plugins/ResetIntegrationTest.java b/maven-plugin/src/test/java/org/openmrs/maven/plugins/ResetIT.java similarity index 69% rename from integration-tests/src/test/java/org/openmrs/maven/plugins/ResetIntegrationTest.java rename to maven-plugin/src/test/java/org/openmrs/maven/plugins/ResetIT.java index 5604dc245..8a9f34e5f 100644 --- a/integration-tests/src/test/java/org/openmrs/maven/plugins/ResetIntegrationTest.java +++ b/maven-plugin/src/test/java/org/openmrs/maven/plugins/ResetIT.java @@ -1,17 +1,10 @@ package org.openmrs.maven.plugins; -import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.MatcherAssert.assertThat; -import java.nio.charset.StandardCharsets; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.UUID; - -import org.apache.commons.io.FileUtils; import org.junit.Test; -public class ResetIntegrationTest extends AbstractSdkIntegrationTest { +public class ResetIT extends AbstractSdkIT { @Test public void reset_shouldResetExistingServer() throws Exception { diff --git a/integration-tests/src/test/java/org/openmrs/maven/plugins/SdkMatchers.java b/maven-plugin/src/test/java/org/openmrs/maven/plugins/SdkMatchers.java similarity index 100% rename from integration-tests/src/test/java/org/openmrs/maven/plugins/SdkMatchers.java rename to maven-plugin/src/test/java/org/openmrs/maven/plugins/SdkMatchers.java diff --git a/integration-tests/src/test/java/org/openmrs/maven/plugins/SetupIntegrationTest.java b/maven-plugin/src/test/java/org/openmrs/maven/plugins/SetupIT.java similarity index 99% rename from integration-tests/src/test/java/org/openmrs/maven/plugins/SetupIntegrationTest.java rename to maven-plugin/src/test/java/org/openmrs/maven/plugins/SetupIT.java index 2e0954d69..3ff1751c1 100644 --- a/integration-tests/src/test/java/org/openmrs/maven/plugins/SetupIntegrationTest.java +++ b/maven-plugin/src/test/java/org/openmrs/maven/plugins/SetupIT.java @@ -27,7 +27,7 @@ import static org.openmrs.maven.plugins.SdkMatchers.serverHasDebugPort; import static org.openmrs.maven.plugins.SdkMatchers.serverHasVersion; -public class SetupIntegrationTest extends AbstractSdkIntegrationTest { +public class SetupIT extends AbstractSdkIT { @Test public void setup_shouldInstallRefapp2_3_1() throws Exception{ diff --git a/integration-tests/src/test/resources/integration-test/buildIT/app/css/test.css b/maven-plugin/src/test/resources/integration-test/buildIT/app/css/test.css similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/app/css/test.css rename to maven-plugin/src/test/resources/integration-test/buildIT/app/css/test.css diff --git a/integration-tests/src/test/resources/integration-test/buildIT/app/index.html b/maven-plugin/src/test/resources/integration-test/buildIT/app/index.html similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/app/index.html rename to maven-plugin/src/test/resources/integration-test/buildIT/app/index.html diff --git a/integration-tests/src/test/resources/integration-test/buildIT/app/js/main/main.component.js b/maven-plugin/src/test/resources/integration-test/buildIT/app/js/main/main.component.js similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/app/js/main/main.component.js rename to maven-plugin/src/test/resources/integration-test/buildIT/app/js/main/main.component.js diff --git a/integration-tests/src/test/resources/integration-test/buildIT/app/js/main/main.controller.js b/maven-plugin/src/test/resources/integration-test/buildIT/app/js/main/main.controller.js similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/app/js/main/main.controller.js rename to maven-plugin/src/test/resources/integration-test/buildIT/app/js/main/main.controller.js diff --git a/integration-tests/src/test/resources/integration-test/buildIT/app/js/main/main.html b/maven-plugin/src/test/resources/integration-test/buildIT/app/js/main/main.html similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/app/js/main/main.html rename to maven-plugin/src/test/resources/integration-test/buildIT/app/js/main/main.html diff --git a/integration-tests/src/test/resources/integration-test/buildIT/app/js/main/main.js b/maven-plugin/src/test/resources/integration-test/buildIT/app/js/main/main.js similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/app/js/main/main.js rename to maven-plugin/src/test/resources/integration-test/buildIT/app/js/main/main.js diff --git a/integration-tests/src/test/resources/integration-test/buildIT/app/js/test.js b/maven-plugin/src/test/resources/integration-test/buildIT/app/js/test.js similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/app/js/test.js rename to maven-plugin/src/test/resources/integration-test/buildIT/app/js/test.js diff --git a/integration-tests/src/test/resources/integration-test/buildIT/app/manifest.webapp b/maven-plugin/src/test/resources/integration-test/buildIT/app/manifest.webapp similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/app/manifest.webapp rename to maven-plugin/src/test/resources/integration-test/buildIT/app/manifest.webapp diff --git a/integration-tests/src/test/resources/integration-test/buildIT/config.json b/maven-plugin/src/test/resources/integration-test/buildIT/config.json similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/config.json rename to maven-plugin/src/test/resources/integration-test/buildIT/config.json diff --git a/integration-tests/src/test/resources/integration-test/buildIT/module1/api/pom.xml b/maven-plugin/src/test/resources/integration-test/buildIT/module1/api/pom.xml similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/module1/api/pom.xml rename to maven-plugin/src/test/resources/integration-test/buildIT/module1/api/pom.xml diff --git a/integration-tests/src/test/resources/integration-test/buildIT/module1/api/src/main/java/org/openmrs/module/module1/module1Activator.java b/maven-plugin/src/test/resources/integration-test/buildIT/module1/api/src/main/java/org/openmrs/module/module1/module1Activator.java similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/module1/api/src/main/java/org/openmrs/module/module1/module1Activator.java rename to maven-plugin/src/test/resources/integration-test/buildIT/module1/api/src/main/java/org/openmrs/module/module1/module1Activator.java diff --git a/integration-tests/src/test/resources/integration-test/buildIT/module1/api/src/main/resources/messages.properties b/maven-plugin/src/test/resources/integration-test/buildIT/module1/api/src/main/resources/messages.properties similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/module1/api/src/main/resources/messages.properties rename to maven-plugin/src/test/resources/integration-test/buildIT/module1/api/src/main/resources/messages.properties diff --git a/integration-tests/src/test/resources/integration-test/buildIT/module1/api/src/main/resources/messages_es.properties b/maven-plugin/src/test/resources/integration-test/buildIT/module1/api/src/main/resources/messages_es.properties similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/module1/api/src/main/resources/messages_es.properties rename to maven-plugin/src/test/resources/integration-test/buildIT/module1/api/src/main/resources/messages_es.properties diff --git a/integration-tests/src/test/resources/integration-test/buildIT/module1/api/src/main/resources/messages_fr.properties b/maven-plugin/src/test/resources/integration-test/buildIT/module1/api/src/main/resources/messages_fr.properties similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/module1/api/src/main/resources/messages_fr.properties rename to maven-plugin/src/test/resources/integration-test/buildIT/module1/api/src/main/resources/messages_fr.properties diff --git a/integration-tests/src/test/resources/integration-test/buildIT/module1/api/src/main/resources/moduleApplicationContext.xml b/maven-plugin/src/test/resources/integration-test/buildIT/module1/api/src/main/resources/moduleApplicationContext.xml similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/module1/api/src/main/resources/moduleApplicationContext.xml rename to maven-plugin/src/test/resources/integration-test/buildIT/module1/api/src/main/resources/moduleApplicationContext.xml diff --git a/integration-tests/src/test/resources/integration-test/buildIT/module1/omod/pom.xml b/maven-plugin/src/test/resources/integration-test/buildIT/module1/omod/pom.xml similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/module1/omod/pom.xml rename to maven-plugin/src/test/resources/integration-test/buildIT/module1/omod/pom.xml diff --git a/integration-tests/src/test/resources/integration-test/buildIT/module1/omod/src/main/resources/config.xml b/maven-plugin/src/test/resources/integration-test/buildIT/module1/omod/src/main/resources/config.xml similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/module1/omod/src/main/resources/config.xml rename to maven-plugin/src/test/resources/integration-test/buildIT/module1/omod/src/main/resources/config.xml diff --git a/integration-tests/src/test/resources/integration-test/buildIT/module1/omod/src/main/resources/webModuleApplicationContext.xml b/maven-plugin/src/test/resources/integration-test/buildIT/module1/omod/src/main/resources/webModuleApplicationContext.xml similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/module1/omod/src/main/resources/webModuleApplicationContext.xml rename to maven-plugin/src/test/resources/integration-test/buildIT/module1/omod/src/main/resources/webModuleApplicationContext.xml diff --git a/integration-tests/src/test/resources/integration-test/buildIT/module1/pom.xml b/maven-plugin/src/test/resources/integration-test/buildIT/module1/pom.xml similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/module1/pom.xml rename to maven-plugin/src/test/resources/integration-test/buildIT/module1/pom.xml diff --git a/integration-tests/src/test/resources/integration-test/buildIT/module2/api/pom.xml b/maven-plugin/src/test/resources/integration-test/buildIT/module2/api/pom.xml similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/module2/api/pom.xml rename to maven-plugin/src/test/resources/integration-test/buildIT/module2/api/pom.xml diff --git a/integration-tests/src/test/resources/integration-test/buildIT/module2/api/src/main/java/org/openmrs/module/module2/module2Activator.java b/maven-plugin/src/test/resources/integration-test/buildIT/module2/api/src/main/java/org/openmrs/module/module2/module2Activator.java similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/module2/api/src/main/java/org/openmrs/module/module2/module2Activator.java rename to maven-plugin/src/test/resources/integration-test/buildIT/module2/api/src/main/java/org/openmrs/module/module2/module2Activator.java diff --git a/integration-tests/src/test/resources/integration-test/buildIT/module2/api/src/main/resources/messages.properties b/maven-plugin/src/test/resources/integration-test/buildIT/module2/api/src/main/resources/messages.properties similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/module2/api/src/main/resources/messages.properties rename to maven-plugin/src/test/resources/integration-test/buildIT/module2/api/src/main/resources/messages.properties diff --git a/integration-tests/src/test/resources/integration-test/buildIT/module2/api/src/main/resources/messages_es.properties b/maven-plugin/src/test/resources/integration-test/buildIT/module2/api/src/main/resources/messages_es.properties similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/module2/api/src/main/resources/messages_es.properties rename to maven-plugin/src/test/resources/integration-test/buildIT/module2/api/src/main/resources/messages_es.properties diff --git a/integration-tests/src/test/resources/integration-test/buildIT/module2/api/src/main/resources/messages_fr.properties b/maven-plugin/src/test/resources/integration-test/buildIT/module2/api/src/main/resources/messages_fr.properties similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/module2/api/src/main/resources/messages_fr.properties rename to maven-plugin/src/test/resources/integration-test/buildIT/module2/api/src/main/resources/messages_fr.properties diff --git a/integration-tests/src/test/resources/integration-test/buildIT/module2/api/src/main/resources/moduleApplicationContext.xml b/maven-plugin/src/test/resources/integration-test/buildIT/module2/api/src/main/resources/moduleApplicationContext.xml similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/module2/api/src/main/resources/moduleApplicationContext.xml rename to maven-plugin/src/test/resources/integration-test/buildIT/module2/api/src/main/resources/moduleApplicationContext.xml diff --git a/integration-tests/src/test/resources/integration-test/buildIT/module2/omod/pom.xml b/maven-plugin/src/test/resources/integration-test/buildIT/module2/omod/pom.xml similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/module2/omod/pom.xml rename to maven-plugin/src/test/resources/integration-test/buildIT/module2/omod/pom.xml diff --git a/integration-tests/src/test/resources/integration-test/buildIT/module2/omod/src/main/resources/config.xml b/maven-plugin/src/test/resources/integration-test/buildIT/module2/omod/src/main/resources/config.xml similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/module2/omod/src/main/resources/config.xml rename to maven-plugin/src/test/resources/integration-test/buildIT/module2/omod/src/main/resources/config.xml diff --git a/integration-tests/src/test/resources/integration-test/buildIT/module2/omod/src/main/resources/webModuleApplicationContext.xml b/maven-plugin/src/test/resources/integration-test/buildIT/module2/omod/src/main/resources/webModuleApplicationContext.xml similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/module2/omod/src/main/resources/webModuleApplicationContext.xml rename to maven-plugin/src/test/resources/integration-test/buildIT/module2/omod/src/main/resources/webModuleApplicationContext.xml diff --git a/integration-tests/src/test/resources/integration-test/buildIT/module2/pom.xml b/maven-plugin/src/test/resources/integration-test/buildIT/module2/pom.xml similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/module2/pom.xml rename to maven-plugin/src/test/resources/integration-test/buildIT/module2/pom.xml diff --git a/integration-tests/src/test/resources/integration-test/buildIT/package.json b/maven-plugin/src/test/resources/integration-test/buildIT/package.json similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/package.json rename to maven-plugin/src/test/resources/integration-test/buildIT/package.json diff --git a/integration-tests/src/test/resources/integration-test/buildIT/pom.xml b/maven-plugin/src/test/resources/integration-test/buildIT/pom.xml similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/pom.xml rename to maven-plugin/src/test/resources/integration-test/buildIT/pom.xml diff --git a/integration-tests/src/test/resources/integration-test/buildIT/sdk-stats.properties b/maven-plugin/src/test/resources/integration-test/buildIT/sdk-stats.properties similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/sdk-stats.properties rename to maven-plugin/src/test/resources/integration-test/buildIT/sdk-stats.properties diff --git a/integration-tests/src/test/resources/integration-test/buildIT/webpack.config.js b/maven-plugin/src/test/resources/integration-test/buildIT/webpack.config.js similarity index 100% rename from integration-tests/src/test/resources/integration-test/buildIT/webpack.config.js rename to maven-plugin/src/test/resources/integration-test/buildIT/webpack.config.js diff --git a/integration-tests/src/test/resources/integration-test/openmrs-distro-parent-as-distro.properties b/maven-plugin/src/test/resources/integration-test/openmrs-distro-parent-as-distro.properties similarity index 100% rename from integration-tests/src/test/resources/integration-test/openmrs-distro-parent-as-distro.properties rename to maven-plugin/src/test/resources/integration-test/openmrs-distro-parent-as-distro.properties diff --git a/integration-tests/src/test/resources/integration-test/openmrs-distro-parent-as-parent.properties b/maven-plugin/src/test/resources/integration-test/openmrs-distro-parent-as-parent.properties similarity index 100% rename from integration-tests/src/test/resources/integration-test/openmrs-distro-parent-as-parent.properties rename to maven-plugin/src/test/resources/integration-test/openmrs-distro-parent-as-parent.properties diff --git a/integration-tests/src/test/resources/integration-test/openmrs-distro-spa-artifacts.properties b/maven-plugin/src/test/resources/integration-test/openmrs-distro-spa-artifacts.properties similarity index 100% rename from integration-tests/src/test/resources/integration-test/openmrs-distro-spa-artifacts.properties rename to maven-plugin/src/test/resources/integration-test/openmrs-distro-spa-artifacts.properties diff --git a/integration-tests/src/test/resources/integration-test/openmrs-distro-spa-build.properties b/maven-plugin/src/test/resources/integration-test/openmrs-distro-spa-build.properties similarity index 100% rename from integration-tests/src/test/resources/integration-test/openmrs-distro-spa-build.properties rename to maven-plugin/src/test/resources/integration-test/openmrs-distro-spa-build.properties diff --git a/integration-tests/src/test/resources/integration-test/openmrs-distro.properties b/maven-plugin/src/test/resources/integration-test/openmrs-distro.properties similarity index 100% rename from integration-tests/src/test/resources/integration-test/openmrs-distro.properties rename to maven-plugin/src/test/resources/integration-test/openmrs-distro.properties diff --git a/integration-tests/src/test/resources/integration-test/pom.xml b/maven-plugin/src/test/resources/integration-test/pom.xml similarity index 100% rename from integration-tests/src/test/resources/integration-test/pom.xml rename to maven-plugin/src/test/resources/integration-test/pom.xml diff --git a/pom.xml b/pom.xml index ad36cdc90..075485a5c 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,6 @@ tomcat7-maven-plugin tomcat9-maven-plugin maven-plugin - integration-tests @@ -530,6 +529,10 @@ maven-gpg-plugin 3.1.0 + org.apache.maven.plugins maven-surefire-plugin @@ -543,6 +546,31 @@ + + + integration-tests + + + + org.apache.maven.plugins + maven-failsafe-plugin + 3.1.2 + + + + integration-test + verify + + + + + + + release @@ -550,7 +578,7 @@ org.apache.maven.plugins maven-source-plugin - 3.3.0 + 3.2.1 attach-sources @@ -563,7 +591,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.5.0 + 3.4.1 attach-javadocs From f6182a8bb965d42471a6da95de17f392cdbc7de8 Mon Sep 17 00:00:00 2001 From: Michael Seaton Date: Mon, 18 Nov 2024 00:32:52 -0500 Subject: [PATCH 2/6] SDK-357 - Integration tests can be created for helper classes --- maven-plugin/pom.xml | 34 +++++++ .../openmrs/maven/plugins/AbstractTask.java | 24 ++++- .../openmrs/maven/plugins/InvokeMethod.java | 92 +++++++++++++++++++ .../maven/plugins/AbstractMavenIT.java | 55 +++++++++++ .../openmrs/maven/plugins/AbstractSdkIT.java | 21 ++--- .../org/openmrs/maven/plugins/BuildIT.java | 3 +- .../plugins/utility/ArtifactHelperIT.java | 48 ++++++++++ .../integration-test/invokeIT/pom.xml | 72 +++++++++++++++ pom.xml | 8 ++ sdk-commons/pom.xml | 5 + .../maven/plugins/utility/ArtifactHelper.java | 76 +++++++++++++++ .../plugins/utility/MavenEnvironment.java | 23 +++++ 12 files changed, 444 insertions(+), 17 deletions(-) create mode 100644 maven-plugin/src/main/java/org/openmrs/maven/plugins/InvokeMethod.java create mode 100644 maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractMavenIT.java create mode 100644 maven-plugin/src/test/java/org/openmrs/maven/plugins/utility/ArtifactHelperIT.java create mode 100644 maven-plugin/src/test/resources/integration-test/invokeIT/pom.xml create mode 100644 sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/ArtifactHelper.java create mode 100644 sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/MavenEnvironment.java diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index c9705fe74..2fabab6ce 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -159,6 +159,12 @@ dom4j + + + org.projectlombok + lombok + + net.lingala.zip4j @@ -226,7 +232,35 @@ + + + src/test/resources + true + + integration-test/invokeIT/pom.xml + + + + src/test/resources + false + + integration-test/invokeIT/pom.xml + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.4.2 + + + + test-jar + + + + org.apache.maven.plugins maven-plugin-plugin diff --git a/maven-plugin/src/main/java/org/openmrs/maven/plugins/AbstractTask.java b/maven-plugin/src/main/java/org/openmrs/maven/plugins/AbstractTask.java index b7e19161d..272849fe2 100644 --- a/maven-plugin/src/main/java/org/openmrs/maven/plugins/AbstractTask.java +++ b/maven-plugin/src/main/java/org/openmrs/maven/plugins/AbstractTask.java @@ -1,5 +1,6 @@ package org.openmrs.maven.plugins; +import lombok.Getter; import org.apache.commons.lang.StringUtils; import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.metadata.ArtifactMetadataSource; @@ -12,14 +13,15 @@ import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; import org.apache.maven.settings.Settings; +import org.openmrs.maven.plugins.git.DefaultGitHelper; +import org.openmrs.maven.plugins.git.GitHelper; import org.openmrs.maven.plugins.model.Server; import org.openmrs.maven.plugins.utility.ConfigurationInstaller; import org.openmrs.maven.plugins.utility.DefaultJira; import org.openmrs.maven.plugins.utility.DistroHelper; -import org.openmrs.maven.plugins.git.DefaultGitHelper; -import org.openmrs.maven.plugins.git.GitHelper; import org.openmrs.maven.plugins.utility.DockerHelper; import org.openmrs.maven.plugins.utility.Jira; +import org.openmrs.maven.plugins.utility.MavenEnvironment; import org.openmrs.maven.plugins.utility.ModuleInstaller; import org.openmrs.maven.plugins.utility.NodeHelper; import org.openmrs.maven.plugins.utility.OwaHelper; @@ -140,10 +142,17 @@ public abstract class AbstractTask extends AbstractMojo { */ DockerHelper dockerHelper; + /** + * provides access to the current Maven environment + */ + @Getter + private MavenEnvironment mavenEnvironment; + public AbstractTask() { } public AbstractTask(AbstractTask other) { + this.mavenEnvironment = other.mavenEnvironment; this.mavenProject = other.mavenProject; this.mavenSession = other.mavenSession; this.wizard = other.wizard; @@ -155,6 +164,7 @@ public AbstractTask(AbstractTask other) { this.distroHelper = other.distroHelper; this.owaHelper = other.owaHelper; this.spaInstaller = other.spaInstaller; + this.configurationInstaller = other.configurationInstaller; this.gitHelper = other.gitHelper; this.dockerHelper = other.dockerHelper; this.settings = other.settings; @@ -166,6 +176,16 @@ public AbstractTask(AbstractTask other) { } public void initTask() { + if (mavenEnvironment == null) { + mavenEnvironment = new MavenEnvironment(); + mavenEnvironment.setMavenProject(mavenProject); + mavenEnvironment.setMavenSession(mavenSession); + mavenEnvironment.setSettings(settings); + mavenEnvironment.setArtifactMetadataSource(artifactMetadataSource); + mavenEnvironment.setArtifactFactory(artifactFactory); + mavenEnvironment.setPluginManager(pluginManager); + mavenEnvironment.setWizard(wizard); + } if (jira == null) { jira = new DefaultJira(); } diff --git a/maven-plugin/src/main/java/org/openmrs/maven/plugins/InvokeMethod.java b/maven-plugin/src/main/java/org/openmrs/maven/plugins/InvokeMethod.java new file mode 100644 index 000000000..6b5c5cf84 --- /dev/null +++ b/maven-plugin/src/main/java/org/openmrs/maven/plugins/InvokeMethod.java @@ -0,0 +1,92 @@ +package org.openmrs.maven.plugins; + +import lombok.Data; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.openmrs.maven.plugins.utility.MavenEnvironment; +import org.openmrs.maven.plugins.utility.Wizard; + +import java.lang.reflect.Method; + +/** + * The purpose is this Mojo is to support testing of helper utilities that are used by the various goals. This will: + * instantiate a new object of type className + * if this class has a setter property for a MavenExecution, this will be set + * it will then invoke the given testMethod on the testClass + */ +@Mojo(name = InvokeMethod.NAME) +@Data +public class InvokeMethod extends AbstractTask { + + public static final String NAME = "invoke-method"; + + @Parameter(property = "className") + String className; + + @Parameter(property = "methodName") + String methodName; + + public void executeTask() throws MojoExecutionException { + + if (StringUtils.isBlank(className) || StringUtils.isBlank(methodName)) { + throw new MojoExecutionException("You must supply both a className and methodName parameter"); + } + + Wizard wizard = getMavenEnvironment().getWizard(); + + wizard.showMessage("Invoking: " + className + ":" + methodName); + + Class clazz; + try { + clazz = getClass().getClassLoader().loadClass(className); + } + catch (ClassNotFoundException e) { + throw new MojoExecutionException("Unable to load class", e); + } + wizard.showMessage("Class " + clazz.getName() + " loaded successfully"); + + Object instance; + try { + instance = clazz.getConstructor().newInstance(); + } catch (Exception e) { + throw new MojoExecutionException("Unable to instantiate class with " + getClass(), e); + } + wizard.showMessage("New instance of " + clazz.getName() + " instantiated"); + + Method setterMethod = null; + try { + setterMethod = clazz.getMethod("set" + MavenEnvironment.class.getSimpleName(), MavenEnvironment.class); + } + catch (NoSuchMethodException ignored) { + } + + if (setterMethod != null) { + try { + setterMethod.invoke(instance, getMavenEnvironment()); + wizard.showMessage("Instance populated with maven environment"); + } + catch (Exception e) { + throw new MojoExecutionException("Unable to set MavenTestExecutor on class", e); + } + } + + Method method; + try { + method = clazz.getMethod(methodName); + } + catch (NoSuchMethodException e) { + throw new MojoExecutionException("Unable to find method: " + methodName, e); + } + wizard.showMessage("Got test method: " + method.getName()); + + try { + method.invoke(instance); + } + catch (Exception e) { + throw new MojoExecutionException("Error executing method: " + methodName, e); + } + wizard.showMessage("Method: " + method.getName() + " invoked successfully"); + } +} diff --git a/maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractMavenIT.java b/maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractMavenIT.java new file mode 100644 index 000000000..7b407ecf0 --- /dev/null +++ b/maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractMavenIT.java @@ -0,0 +1,55 @@ +package org.openmrs.maven.plugins; + + +import lombok.Getter; +import lombok.Setter; +import org.junit.Before; +import org.openmrs.maven.plugins.utility.MavenEnvironment; + +import java.io.File; + +@Getter @Setter +public abstract class AbstractMavenIT extends AbstractSdkIT { + + MavenEnvironment mavenEnvironment = null; + + @Override + @Before + public void setup() throws Exception { + super.setup(); + mavenEnvironment = null; + } + + @Override + void addTestResources() throws Exception { + includePomFile(TEST_DIRECTORY, "invokeIT", "pom.xml"); + } + + protected void executeTest(MavenEnvironmentFunction testFunction) throws Exception { + StackTraceElement invoker = Thread.currentThread().getStackTrace()[2]; + String className = invoker.getClassName(); + String testMethod = invoker.getMethodName(); + if (mavenEnvironment == null) { + addTaskParam("className", className); + addTaskParam("methodName", testMethod); + addTaskParam(BATCH_ANSWERS, getAnswers()); + addTaskParam("testMode", "true"); + String plugin = resolveSdkArtifact(); + verifier.executeGoal(plugin + ":" + InvokeMethod.NAME); + } + else { + testFunction.executeTest(mavenEnvironment); + } + } + + protected File getMavenTestDirectory() { + return new File(mavenEnvironment.getMavenProject().getBuild().getDirectory()); + } + + /** + * Simple interface that encapsulates a test that should be evaluated by tests that use this Mojo + */ + public interface MavenEnvironmentFunction { + void executeTest(MavenEnvironment mavenEnvironment) throws Exception; + } +} diff --git a/maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractSdkIT.java b/maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractSdkIT.java index a9f8bbeac..d5b49771e 100644 --- a/maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractSdkIT.java +++ b/maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractSdkIT.java @@ -83,25 +83,18 @@ public String resolveSdkArtifact() throws MojoExecutionException { return sdk.get("groupId")+":"+sdk.get("artifactId")+":"+sdk.get("version"); } - void includeTestResource(String fileName) throws Exception { - File source = getTestFile(TEST_DIRECTORY, fileName); - File target = new File(testDirectory, fileName); - if (source.isDirectory()) { - FileUtils.copyDirectory(source, testDirectory); - } - else { - FileUtils.copyFile(source, target); - } - } - - void includeDistroPropertiesFile(String fileName) throws Exception { - File source = getTestFile(TEST_DIRECTORY, fileName); + void includeDistroPropertiesFile(String path) throws Exception { + File source = getTestFile(TEST_DIRECTORY, path); File target = new File(testDirectory, DistroProperties.DISTRO_FILE_NAME); FileUtils.copyFile(source, target); } + void includePomFile(String... paths) throws Exception { + FileUtils.copyFile(getTestFile(paths), new File(testDirectory, "pom.xml")); + } + void addTestResources() throws Exception { - includeTestResource("pom.xml"); + includePomFile("pom.xml"); includeDistroPropertiesFile(DistroProperties.DISTRO_FILE_NAME); } diff --git a/maven-plugin/src/test/java/org/openmrs/maven/plugins/BuildIT.java b/maven-plugin/src/test/java/org/openmrs/maven/plugins/BuildIT.java index aecce120e..f6e79d7e9 100644 --- a/maven-plugin/src/test/java/org/openmrs/maven/plugins/BuildIT.java +++ b/maven-plugin/src/test/java/org/openmrs/maven/plugins/BuildIT.java @@ -1,5 +1,6 @@ package org.openmrs.maven.plugins; +import org.apache.commons.io.FileUtils; import org.junit.Before; import org.junit.Test; import org.openmrs.maven.plugins.model.Project; @@ -13,7 +14,7 @@ public class BuildIT extends AbstractSdkIT { private String serverId; void addTestResources() throws Exception { - includeTestResource("buildIT"); + FileUtils.copyDirectory(getTestFile(TEST_DIRECTORY, "buildIT"), testDirectory); } @Before diff --git a/maven-plugin/src/test/java/org/openmrs/maven/plugins/utility/ArtifactHelperIT.java b/maven-plugin/src/test/java/org/openmrs/maven/plugins/utility/ArtifactHelperIT.java new file mode 100644 index 000000000..b75b57b18 --- /dev/null +++ b/maven-plugin/src/test/java/org/openmrs/maven/plugins/utility/ArtifactHelperIT.java @@ -0,0 +1,48 @@ +package org.openmrs.maven.plugins.utility; + + +import lombok.Getter; +import lombok.Setter; +import org.apache.maven.it.VerificationException; +import org.junit.Test; +import org.openmrs.maven.plugins.AbstractMavenIT; +import org.openmrs.maven.plugins.model.Artifact; + +import java.io.File; + +import static org.junit.Assert.assertTrue; + +@Getter @Setter +public class ArtifactHelperIT extends AbstractMavenIT { + + @Test + public void test_downloadModuleWithDefaultName() throws Exception { + executeTest(mavenEnvironment -> { + ArtifactHelper artifactHelper = new ArtifactHelper(mavenEnvironment); + Artifact artifact = new Artifact("idgen-omod", "4.14.0", "org.openmrs.module", "jar"); + artifactHelper.downloadArtifact(artifact, getMavenTestDirectory(), null); + File expectedFile = new File(getMavenTestDirectory(), "idgen-omod-4.14.0.jar"); + assertTrue(expectedFile.exists()); + }); + } + + @Test + public void downloadModuleWithSpecificName() throws Exception { + executeTest(mavenEnvironment -> { + ArtifactHelper artifactHelper = new ArtifactHelper(mavenEnvironment); + Artifact artifact = new Artifact("idgen-omod", "4.14.0", "org.openmrs.module", "jar"); + artifactHelper.downloadArtifact(artifact, getMavenTestDirectory(), "idgen.omod"); + File expectedFile = new File(getMavenTestDirectory(), "idgen.omod"); + assertTrue(expectedFile.exists()); + }); + } + + @Test(expected = VerificationException.class) + public void downloadModuleThatDoesNotExist() throws Exception { + executeTest(mavenEnvironment -> { + ArtifactHelper artifactHelper = new ArtifactHelper(mavenEnvironment); + Artifact artifact = new Artifact("idgen-omod", "4.0.0", "org.openmrs.module", "jar"); + artifactHelper.downloadArtifact(artifact, getMavenTestDirectory(), "idgen.omod"); + }); + } +} diff --git a/maven-plugin/src/test/resources/integration-test/invokeIT/pom.xml b/maven-plugin/src/test/resources/integration-test/invokeIT/pom.xml new file mode 100644 index 000000000..6d1545a8e --- /dev/null +++ b/maven-plugin/src/test/resources/integration-test/invokeIT/pom.xml @@ -0,0 +1,72 @@ + + 4.0.0 + + org.openmrs + openmrs-sdk-integration-test-project + 1.0 + pom + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + + + ${project.groupId} + ${project.artifactId} + ${project.version} + tests + test-jar + compile + + + org.apache.maven.shared + maven-verifier + 1.7.2 + compile + + + junit + junit + 4.12 + jar + compile + + + org.hamcrest + hamcrest-core + 2.2 + compile + + + org.hamcrest + hamcrest-library + 2.2 + compile + + + org.mockito + mockito-core + 3.9.0 + compile + + + + + + + + + openmrs-repo + OpenMRS repository + https://mavenrepo.openmrs.org/nexus/content/repositories/public + + + + diff --git a/pom.xml b/pom.xml index 075485a5c..4e7047316 100644 --- a/pom.xml +++ b/pom.xml @@ -77,6 +77,7 @@ UTF-8 3.20.0 2.13.4.2 + 1.18.26 @@ -466,6 +467,13 @@ guava 32.1.2-jre + + + + org.projectlombok + lombok + ${lombokVersion} + diff --git a/sdk-commons/pom.xml b/sdk-commons/pom.xml index 6baf62662..60133553a 100644 --- a/sdk-commons/pom.xml +++ b/sdk-commons/pom.xml @@ -86,6 +86,11 @@ mockito-core test + + org.projectlombok + lombok + provided + diff --git a/sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/ArtifactHelper.java b/sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/ArtifactHelper.java new file mode 100644 index 000000000..039f2dc28 --- /dev/null +++ b/sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/ArtifactHelper.java @@ -0,0 +1,76 @@ +package org.openmrs.maven.plugins.utility; + +import org.apache.commons.lang.StringUtils; +import org.apache.maven.plugin.MojoExecutionException; +import org.openmrs.maven.plugins.model.Artifact; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.twdata.maven.mojoexecutor.MojoExecutor; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import static org.twdata.maven.mojoexecutor.MojoExecutor.artifactId; +import static org.twdata.maven.mojoexecutor.MojoExecutor.configuration; +import static org.twdata.maven.mojoexecutor.MojoExecutor.element; +import static org.twdata.maven.mojoexecutor.MojoExecutor.executeMojo; +import static org.twdata.maven.mojoexecutor.MojoExecutor.executionEnvironment; +import static org.twdata.maven.mojoexecutor.MojoExecutor.goal; +import static org.twdata.maven.mojoexecutor.MojoExecutor.groupId; +import static org.twdata.maven.mojoexecutor.MojoExecutor.name; +import static org.twdata.maven.mojoexecutor.MojoExecutor.plugin; +import static org.twdata.maven.mojoexecutor.MojoExecutor.version; + +/** + * The purpose of this class is to handle all interactions with Maven that require retrieving artifacts from the Maven repository + */ +public class ArtifactHelper { + + private static final Logger log = LoggerFactory.getLogger(ArtifactHelper.class); + + final MavenEnvironment mavenEnvironment; + + public ArtifactHelper(MavenEnvironment mavenEnvironment) { + this.mavenEnvironment = mavenEnvironment; + } + + public File downloadArtifact(Artifact artifact, File directory) throws MojoExecutionException { + return downloadArtifact(artifact, directory, null); + } + + /** + * Downloads the given artifact to the given directory with the given fileName. If fileName is null, it will use the maven default. + * @param artifact the artifact to download + * @param directory the directory into which to download the artifact + * @param fileName the name of the file to save the artifact to (optional, if null will use the maven default) + * @return the downloaded File + * @throws MojoExecutionException + */ + public File downloadArtifact(Artifact artifact, File directory, String fileName) throws MojoExecutionException { + if (StringUtils.isBlank(fileName)) { + fileName = artifact.getArtifactId() + "-" + artifact.getVersion() + "." + artifact.getType(); + } + artifact.setDestFileName(fileName); + List artifactItems = new ArrayList<>(); + MojoExecutor.Element element = artifact.toElement(directory.getAbsolutePath()); + artifactItems.add(element); + executeMojo( + plugin( + groupId(SDKConstants.DEPENDENCY_PLUGIN_GROUP_ID), + artifactId(SDKConstants.DEPENDENCY_PLUGIN_ARTIFACT_ID), + version(SDKConstants.DEPENDENCY_PLUGIN_VERSION) + ), + goal("copy"), + configuration( + element(name("artifactItems"), artifactItems.toArray(new MojoExecutor.Element[0])) + ), + executionEnvironment( + mavenEnvironment.getMavenProject(), + mavenEnvironment.getMavenSession(), + mavenEnvironment.getPluginManager() + ) + ); + return new File(directory, artifact.getDestFileName()); + } +} diff --git a/sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/MavenEnvironment.java b/sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/MavenEnvironment.java new file mode 100644 index 000000000..f6baee5d8 --- /dev/null +++ b/sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/MavenEnvironment.java @@ -0,0 +1,23 @@ +package org.openmrs.maven.plugins.utility; + +import lombok.Data; +import org.apache.maven.artifact.factory.ArtifactFactory; +import org.apache.maven.artifact.metadata.ArtifactMetadataSource; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.plugin.BuildPluginManager; +import org.apache.maven.project.MavenProject; +import org.apache.maven.settings.Settings; + +/** + * Component that allows access to the Maven components set within the current execution environment + */ +@Data +public class MavenEnvironment { + private MavenProject mavenProject; + private MavenSession mavenSession; + private Settings settings; + ArtifactMetadataSource artifactMetadataSource; + ArtifactFactory artifactFactory; + BuildPluginManager pluginManager; + Wizard wizard; +} From 9d20c9a0410b0ec64cd8bdbaa8a888b8f966de7d Mon Sep 17 00:00:00 2001 From: Michael Seaton Date: Mon, 18 Nov 2024 01:00:58 -0500 Subject: [PATCH 3/6] SDK-357 - Fix to paths --- .../openmrs/maven/plugins/AbstractSdkIT.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractSdkIT.java b/maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractSdkIT.java index d5b49771e..36a2f397e 100644 --- a/maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractSdkIT.java +++ b/maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractSdkIT.java @@ -83,14 +83,22 @@ public String resolveSdkArtifact() throws MojoExecutionException { return sdk.get("groupId")+":"+sdk.get("artifactId")+":"+sdk.get("version"); } - void includeDistroPropertiesFile(String path) throws Exception { - File source = getTestFile(TEST_DIRECTORY, path); - File target = new File(testDirectory, DistroProperties.DISTRO_FILE_NAME); - FileUtils.copyFile(source, target); + void includeDistroPropertiesFile(String... paths) throws Exception { + Path sourcePath = testDirectoryPath.resolve(TEST_DIRECTORY); + for (String path : paths) { + sourcePath = sourcePath.resolve(path); + } + Path targetPath = testDirectoryPath.resolve(DistroProperties.DISTRO_FILE_NAME); + FileUtils.copyFile(sourcePath.toFile(), targetPath.toFile()); } void includePomFile(String... paths) throws Exception { - FileUtils.copyFile(getTestFile(paths), new File(testDirectory, "pom.xml")); + Path sourcePath = testDirectoryPath.resolve(TEST_DIRECTORY); + for (String path : paths) { + sourcePath = sourcePath.resolve(path); + } + Path targetPath = testDirectoryPath.resolve("pom.xml"); + FileUtils.copyFile(sourcePath.toFile(), targetPath.toFile()); } void addTestResources() throws Exception { From d4a4754262cf14b4153848a96605b99ac8a562ff Mon Sep 17 00:00:00 2001 From: Michael Seaton Date: Mon, 18 Nov 2024 01:02:20 -0500 Subject: [PATCH 4/6] SDK-357 - Fix to paths --- .../test/java/org/openmrs/maven/plugins/AbstractMavenIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractMavenIT.java b/maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractMavenIT.java index 7b407ecf0..8684c5fba 100644 --- a/maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractMavenIT.java +++ b/maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractMavenIT.java @@ -22,7 +22,7 @@ public void setup() throws Exception { @Override void addTestResources() throws Exception { - includePomFile(TEST_DIRECTORY, "invokeIT", "pom.xml"); + includePomFile("invokeIT", "pom.xml"); } protected void executeTest(MavenEnvironmentFunction testFunction) throws Exception { From 18c6a9eb7205d360f3e14ccbcb726fd838982da5 Mon Sep 17 00:00:00 2001 From: Michael Seaton Date: Mon, 18 Nov 2024 08:09:25 -0500 Subject: [PATCH 5/6] SDK-358 - Minor tweaks --- .../org/openmrs/maven/plugins/InvokeMethod.java | 13 +++++++------ .../org/openmrs/maven/plugins/AbstractMavenIT.java | 8 ++++---- .../maven/plugins/utility/ArtifactHelperIT.java | 12 ++++++------ .../resources/integration-test/invokeIT/pom.xml | 6 ++++++ 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/maven-plugin/src/main/java/org/openmrs/maven/plugins/InvokeMethod.java b/maven-plugin/src/main/java/org/openmrs/maven/plugins/InvokeMethod.java index 6b5c5cf84..bf21c5b9c 100644 --- a/maven-plugin/src/main/java/org/openmrs/maven/plugins/InvokeMethod.java +++ b/maven-plugin/src/main/java/org/openmrs/maven/plugins/InvokeMethod.java @@ -1,6 +1,7 @@ package org.openmrs.maven.plugins; -import lombok.Data; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.lang.StringUtils; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.Mojo; @@ -17,7 +18,7 @@ * it will then invoke the given testMethod on the testClass */ @Mojo(name = InvokeMethod.NAME) -@Data +@Getter @Setter public class InvokeMethod extends AbstractTask { public static final String NAME = "invoke-method"; @@ -66,10 +67,10 @@ public void executeTask() throws MojoExecutionException { try { setterMethod.invoke(instance, getMavenEnvironment()); wizard.showMessage("Instance populated with maven environment"); - } - catch (Exception e) { - throw new MojoExecutionException("Unable to set MavenTestExecutor on class", e); - } + } + catch (Exception e) { + throw new MojoExecutionException("Error executing method: " + methodName, e); + } } Method method; diff --git a/maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractMavenIT.java b/maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractMavenIT.java index 8684c5fba..492edbcef 100644 --- a/maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractMavenIT.java +++ b/maven-plugin/src/test/java/org/openmrs/maven/plugins/AbstractMavenIT.java @@ -25,7 +25,7 @@ void addTestResources() throws Exception { includePomFile("invokeIT", "pom.xml"); } - protected void executeTest(MavenEnvironmentFunction testFunction) throws Exception { + protected void executeTest(MavenTestFunction testFunction) throws Exception { StackTraceElement invoker = Thread.currentThread().getStackTrace()[2]; String className = invoker.getClassName(); String testMethod = invoker.getMethodName(); @@ -38,7 +38,7 @@ protected void executeTest(MavenEnvironmentFunction testFunction) throws Excepti verifier.executeGoal(plugin + ":" + InvokeMethod.NAME); } else { - testFunction.executeTest(mavenEnvironment); + testFunction.executeTest(); } } @@ -49,7 +49,7 @@ protected File getMavenTestDirectory() { /** * Simple interface that encapsulates a test that should be evaluated by tests that use this Mojo */ - public interface MavenEnvironmentFunction { - void executeTest(MavenEnvironment mavenEnvironment) throws Exception; + public interface MavenTestFunction { + void executeTest() throws Exception; } } diff --git a/maven-plugin/src/test/java/org/openmrs/maven/plugins/utility/ArtifactHelperIT.java b/maven-plugin/src/test/java/org/openmrs/maven/plugins/utility/ArtifactHelperIT.java index b75b57b18..854c3fbe2 100644 --- a/maven-plugin/src/test/java/org/openmrs/maven/plugins/utility/ArtifactHelperIT.java +++ b/maven-plugin/src/test/java/org/openmrs/maven/plugins/utility/ArtifactHelperIT.java @@ -17,8 +17,8 @@ public class ArtifactHelperIT extends AbstractMavenIT { @Test public void test_downloadModuleWithDefaultName() throws Exception { - executeTest(mavenEnvironment -> { - ArtifactHelper artifactHelper = new ArtifactHelper(mavenEnvironment); + executeTest(() -> { + ArtifactHelper artifactHelper = new ArtifactHelper(getMavenEnvironment()); Artifact artifact = new Artifact("idgen-omod", "4.14.0", "org.openmrs.module", "jar"); artifactHelper.downloadArtifact(artifact, getMavenTestDirectory(), null); File expectedFile = new File(getMavenTestDirectory(), "idgen-omod-4.14.0.jar"); @@ -28,8 +28,8 @@ public void test_downloadModuleWithDefaultName() throws Exception { @Test public void downloadModuleWithSpecificName() throws Exception { - executeTest(mavenEnvironment -> { - ArtifactHelper artifactHelper = new ArtifactHelper(mavenEnvironment); + executeTest(() -> { + ArtifactHelper artifactHelper = new ArtifactHelper(getMavenEnvironment()); Artifact artifact = new Artifact("idgen-omod", "4.14.0", "org.openmrs.module", "jar"); artifactHelper.downloadArtifact(artifact, getMavenTestDirectory(), "idgen.omod"); File expectedFile = new File(getMavenTestDirectory(), "idgen.omod"); @@ -39,8 +39,8 @@ public void downloadModuleWithSpecificName() throws Exception { @Test(expected = VerificationException.class) public void downloadModuleThatDoesNotExist() throws Exception { - executeTest(mavenEnvironment -> { - ArtifactHelper artifactHelper = new ArtifactHelper(mavenEnvironment); + executeTest(() -> { + ArtifactHelper artifactHelper = new ArtifactHelper(getMavenEnvironment()); Artifact artifact = new Artifact("idgen-omod", "4.0.0", "org.openmrs.module", "jar"); artifactHelper.downloadArtifact(artifact, getMavenTestDirectory(), "idgen.omod"); }); diff --git a/maven-plugin/src/test/resources/integration-test/invokeIT/pom.xml b/maven-plugin/src/test/resources/integration-test/invokeIT/pom.xml index 6d1545a8e..7e6f9327e 100644 --- a/maven-plugin/src/test/resources/integration-test/invokeIT/pom.xml +++ b/maven-plugin/src/test/resources/integration-test/invokeIT/pom.xml @@ -10,6 +10,12 @@ 1.0 pom + From 43bdb480dc603acee4fdf09a5cc9ef62645bb7dc Mon Sep 17 00:00:00 2001 From: Michael Seaton Date: Mon, 18 Nov 2024 08:25:59 -0500 Subject: [PATCH 6/6] SDK-358 - Minor tweaks --- .../openmrs/maven/plugins/utility/MavenEnvironment.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/MavenEnvironment.java b/sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/MavenEnvironment.java index f6baee5d8..9a06fbaef 100644 --- a/sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/MavenEnvironment.java +++ b/sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/MavenEnvironment.java @@ -16,8 +16,8 @@ public class MavenEnvironment { private MavenProject mavenProject; private MavenSession mavenSession; private Settings settings; - ArtifactMetadataSource artifactMetadataSource; - ArtifactFactory artifactFactory; - BuildPluginManager pluginManager; - Wizard wizard; + private ArtifactMetadataSource artifactMetadataSource; + private ArtifactFactory artifactFactory; + private BuildPluginManager pluginManager; + private Wizard wizard; }