You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ss...@apache.org on 2018/08/06 16:10:43 UTC
[sling-org-apache-sling-testing-osgi-mock] branch
feature/SLING-7803-junit5 updated (bd678e43 -> 410906c)
This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a change to branch feature/SLING-7803-junit5
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git.
from bd678e43 set next version to 2.4.0-SNAPSHOT
new e08aa61 SLING-7803 prepare module splitup
new 20c940f SLING-7803 update to latest mockito version, update dependencies
new 3ac6d0c SLING-7803 move junit4-specific files to junit4 module
new d1c1d34 SLING-7803 introduce parent pom
new 410906c SLING-7803 add junit5 extension
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.gitignore | 2 +-
pom.xml => core/pom.xml | 70 ++----
.../testing/mock/osgi/ComponentContextBuilder.java | 0
.../sling/testing/mock/osgi/ManifestScanner.java | 0
.../sling/testing/mock/osgi/MapMergeUtil.java | 0
.../apache/sling/testing/mock/osgi/MapUtil.java | 0
.../sling/testing/mock/osgi/MatchAllFilter.java | 0
.../apache/sling/testing/mock/osgi/MockBundle.java | 0
.../sling/testing/mock/osgi/MockBundleContext.java | 0
.../testing/mock/osgi/MockComponentContext.java | 0
.../sling/testing/mock/osgi/MockConfiguration.java | 0
.../testing/mock/osgi/MockConfigurationAdmin.java | 0
.../sling/testing/mock/osgi/MockEventAdmin.java | 0
.../sling/testing/mock/osgi/MockLogService.java | 0
.../apache/sling/testing/mock/osgi/MockOsgi.java | 0
.../testing/mock/osgi/MockServiceReference.java | 0
.../testing/mock/osgi/MockServiceRegistration.java | 0
.../testing/mock/osgi/NoScrMetadataException.java | 0
.../sling/testing/mock/osgi/OsgiMetadataUtil.java | 2 +-
.../sling/testing/mock/osgi/OsgiServiceUtil.java | 0
.../mock/osgi/ReferenceViolationException.java | 0
.../mock/osgi/context/AbstractContextPlugin.java | 0
.../testing/mock/osgi/context/ContextCallback.java | 0
.../testing/mock/osgi/context/ContextPlugin.java | 0
.../testing/mock/osgi/context/ContextPlugins.java | 0
.../testing/mock/osgi/context/OsgiContextImpl.java | 0
.../testing/mock/osgi/context/package-info.java | 0
.../sling/testing/mock/osgi/package-info.java | 0
.../testing/mock/osgi/ManifestScannerTest.java | 0
.../sling/testing/mock/osgi/MapUtilTest.java | 0
...ckBundleContextDynamicReferencesOsgiR6Test.java | 2 +-
.../MockBundleContextDynamicReferencesTest.java | 2 +-
...ockBundleContextStaticGreedyReferencesTest.java | 2 +-
.../testing/mock/osgi/MockBundleContextTest.java | 4 +-
.../sling/testing/mock/osgi/MockBundleTest.java | 0
.../mock/osgi/MockComponentContextTest.java | 0
.../mock/osgi/MockConfigurationAdminTest.java | 0
.../testing/mock/osgi/MockEventAdminTest.java | 10 +-
.../testing/mock/osgi/MockLogServiceTest.java | 0
.../mock/osgi/MockServiceReferenceTest.java | 0
.../mock/osgi/MockServiceReferencesSortTest.java | 0
.../testing/mock/osgi/OsgiMetadataUtilTest.java | 0
.../OsgiServiceUtilActivateDeactivateTest.java | 0
.../testing/mock/osgi/OsgiServiceUtilTest.java | 0
.../mock/osgi/context/ContextPluginsTest.java | 2 +-
.../mock/osgi/context/OsgiContextImplTest.java | 0
.../sling/testing/mock/osgi/junit/OsgiContext.java | 7 +
.../mock/osgi/junit/OsgiContextBuilder.java | 7 +
.../mock/osgi/junit/OsgiContextCallback.java | 7 +
{src => core/src}/test/resources/META-INF/test.txt | 0
....osgi.OsgiServiceUtilActivateDeactivateTest.xml | 0
...sling.testing.mock.osgi.OsgiServiceUtilTest.xml | 0
...sting.mock.osgi.context.OsgiContextImplTest.xml | 0
.../test/resources/OSGI-INF/serviceComponents.xml | 0
.../test/resources/bundleData/nested/first.txt | 0
.../test/resources/bundleData/nested/second.txt | 0
.../src}/test/resources/simplelogger.properties | 0
junit4/pom.xml | 81 +++++++
.../sling/testing/mock/osgi/junit/OsgiContext.java | 0
.../mock/osgi/junit/OsgiContextBuilder.java | 2 +-
.../mock/osgi/junit/OsgiContextCallback.java | 0
.../testing/mock/osgi/junit/package-info.java | 0
.../testing/mock/osgi/junit/OsgiContextTest.java | 2 +-
junit5/pom.xml | 112 ++++++++++
.../testing/mock/osgi/junit5/OsgiContext.java | 78 +++++++
.../mock/osgi/junit5}/OsgiContextBuilder.java | 47 ++--
.../mock/osgi/junit5}/OsgiContextCallback.java | 6 +-
.../mock/osgi/junit5/OsgiContextExtension.java | 125 +++++++++++
.../testing/mock/osgi/junit5/OsgiContextStore.java | 92 ++++++++
.../testing/mock/osgi/junit5}/package-info.java | 6 +-
.../junit5/OsgiContextMemberInstantiatedTest.java | 38 ++--
.../mock/osgi/junit5/OsgiContextMemberTest.java | 23 +-
.../mock/osgi/junit5/OsgiContextPluginTest.java | 68 ++++++
.../testing/mock/osgi/junit5/OsgiContextTest.java | 21 +-
parent/pom.xml | 81 +++++++
pom.xml | 242 ++-------------------
relocate/pom.xml | 42 ++++
77 files changed, 831 insertions(+), 352 deletions(-)
copy pom.xml => core/pom.xml (84%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/ComponentContextBuilder.java (100%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/ManifestScanner.java (100%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/MapMergeUtil.java (100%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/MapUtil.java (100%)
copy {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/MatchAllFilter.java (100%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/MockBundle.java (100%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java (100%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/MockComponentContext.java (100%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/MockConfiguration.java (100%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/MockConfigurationAdmin.java (100%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java (100%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/MockLogService.java (100%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java (100%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/MockServiceReference.java (100%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java (100%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/NoScrMetadataException.java (100%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtil.java (99%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtil.java (100%)
copy {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/ReferenceViolationException.java (100%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/context/AbstractContextPlugin.java (100%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/context/ContextCallback.java (100%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/context/ContextPlugin.java (100%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/context/ContextPlugins.java (100%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImpl.java (100%)
rename {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/context/package-info.java (100%)
copy {src => core/src}/main/java/org/apache/sling/testing/mock/osgi/package-info.java (100%)
rename {src => core/src}/test/java/org/apache/sling/testing/mock/osgi/ManifestScannerTest.java (100%)
rename {src => core/src}/test/java/org/apache/sling/testing/mock/osgi/MapUtilTest.java (100%)
rename {src => core/src}/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesOsgiR6Test.java (99%)
rename {src => core/src}/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesTest.java (99%)
rename {src => core/src}/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextStaticGreedyReferencesTest.java (99%)
rename {src => core/src}/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java (99%)
rename {src => core/src}/test/java/org/apache/sling/testing/mock/osgi/MockBundleTest.java (100%)
rename {src => core/src}/test/java/org/apache/sling/testing/mock/osgi/MockComponentContextTest.java (100%)
rename {src => core/src}/test/java/org/apache/sling/testing/mock/osgi/MockConfigurationAdminTest.java (100%)
rename {src => core/src}/test/java/org/apache/sling/testing/mock/osgi/MockEventAdminTest.java (91%)
rename {src => core/src}/test/java/org/apache/sling/testing/mock/osgi/MockLogServiceTest.java (100%)
rename {src => core/src}/test/java/org/apache/sling/testing/mock/osgi/MockServiceReferenceTest.java (100%)
rename {src => core/src}/test/java/org/apache/sling/testing/mock/osgi/MockServiceReferencesSortTest.java (100%)
rename {src => core/src}/test/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtilTest.java (100%)
rename {src => core/src}/test/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtilActivateDeactivateTest.java (100%)
rename {src => core/src}/test/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtilTest.java (100%)
rename {src => core/src}/test/java/org/apache/sling/testing/mock/osgi/context/ContextPluginsTest.java (99%)
rename {src => core/src}/test/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImplTest.java (100%)
copy {src/main => core/src/test}/java/org/apache/sling/testing/mock/osgi/junit/OsgiContext.java (89%)
copy {src/main => core/src/test}/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java (90%)
copy {src/main => core/src/test}/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextCallback.java (74%)
rename {src => core/src}/test/resources/META-INF/test.txt (100%)
rename {src => core/src}/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.OsgiServiceUtilActivateDeactivateTest.xml (100%)
rename {src => core/src}/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.OsgiServiceUtilTest.xml (100%)
rename {src => core/src}/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.context.OsgiContextImplTest.xml (100%)
rename {src => core/src}/test/resources/OSGI-INF/serviceComponents.xml (100%)
rename {src => core/src}/test/resources/bundleData/nested/first.txt (100%)
rename {src => core/src}/test/resources/bundleData/nested/second.txt (100%)
rename {src => core/src}/test/resources/simplelogger.properties (100%)
create mode 100644 junit4/pom.xml
rename {src => junit4/src}/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContext.java (100%)
copy {src => junit4/src}/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java (98%)
copy {src => junit4/src}/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextCallback.java (100%)
rename {src => junit4/src}/main/java/org/apache/sling/testing/mock/osgi/junit/package-info.java (100%)
rename {src => junit4/src}/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextTest.java (97%)
create mode 100644 junit5/pom.xml
create mode 100644 junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContext.java
rename {src/main/java/org/apache/sling/testing/mock/osgi/junit => junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5}/OsgiContextBuilder.java (66%)
rename {src/main/java/org/apache/sling/testing/mock/osgi/junit => junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5}/OsgiContextCallback.java (91%)
create mode 100644 junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextExtension.java
create mode 100644 junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextStore.java
rename {src/main/java/org/apache/sling/testing/mock/osgi => junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5}/package-info.java (85%)
rename src/main/java/org/apache/sling/testing/mock/osgi/MatchAllFilter.java => junit5/src/test/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextMemberInstantiatedTest.java (57%)
copy src/main/java/org/apache/sling/testing/mock/osgi/ReferenceViolationException.java => junit5/src/test/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextMemberTest.java (59%)
create mode 100644 junit5/src/test/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextPluginTest.java
rename src/main/java/org/apache/sling/testing/mock/osgi/ReferenceViolationException.java => junit5/src/test/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextTest.java (59%)
create mode 100644 parent/pom.xml
create mode 100644 relocate/pom.xml
[sling-org-apache-sling-testing-osgi-mock] 01/05: SLING-7803
prepare module splitup
Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a commit to branch feature/SLING-7803-junit5
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git
commit e08aa613f3333a54a073b9fcb22134429b9cf29d
Author: sseifert <ss...@pro-vision.de>
AuthorDate: Mon Aug 6 14:07:58 2018 +0200
SLING-7803 prepare module splitup
---
.gitignore | 2 +-
pom.xml => core/pom.xml | 11 +-
.../testing/mock/osgi/ComponentContextBuilder.java | 0
.../sling/testing/mock/osgi/ManifestScanner.java | 0
.../sling/testing/mock/osgi/MapMergeUtil.java | 0
.../apache/sling/testing/mock/osgi/MapUtil.java | 0
.../sling/testing/mock/osgi/MatchAllFilter.java | 0
.../apache/sling/testing/mock/osgi/MockBundle.java | 0
.../sling/testing/mock/osgi/MockBundleContext.java | 0
.../testing/mock/osgi/MockComponentContext.java | 0
.../sling/testing/mock/osgi/MockConfiguration.java | 0
.../testing/mock/osgi/MockConfigurationAdmin.java | 0
.../sling/testing/mock/osgi/MockEventAdmin.java | 0
.../sling/testing/mock/osgi/MockLogService.java | 0
.../apache/sling/testing/mock/osgi/MockOsgi.java | 0
.../testing/mock/osgi/MockServiceReference.java | 0
.../testing/mock/osgi/MockServiceRegistration.java | 0
.../testing/mock/osgi/NoScrMetadataException.java | 0
.../sling/testing/mock/osgi/OsgiMetadataUtil.java | 0
.../sling/testing/mock/osgi/OsgiServiceUtil.java | 0
.../mock/osgi/ReferenceViolationException.java | 0
.../mock/osgi/context/AbstractContextPlugin.java | 0
.../testing/mock/osgi/context/ContextCallback.java | 0
.../testing/mock/osgi/context/ContextPlugin.java | 0
.../testing/mock/osgi/context/ContextPlugins.java | 0
.../testing/mock/osgi/context/OsgiContextImpl.java | 0
.../testing/mock/osgi/context/package-info.java | 0
.../sling/testing/mock/osgi/junit/OsgiContext.java | 0
.../mock/osgi/junit/OsgiContextBuilder.java | 0
.../mock/osgi/junit/OsgiContextCallback.java | 0
.../testing/mock/osgi/junit/package-info.java | 0
.../sling/testing/mock/osgi/package-info.java | 0
.../testing/mock/osgi/ManifestScannerTest.java | 0
.../sling/testing/mock/osgi/MapUtilTest.java | 0
...ckBundleContextDynamicReferencesOsgiR6Test.java | 0
.../MockBundleContextDynamicReferencesTest.java | 0
...ockBundleContextStaticGreedyReferencesTest.java | 0
.../testing/mock/osgi/MockBundleContextTest.java | 0
.../sling/testing/mock/osgi/MockBundleTest.java | 0
.../mock/osgi/MockComponentContextTest.java | 0
.../mock/osgi/MockConfigurationAdminTest.java | 0
.../testing/mock/osgi/MockEventAdminTest.java | 0
.../testing/mock/osgi/MockLogServiceTest.java | 0
.../mock/osgi/MockServiceReferenceTest.java | 0
.../mock/osgi/MockServiceReferencesSortTest.java | 0
.../testing/mock/osgi/OsgiMetadataUtilTest.java | 0
.../OsgiServiceUtilActivateDeactivateTest.java | 0
.../testing/mock/osgi/OsgiServiceUtilTest.java | 0
.../mock/osgi/context/ContextPluginsTest.java | 0
.../mock/osgi/context/OsgiContextImplTest.java | 0
.../testing/mock/osgi/junit/OsgiContextTest.java | 0
{src => core/src}/test/resources/META-INF/test.txt | 0
....osgi.OsgiServiceUtilActivateDeactivateTest.xml | 0
...sling.testing.mock.osgi.OsgiServiceUtilTest.xml | 0
...sting.mock.osgi.context.OsgiContextImplTest.xml | 0
.../test/resources/OSGI-INF/serviceComponents.xml | 0
.../test/resources/bundleData/nested/first.txt | 0
.../test/resources/bundleData/nested/second.txt | 0
.../src}/test/resources/simplelogger.properties | 0
junit4/pom.xml | 53 +++++
junit5/pom.xml | 53 +++++
pom.xml | 233 +--------------------
relocate/pom.xml | 43 ++++
63 files changed, 162 insertions(+), 233 deletions(-)
diff --git a/.gitignore b/.gitignore
index 12746f7..e2d791c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
-/target
+target
.idea
.classpath
.metadata
diff --git a/pom.xml b/core/pom.xml
similarity index 95%
copy from pom.xml
copy to core/pom.xml
index 443dd2d..3a49e92 100644
--- a/pom.xml
+++ b/core/pom.xml
@@ -27,20 +27,13 @@
<relativePath />
</parent>
- <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
+ <artifactId>org.apache.sling.testing.osgi-mock.core</artifactId>
<version>2.4.0-SNAPSHOT</version>
<packaging>bundle</packaging>
- <name>Apache Sling Testing OSGi Mock</name>
+ <name>Apache Sling Testing OSGi Mock Core</name>
<description>Mock implementation of selected OSGi APIs.</description>
- <scm>
- <connection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git</connection>
- <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git</developerConnection>
- <url>https://gitbox.apache.org/repos/asf?p=sling-org-apache-sling-testing-osgi-mock.git</url>
- <tag>HEAD</tag>
- </scm>
-
<dependencies>
<dependency>
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/ComponentContextBuilder.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/ComponentContextBuilder.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/ComponentContextBuilder.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/ComponentContextBuilder.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/ManifestScanner.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/ManifestScanner.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/ManifestScanner.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/ManifestScanner.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MapMergeUtil.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MapMergeUtil.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MapMergeUtil.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MapMergeUtil.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MapUtil.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MapUtil.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MapUtil.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MapUtil.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MatchAllFilter.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MatchAllFilter.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MatchAllFilter.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MatchAllFilter.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockBundle.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundle.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MockBundle.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundle.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockComponentContext.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockComponentContext.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MockComponentContext.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MockComponentContext.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockConfiguration.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockConfiguration.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MockConfiguration.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MockConfiguration.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockConfigurationAdmin.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockConfigurationAdmin.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MockConfigurationAdmin.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MockConfigurationAdmin.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MockEventAdmin.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockLogService.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockLogService.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MockLogService.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MockLogService.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MockOsgi.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceReference.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceReference.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MockServiceReference.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceReference.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/NoScrMetadataException.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/NoScrMetadataException.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/NoScrMetadataException.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/NoScrMetadataException.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtil.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtil.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtil.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtil.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtil.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtil.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtil.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtil.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/ReferenceViolationException.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/ReferenceViolationException.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/ReferenceViolationException.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/ReferenceViolationException.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/context/AbstractContextPlugin.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/context/AbstractContextPlugin.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/context/AbstractContextPlugin.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/context/AbstractContextPlugin.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/context/ContextCallback.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/context/ContextCallback.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/context/ContextCallback.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/context/ContextCallback.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/context/ContextPlugin.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/context/ContextPlugin.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/context/ContextPlugin.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/context/ContextPlugin.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/context/ContextPlugins.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/context/ContextPlugins.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/context/ContextPlugins.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/context/ContextPlugins.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImpl.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImpl.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImpl.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImpl.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/context/package-info.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/context/package-info.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/context/package-info.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/context/package-info.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContext.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContext.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContext.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContext.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextCallback.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextCallback.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextCallback.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextCallback.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/junit/package-info.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/junit/package-info.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/junit/package-info.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/junit/package-info.java
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/package-info.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/package-info.java
similarity index 100%
rename from src/main/java/org/apache/sling/testing/mock/osgi/package-info.java
rename to core/src/main/java/org/apache/sling/testing/mock/osgi/package-info.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/ManifestScannerTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/ManifestScannerTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/ManifestScannerTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/ManifestScannerTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MapUtilTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MapUtilTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MapUtilTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MapUtilTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesOsgiR6Test.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesOsgiR6Test.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesOsgiR6Test.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesOsgiR6Test.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextStaticGreedyReferencesTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextStaticGreedyReferencesTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextStaticGreedyReferencesTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextStaticGreedyReferencesTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MockBundleTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MockComponentContextTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockComponentContextTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MockComponentContextTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MockComponentContextTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MockConfigurationAdminTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockConfigurationAdminTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MockConfigurationAdminTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MockConfigurationAdminTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MockEventAdminTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockEventAdminTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MockEventAdminTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MockEventAdminTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MockLogServiceTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockLogServiceTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MockLogServiceTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MockLogServiceTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MockServiceReferenceTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockServiceReferenceTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MockServiceReferenceTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MockServiceReferenceTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/MockServiceReferencesSortTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockServiceReferencesSortTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/MockServiceReferencesSortTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/MockServiceReferencesSortTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtilTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtilTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtilTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtilTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtilActivateDeactivateTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtilActivateDeactivateTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtilActivateDeactivateTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtilActivateDeactivateTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtilTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtilTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtilTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtilTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/context/ContextPluginsTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/context/ContextPluginsTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/context/ContextPluginsTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/context/ContextPluginsTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImplTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImplTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImplTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImplTest.java
diff --git a/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextTest.java
similarity index 100%
rename from src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextTest.java
rename to core/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextTest.java
diff --git a/src/test/resources/META-INF/test.txt b/core/src/test/resources/META-INF/test.txt
similarity index 100%
rename from src/test/resources/META-INF/test.txt
rename to core/src/test/resources/META-INF/test.txt
diff --git a/src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.OsgiServiceUtilActivateDeactivateTest.xml b/core/src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.OsgiServiceUtilActivateDeactivateTest.xml
similarity index 100%
rename from src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.OsgiServiceUtilActivateDeactivateTest.xml
rename to core/src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.OsgiServiceUtilActivateDeactivateTest.xml
diff --git a/src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.OsgiServiceUtilTest.xml b/core/src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.OsgiServiceUtilTest.xml
similarity index 100%
rename from src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.OsgiServiceUtilTest.xml
rename to core/src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.OsgiServiceUtilTest.xml
diff --git a/src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.context.OsgiContextImplTest.xml b/core/src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.context.OsgiContextImplTest.xml
similarity index 100%
rename from src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.context.OsgiContextImplTest.xml
rename to core/src/test/resources/OSGI-INF/org.apache.sling.testing.mock.osgi.context.OsgiContextImplTest.xml
diff --git a/src/test/resources/OSGI-INF/serviceComponents.xml b/core/src/test/resources/OSGI-INF/serviceComponents.xml
similarity index 100%
rename from src/test/resources/OSGI-INF/serviceComponents.xml
rename to core/src/test/resources/OSGI-INF/serviceComponents.xml
diff --git a/src/test/resources/bundleData/nested/first.txt b/core/src/test/resources/bundleData/nested/first.txt
similarity index 100%
rename from src/test/resources/bundleData/nested/first.txt
rename to core/src/test/resources/bundleData/nested/first.txt
diff --git a/src/test/resources/bundleData/nested/second.txt b/core/src/test/resources/bundleData/nested/second.txt
similarity index 100%
rename from src/test/resources/bundleData/nested/second.txt
rename to core/src/test/resources/bundleData/nested/second.txt
diff --git a/src/test/resources/simplelogger.properties b/core/src/test/resources/simplelogger.properties
similarity index 100%
rename from src/test/resources/simplelogger.properties
rename to core/src/test/resources/simplelogger.properties
diff --git a/junit4/pom.xml b/junit4/pom.xml
new file mode 100644
index 0000000..a1cdd83
--- /dev/null
+++ b/junit4/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<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>
+ <parent>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>sling</artifactId>
+ <version>34-SNAPSHOT</version>
+ <relativePath />
+ </parent>
+
+ <artifactId>org.apache.sling.testing.osgi-mock.junit4</artifactId>
+ <version>2.4.0-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <name>Apache Sling Testing OSGi Mock JUnit 4</name>
+ <description>Mock implementation of selected OSGi APIs.</description>
+
+ <dependencies>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ </plugin>
+
+ </plugins>
+ </build>
+
+</project>
diff --git a/junit5/pom.xml b/junit5/pom.xml
new file mode 100644
index 0000000..b60b188
--- /dev/null
+++ b/junit5/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<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>
+ <parent>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>sling</artifactId>
+ <version>34-SNAPSHOT</version>
+ <relativePath />
+ </parent>
+
+ <artifactId>org.apache.sling.testing.osgi-mock.junit5</artifactId>
+ <version>2.4.0-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <name>Apache Sling Testing OSGi Mock JUnit 5</name>
+ <description>Mock implementation of selected OSGi APIs.</description>
+
+ <dependencies>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ </plugin>
+
+ </plugins>
+ </build>
+
+</project>
diff --git a/pom.xml b/pom.xml
index 443dd2d..db478ce 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,9 +27,9 @@
<relativePath />
</parent>
- <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
+ <artifactId>org.apache.sling.testing.osgi-mock.root</artifactId>
<version>2.4.0-SNAPSHOT</version>
- <packaging>bundle</packaging>
+ <packaging>pom</packaging>
<name>Apache Sling Testing OSGi Mock</name>
<description>Mock implementation of selected OSGi APIs.</description>
@@ -38,227 +38,14 @@
<connection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git</connection>
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git</developerConnection>
<url>https://gitbox.apache.org/repos/asf?p=sling-org-apache-sling-testing-osgi-mock.git</url>
- <tag>HEAD</tag>
- </scm>
+ <tag>HEAD</tag>
+ </scm>
- <dependencies>
-
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation.versioning</artifactId>
- <scope>provided</scope>
- </dependency>
+ <modules>
+ <module>core</module>
+ <module>junit4</module>
+ <module>junit5</module>
+ <module>relocate</module>
+ </modules>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>osgi.core</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>osgi.cmpn</artifactId>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>15.0</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-lang3</artifactId>
- <version>3.0.1</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.4</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.reflections</groupId>
- <artifactId>reflections</artifactId>
- <!-- Do not use version 0.9.10, it created threading issues when running junit tests in parallel (see SLING-5002) -->
- <version>0.9.9</version>
- <scope>compile</scope>
- <!-- exclude all optional dependencies -->
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>dom4j</groupId>
- <artifactId>dom4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>annotations</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- Artifact is shaded and inlined, only some classes included (see below) -->
- <dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.commons.osgi</artifactId>
- <version>2.4.0</version>
- <scope>compile</scope>
- </dependency>
- <!-- Artifact is shaded and inlined, only some classes included (see below) -->
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.framework</artifactId>
- <version>5.0.0</version>
- <scope>compile</scope>
- </dependency>
- <!-- Artifact is shaded and inlined, only some classes included (see below) -->
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.scr</artifactId>
- <version>2.0.4</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>animal-sniffer-annotations</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <!-- Nullability annotations -->
- <dependency>
- <groupId>org.jetbrains</groupId>
- <artifactId>annotations</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>1.9.5</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.testing.logging-mock</artifactId>
- <version>2.0.0</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
-
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.rat</groupId>
- <artifactId>apache-rat-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>src/test/resources/META-INF/test.txt</exclude>
- <exclude>src/test/resources/bundleData/nested/first.txt</exclude>
- <exclude>src/test/resources/bundleData/nested/second.txt</exclude>
- <exclude>dependency-reduced-pom.xml</exclude>
- </excludes>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>shade</goal>
- </goals>
- <configuration>
- <createSourcesJar>true</createSourcesJar>
- <shadeSourcesContent>true</shadeSourcesContent>
- <artifactSet>
- <includes>
- <include>org.apache.sling:org.apache.sling.commons.osgi</include>
- <include>org.apache.felix:org.apache.felix.framework</include>
- <include>org.apache.felix:org.apache.felix.scr</include>
- </includes>
- </artifactSet>
- <relocations>
- <relocation>
- <pattern>org.apache.sling.commons.osgi</pattern>
- <shadedPattern>osgimock.org.apache.sling.commons.osgi</shadedPattern>
- </relocation>
- <relocation>
- <pattern>org.apache.felix.framework</pattern>
- <shadedPattern>osgimock.org.apache.felix.framework</shadedPattern>
- </relocation>
- <relocation>
- <pattern>org.apache.felix.scr.impl</pattern>
- <shadedPattern>osgimock.org.apache.felix.scr.impl</shadedPattern>
- </relocation>
- </relocations>
- <filters>
- <filter>
- <artifact>org.apache.sling:org.apache.sling.commons.osgi</artifact>
- <includes>
- <include>org/apache/sling/commons/osgi/ServiceUtil*</include>
- <include>org/apache/sling/commons/osgi/Order*</include>
- </includes>
- </filter>
- <filter>
- <artifact>org.apache.felix:org.apache.felix.framework</artifact>
- <includes>
- <include>org/apache/felix/framework/**</include>
- </includes>
- </filter>
- <filter>
- <artifact>org.apache.felix:org.apache.felix.scr</artifact>
- <includes>
- <include>org/apache/felix/scr/impl/inject/Annotations*</include>
- <include>org/apache/felix/scr/impl/helper/Coercions*</include>
- </includes>
- </filter>
- </filters>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
-
</project>
diff --git a/relocate/pom.xml b/relocate/pom.xml
new file mode 100644
index 0000000..a5c0ed8
--- /dev/null
+++ b/relocate/pom.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<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>
+ <parent>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>sling</artifactId>
+ <version>34-SNAPSHOT</version>
+ <relativePath />
+ </parent>
+
+ <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
+ <version>2.4.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <name>Apache Sling Testing OSGi Mock Relocation</name>
+ <description>Please use artifact 'org.apache.sling.testing.osgi-mock.junit4' instead.</description>
+
+ <distributionManagement>
+ <relocation>
+ <artifactId>org.apache.sling.testing.osgi-mock.junit4</artifactId>
+ </relocation>
+ </distributionManagement>
+
+</project>
[sling-org-apache-sling-testing-osgi-mock] 04/05: SLING-7803
introduce parent pom
Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a commit to branch feature/SLING-7803-junit5
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git
commit d1c1d345b236047c58c4a64aeeeff563907a5020
Author: sseifert <ss...@pro-vision.de>
AuthorDate: Mon Aug 6 15:55:01 2018 +0200
SLING-7803 introduce parent pom
---
core/pom.xml | 33 +++------------------------------
junit4/pom.xml | 39 ++++++---------------------------------
junit5/pom.xml | 27 +++------------------------
{junit5 => parent}/pom.xml | 44 ++++++++++++++------------------------------
pom.xml | 9 ++++-----
relocate/pom.xml | 7 +++----
6 files changed, 33 insertions(+), 126 deletions(-)
diff --git a/core/pom.xml b/core/pom.xml
index 4684c68..cdc223e 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -22,37 +22,19 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.sling</groupId>
- <artifactId>sling</artifactId>
- <version>34-SNAPSHOT</version>
- <relativePath />
+ <artifactId>org.apache.sling.testing.osgi-mock.parent</artifactId>
+ <version>2.4.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
</parent>
<artifactId>org.apache.sling.testing.osgi-mock.core</artifactId>
- <version>2.4.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>Apache Sling Testing OSGi Mock Core</name>
- <description>Mock implementation of selected OSGi APIs.</description>
<dependencies>
<dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation.versioning</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>osgi.cmpn</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>15.0</version>
@@ -141,17 +123,9 @@
</exclusions>
</dependency>
- <!-- Nullability annotations -->
- <dependency>
- <groupId>org.jetbrains</groupId>
- <artifactId>annotations</artifactId>
- <scope>provided</scope>
- </dependency>
-
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
- <version>2.19.1</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -162,7 +136,6 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.logging-mock</artifactId>
- <version>2.0.0</version>
<scope>test</scope>
</dependency>
diff --git a/junit4/pom.xml b/junit4/pom.xml
index b7c196c..008a108 100644
--- a/junit4/pom.xml
+++ b/junit4/pom.xml
@@ -22,37 +22,19 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.sling</groupId>
- <artifactId>sling</artifactId>
- <version>34-SNAPSHOT</version>
- <relativePath />
+ <artifactId>org.apache.sling.testing.osgi-mock.parent</artifactId>
+ <version>2.4.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
</parent>
<artifactId>org.apache.sling.testing.osgi-mock.junit4</artifactId>
- <version>2.4.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>Apache Sling Testing OSGi Mock JUnit 4</name>
- <description>Mock implementation of selected OSGi APIs.</description>
<dependencies>
<dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation.versioning</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>osgi.cmpn</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.osgi-mock.core</artifactId>
<version>2.4.0-SNAPSHOT</version>
@@ -66,28 +48,19 @@
<scope>test</scope>
</dependency>
- <!-- Nullability annotations -->
<dependency>
- <groupId>org.jetbrains</groupId>
- <artifactId>annotations</artifactId>
- <scope>provided</scope>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
</dependency>
-
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <version>2.19.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.logging-mock</artifactId>
- <version>2.0.0</version>
<scope>test</scope>
</dependency>
diff --git a/junit5/pom.xml b/junit5/pom.xml
index c3e45c8..ba9c30b 100644
--- a/junit5/pom.xml
+++ b/junit5/pom.xml
@@ -22,37 +22,19 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.sling</groupId>
- <artifactId>sling</artifactId>
- <version>34-SNAPSHOT</version>
- <relativePath />
+ <artifactId>org.apache.sling.testing.osgi-mock.parent</artifactId>
+ <version>2.4.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
</parent>
<artifactId>org.apache.sling.testing.osgi-mock.junit5</artifactId>
- <version>2.4.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>Apache Sling Testing OSGi Mock JUnit 5</name>
- <description>Mock implementation of selected OSGi APIs.</description>
<dependencies>
<dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.annotation.versioning</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>osgi.cmpn</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.osgi-mock.core</artifactId>
<version>2.4.0-SNAPSHOT</version>
@@ -66,17 +48,14 @@
<scope>test</scope>
</dependency>
-
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
- <version>2.19.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.logging-mock</artifactId>
- <version>2.0.0</version>
<scope>test</scope>
</dependency>
diff --git a/junit5/pom.xml b/parent/pom.xml
similarity index 69%
copy from junit5/pom.xml
copy to parent/pom.xml
index c3e45c8..07a5dcf 100644
--- a/junit5/pom.xml
+++ b/parent/pom.xml
@@ -27,11 +27,11 @@
<relativePath />
</parent>
- <artifactId>org.apache.sling.testing.osgi-mock.junit5</artifactId>
+ <artifactId>org.apache.sling.testing.osgi-mock.parent</artifactId>
<version>2.4.0-SNAPSHOT</version>
- <packaging>bundle</packaging>
+ <packaging>pom</packaging>
- <name>Apache Sling Testing OSGi Mock JUnit 5</name>
+ <name>Apache Sling Testing OSGi Mock Parent</name>
<description>Mock implementation of selected OSGi APIs.</description>
<dependencies>
@@ -52,46 +52,30 @@
<scope>provided</scope>
</dependency>
+ <!-- Nullability annotations -->
<dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.testing.osgi-mock.core</artifactId>
- <version>2.4.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.testing.osgi-mock.core</artifactId>
- <version>2.4.0-SNAPSHOT</version>
- <classifier>tests</classifier>
- <scope>test</scope>
+ <groupId>org.jetbrains</groupId>
+ <artifactId>annotations</artifactId>
+ <scope>provided</scope>
</dependency>
+ </dependencies>
+
+ <dependencyManagement>
+ <dependencies>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
- <version>2.19.1</version>
- <scope>test</scope>
+ <version>2.21.0</version>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.logging-mock</artifactId>
<version>2.0.0</version>
- <scope>test</scope>
</dependency>
- </dependencies>
-
- <build>
- <plugins>
-
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- </plugin>
-
- </plugins>
- </build>
+ </dependencies>
+ </dependencyManagement>
</project>
diff --git a/pom.xml b/pom.xml
index db478ce..fe86d43 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,17 +22,15 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.sling</groupId>
- <artifactId>sling</artifactId>
- <version>34-SNAPSHOT</version>
- <relativePath />
+ <artifactId>org.apache.sling.testing.osgi-mock.parent</artifactId>
+ <version>2.4.0-SNAPSHOT</version>
+ <relativePath>parent/pom.xml</relativePath>
</parent>
<artifactId>org.apache.sling.testing.osgi-mock.root</artifactId>
- <version>2.4.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Apache Sling Testing OSGi Mock</name>
- <description>Mock implementation of selected OSGi APIs.</description>
<scm>
<connection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git</connection>
@@ -42,6 +40,7 @@
</scm>
<modules>
+ <module>parent</module>
<module>core</module>
<module>junit4</module>
<module>junit5</module>
diff --git a/relocate/pom.xml b/relocate/pom.xml
index a5c0ed8..9d7b006 100644
--- a/relocate/pom.xml
+++ b/relocate/pom.xml
@@ -22,13 +22,12 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.sling</groupId>
- <artifactId>sling</artifactId>
- <version>34-SNAPSHOT</version>
- <relativePath />
+ <artifactId>org.apache.sling.testing.osgi-mock.parent</artifactId>
+ <version>2.4.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
</parent>
<artifactId>org.apache.sling.testing.osgi-mock</artifactId>
- <version>2.4.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Apache Sling Testing OSGi Mock Relocation</name>
[sling-org-apache-sling-testing-osgi-mock] 03/05: SLING-7803 move
junit4-specific files to junit4 module
Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a commit to branch feature/SLING-7803-junit5
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git
commit 3ac6d0c61462970d01d17c53c5ff277d4a4c731e
Author: sseifert <ss...@pro-vision.de>
AuthorDate: Mon Aug 6 15:00:27 2018 +0200
SLING-7803 move junit4-specific files to junit4 module
---
core/pom.xml | 2 +-
.../sling/testing/mock/osgi/junit/OsgiContext.java | 7 +++
.../mock/osgi/junit/OsgiContextBuilder.java | 7 +++
.../mock/osgi/junit/OsgiContextCallback.java | 7 +++
junit4/pom.xml | 55 ++++++++++++++++++++++
.../sling/testing/mock/osgi/junit/OsgiContext.java | 0
.../mock/osgi/junit/OsgiContextBuilder.java | 0
.../mock/osgi/junit/OsgiContextCallback.java | 0
.../testing/mock/osgi/junit/package-info.java | 0
.../testing/mock/osgi/junit/OsgiContextTest.java | 0
junit5/pom.xml | 44 +++++++++++++++++
11 files changed, 121 insertions(+), 1 deletion(-)
diff --git a/core/pom.xml b/core/pom.xml
index e8d3e49..4684c68 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -157,7 +157,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <scope>compile</scope>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContext.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContext.java
similarity index 89%
copy from core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContext.java
copy to core/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContext.java
index 01ffdc7..f6a25b2 100644
--- a/core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContext.java
+++ b/core/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContext.java
@@ -28,6 +28,13 @@ import org.junit.runner.Description;
import org.junit.runners.model.Statement;
import org.osgi.annotation.versioning.ProviderType;
+/*
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ * PLEASE NOTE: this file is copied from osgi-mock.junit4 project to ease the unit tests in the core project.
+ * If you need change it in osgi-mock.junit4, please update it her as well (and vice versa).
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ */
+
/**
* JUnit rule for setting up and tearing down OSGi context for unit tests.
*/
diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java
similarity index 90%
copy from core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java
copy to core/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java
index 81bd569..ea29c87 100644
--- a/core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java
+++ b/core/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java
@@ -25,6 +25,13 @@ import org.apache.sling.testing.mock.osgi.context.ContextCallback;
import org.apache.sling.testing.mock.osgi.context.ContextPlugin;
import org.osgi.annotation.versioning.ProviderType;
+/*
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ * PLEASE NOTE: this file is copied from osgi-mock.junit4 project to ease the unit tests in the core project.
+ * If you need change it in osgi-mock.junit4, please update it her as well (and vice versa).
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ */
+
/**
* Builder class for creating {@link OsgiContext} instances with different sets of parameters.
*/
diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextCallback.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextCallback.java
similarity index 74%
copy from core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextCallback.java
copy to core/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextCallback.java
index 710b65d..c37a583 100644
--- a/core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextCallback.java
+++ b/core/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextCallback.java
@@ -21,6 +21,13 @@ package org.apache.sling.testing.mock.osgi.junit;
import org.apache.sling.testing.mock.osgi.context.ContextCallback;
import org.osgi.annotation.versioning.ConsumerType;
+/*
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ * PLEASE NOTE: this file is copied from osgi-mock.junit4 project to ease the unit tests in the core project.
+ * If you need change it in osgi-mock.junit4, please update it her as well (and vice versa).
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ */
+
/**
* Callback interface for application-specific setup and teardown operations to
* customize the {@link OsgiContext} JUnit rule.
diff --git a/junit4/pom.xml b/junit4/pom.xml
index a1cdd83..b7c196c 100644
--- a/junit4/pom.xml
+++ b/junit4/pom.xml
@@ -35,6 +35,61 @@
<description>Mock implementation of selected OSGi APIs.</description>
<dependencies>
+
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>osgi.core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>osgi.cmpn</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.testing.osgi-mock.core</artifactId>
+ <version>2.4.0-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.testing.osgi-mock.core</artifactId>
+ <version>2.4.0-SNAPSHOT</version>
+ <classifier>tests</classifier>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Nullability annotations -->
+ <dependency>
+ <groupId>org.jetbrains</groupId>
+ <artifactId>annotations</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>2.19.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.testing.logging-mock</artifactId>
+ <version>2.0.0</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContext.java b/junit4/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContext.java
similarity index 100%
rename from core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContext.java
rename to junit4/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContext.java
diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java b/junit4/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java
similarity index 100%
rename from core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java
rename to junit4/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java
diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextCallback.java b/junit4/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextCallback.java
similarity index 100%
rename from core/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextCallback.java
rename to junit4/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextCallback.java
diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/junit/package-info.java b/junit4/src/main/java/org/apache/sling/testing/mock/osgi/junit/package-info.java
similarity index 100%
rename from core/src/main/java/org/apache/sling/testing/mock/osgi/junit/package-info.java
rename to junit4/src/main/java/org/apache/sling/testing/mock/osgi/junit/package-info.java
diff --git a/core/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextTest.java b/junit4/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextTest.java
similarity index 100%
rename from core/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextTest.java
rename to junit4/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextTest.java
diff --git a/junit5/pom.xml b/junit5/pom.xml
index b60b188..c3e45c8 100644
--- a/junit5/pom.xml
+++ b/junit5/pom.xml
@@ -36,6 +36,50 @@
<dependencies>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.annotation.versioning</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>osgi.core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>osgi.cmpn</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.testing.osgi-mock.core</artifactId>
+ <version>2.4.0-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.testing.osgi-mock.core</artifactId>
+ <version>2.4.0-SNAPSHOT</version>
+ <classifier>tests</classifier>
+ <scope>test</scope>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>2.19.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.testing.logging-mock</artifactId>
+ <version>2.0.0</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
<build>
[sling-org-apache-sling-testing-osgi-mock] 05/05: SLING-7803 add
junit5 extension
Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a commit to branch feature/SLING-7803-junit5
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git
commit 410906c8f56488d5feb41cdacf886ae5e7ec6fbb
Author: sseifert <ss...@pro-vision.de>
AuthorDate: Mon Aug 6 16:57:34 2018 +0200
SLING-7803 add junit5 extension
---
.../mock/osgi/junit/OsgiContextBuilder.java | 2 +-
junit5/pom.xml | 36 ++++++
.../testing/mock/osgi/junit5/OsgiContext.java | 78 +++++++++++++
.../mock/osgi/junit5}/OsgiContextBuilder.java | 47 ++++----
.../mock/osgi/junit5/OsgiContextCallback.java | 33 ++++++
.../mock/osgi/junit5/OsgiContextExtension.java | 125 +++++++++++++++++++++
.../testing/mock/osgi/junit5/OsgiContextStore.java | 92 +++++++++++++++
.../testing/mock/osgi/junit5/package-info.java | 23 ++++
.../junit5/OsgiContextMemberInstantiatedTest.java | 42 +++++++
.../mock/osgi/junit5/OsgiContextMemberTest.java | 42 +++++++
.../mock/osgi/junit5/OsgiContextPluginTest.java | 68 +++++++++++
.../testing/mock/osgi/junit5/OsgiContextTest.java | 40 +++++++
12 files changed, 608 insertions(+), 20 deletions(-)
diff --git a/junit4/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java b/junit4/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java
index 81bd569..cdd293e 100644
--- a/junit4/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java
+++ b/junit4/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java
@@ -34,7 +34,7 @@ public final class OsgiContextBuilder {
private final @NotNull ContextPlugins plugins = new ContextPlugins();
/**
- * Create builder with default resource resolver type.
+ * Create builder.
*/
public OsgiContextBuilder() {}
diff --git a/junit5/pom.xml b/junit5/pom.xml
index ba9c30b..c6989ad 100644
--- a/junit5/pom.xml
+++ b/junit5/pom.xml
@@ -59,7 +59,43 @@
<scope>test</scope>
</dependency>
+ <!-- JUnit 5 -->
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-params</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-engine</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.vintage</groupId>
+ <artifactId>junit-vintage-engine</artifactId>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
+
+ <dependencyManagement>
+ <dependencies>
+
+ <dependency>
+ <groupId>org.junit</groupId>
+ <artifactId>junit-bom</artifactId>
+ <version>5.2.0</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ </dependencies>
+ </dependencyManagement>
<build>
<plugins>
diff --git a/junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContext.java b/junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContext.java
new file mode 100644
index 0000000..f57ddaa
--- /dev/null
+++ b/junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContext.java
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.testing.mock.osgi.junit5;
+
+import org.apache.sling.testing.mock.osgi.context.ContextPlugins;
+import org.apache.sling.testing.mock.osgi.context.OsgiContextImpl;
+import org.jetbrains.annotations.NotNull;
+import org.osgi.annotation.versioning.ConsumerType;
+
+/**
+ * OSGi Mock parameter object.
+ * <p>
+ * Additionally you can subclass this class and provide further parameters via
+ * {@link OsgiContextBuilder}.
+ * </p>
+ */
+@ConsumerType
+public final class OsgiContext extends OsgiContextImpl {
+
+ private final ContextPlugins plugins;
+ private boolean isSetUp;
+
+ /**
+ * Initialize OSGi context.
+ */
+ public OsgiContext() {
+ this(new ContextPlugins());
+ }
+
+ /**
+ * Initialize OSGi context.
+ * @param contextPlugins Context plugins
+ */
+ OsgiContext(@NotNull final ContextPlugins contextPlugins) {
+ this.plugins = contextPlugins;
+ }
+
+ /**
+ * This is called by {@link OsgiContextExtension} to set up context.
+ */
+ protected void setUpContext() {
+ isSetUp = true;
+ plugins.executeBeforeSetUpCallback(this);
+ super.setUp();
+ }
+
+ /**
+ * This is called by {@link OsgiContextExtension} to tear down context.
+ */
+ protected void tearDownContext() {
+ super.tearDown();
+ }
+
+ ContextPlugins getContextPlugins() {
+ return plugins;
+ }
+
+ boolean isSetUp() {
+ return this.isSetUp;
+ }
+
+}
diff --git a/junit4/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java b/junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextBuilder.java
similarity index 66%
copy from junit4/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java
copy to junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextBuilder.java
index 81bd569..8a90f81 100644
--- a/junit4/src/main/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextBuilder.java
+++ b/junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextBuilder.java
@@ -16,79 +16,88 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.sling.testing.mock.osgi.junit;
+package org.apache.sling.testing.mock.osgi.junit5;
+import org.apache.sling.testing.mock.osgi.context.ContextCallback;
+import org.apache.sling.testing.mock.osgi.context.ContextPlugin;
import org.apache.sling.testing.mock.osgi.context.ContextPlugins;
import org.apache.sling.testing.mock.osgi.context.OsgiContextImpl;
import org.jetbrains.annotations.NotNull;
-import org.apache.sling.testing.mock.osgi.context.ContextCallback;
-import org.apache.sling.testing.mock.osgi.context.ContextPlugin;
import org.osgi.annotation.versioning.ProviderType;
/**
- * Builder class for creating {@link OsgiContext} instances with different sets of parameters.
+ * Builder class for creating {@link OsgiContext} instances with different sets
+ * of parameters.
*/
@ProviderType
public final class OsgiContextBuilder {
-
+
private final @NotNull ContextPlugins plugins = new ContextPlugins();
-
+
/**
- * Create builder with default resource resolver type.
+ * Create builder.
*/
public OsgiContextBuilder() {}
-
+
/**
* @param <T> context type
* @param plugin Context plugin which listens to context lifecycle events.
* @return this
*/
@SafeVarargs
- public final @NotNull <T extends OsgiContextImpl> OsgiContextBuilder plugin(@NotNull ContextPlugin<T> @NotNull ... plugin) {
+ public final <T extends OsgiContextImpl> OsgiContextBuilder plugin(@NotNull ContextPlugin<T> @NotNull ... plugin) {
plugins.addPlugin(plugin);
return this;
}
/**
* @param <T> context type
- * @param beforeSetUpCallback Allows the application to register an own callback function that is called before the built-in setup rules are executed.
+ * @param beforeSetUpCallback Allows the application to register an own
+ * callback function that is called before the built-in setup
+ * rules are executed.
* @return this
*/
@SafeVarargs
- public final @NotNull <T extends OsgiContextImpl> OsgiContextBuilder beforeSetUp(@NotNull ContextCallback<T> @NotNull ... beforeSetUpCallback) {
+ public final <T extends OsgiContextImpl> OsgiContextBuilder beforeSetUp(@NotNull ContextCallback<T> @NotNull ... beforeSetUpCallback) {
plugins.addBeforeSetUpCallback(beforeSetUpCallback);
return this;
}
/**
* @param <T> context type
- * @param afterSetUpCallback Allows the application to register an own callback function that is called after the built-in setup rules are executed.
+ * @param afterSetUpCallback Allows the application to register an own
+ * callback function that is called after the built-in setup
+ * rules are executed.
* @return this
*/
@SafeVarargs
- public final @NotNull <T extends OsgiContextImpl> OsgiContextBuilder afterSetUp(@NotNull ContextCallback<T> @NotNull ... afterSetUpCallback) {
+ public final <T extends OsgiContextImpl> OsgiContextBuilder afterSetUp(@NotNull ContextCallback<T> @NotNull ... afterSetUpCallback) {
plugins.addAfterSetUpCallback(afterSetUpCallback);
return this;
}
/**
* @param <T> context type
- * @param beforeTearDownCallback Allows the application to register an own callback function that is called before the built-in teardown rules are executed.
+ * @param beforeTearDownCallback Allows the application to register an own
+ * callback function that is called before the built-in teardown
+ * rules are executed.
* @return this
*/
@SafeVarargs
- public final @NotNull <T extends OsgiContextImpl> OsgiContextBuilder beforeTearDown(@NotNull ContextCallback<T> @NotNull ... beforeTearDownCallback) {
+ public final <T extends OsgiContextImpl> OsgiContextBuilder beforeTearDown(@NotNull ContextCallback<T> @NotNull ... beforeTearDownCallback) {
plugins.addBeforeTearDownCallback(beforeTearDownCallback);
return this;
}
/**
* @param <T> context type
- * @param afterTearDownCallback Allows the application to register an own callback function that is after before the built-in teardown rules are executed.
+ * @param afterTearDownCallback Allows the application to register an own
+ * callback function that is after before the built-in teardown
+ * rules are executed.
* @return this
*/
@SafeVarargs
- public final @NotNull <T extends OsgiContextImpl> OsgiContextBuilder afterTearDown(@NotNull ContextCallback<T> @NotNull ... afterTearDownCallback) {
+ public final <T extends OsgiContextImpl> OsgiContextBuilder afterTearDown(@NotNull ContextCallback<T> @NotNull ... afterTearDownCallback) {
plugins.addAfterTearDownCallback(afterTearDownCallback);
return this;
}
@@ -97,7 +106,7 @@ public final class OsgiContextBuilder {
* @return Build {@link OsgiContext} instance.
*/
public @NotNull OsgiContext build() {
- return new OsgiContext(plugins);
+ return new OsgiContext(this.plugins);
}
-
+
}
diff --git a/junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextCallback.java b/junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextCallback.java
new file mode 100644
index 0000000..afe42a9
--- /dev/null
+++ b/junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextCallback.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.testing.mock.osgi.junit5;
+
+import org.apache.sling.testing.mock.osgi.context.ContextCallback;
+import org.osgi.annotation.versioning.ConsumerType;
+
+/**
+ * Callback interface for application-specific setup and teardown operations to
+ * customize the {@link OsgiContext} JUnit parameter context.
+ */
+@ConsumerType
+public interface OsgiContextCallback extends ContextCallback<OsgiContext> {
+
+ // specialized version of ContextCallback
+
+}
diff --git a/junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextExtension.java b/junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextExtension.java
new file mode 100644
index 0000000..608238f
--- /dev/null
+++ b/junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextExtension.java
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.testing.mock.osgi.junit5;
+
+import java.lang.reflect.Field;
+import java.util.Arrays;
+import java.util.function.Consumer;
+
+import org.junit.jupiter.api.extension.AfterEachCallback;
+import org.junit.jupiter.api.extension.AfterTestExecutionCallback;
+import org.junit.jupiter.api.extension.BeforeEachCallback;
+import org.junit.jupiter.api.extension.ExtensionContext;
+import org.junit.jupiter.api.extension.ParameterContext;
+import org.junit.jupiter.api.extension.ParameterResolver;
+import org.junit.jupiter.api.extension.TestInstancePostProcessor;
+
+/**
+ * JUnit 5 extension that allows to inject {@link OsgiContext} (or subclasses of
+ * it) parameters in test methods, and ensures that the context is set up and
+ * teared down properly for each test method.
+ */
+public final class OsgiContextExtension implements ParameterResolver, TestInstancePostProcessor, BeforeEachCallback,
+ AfterEachCallback, AfterTestExecutionCallback {
+
+ /**
+ * Checks if test class has a {@link OsgiContext} or derived field. If it has
+ * and is not instantiated, create an new {@link OsgiContext} and store it in
+ * the field. If it is already instantiated reuse this instance and use it
+ * for all test methods.
+ */
+ @Override
+ public void postProcessTestInstance(Object testInstance, ExtensionContext extensionContext) throws Exception {
+ Field osgiContextField = getFieldFromTestInstance(testInstance, OsgiContext.class);
+ if (osgiContextField != null) {
+ OsgiContext context = (OsgiContext)osgiContextField.get(testInstance);
+ if (context != null) {
+ if (!context.isSetUp()) {
+ context.setUpContext();
+ }
+ OsgiContextStore.storeOsgiContext(extensionContext, testInstance, context);
+ } else {
+ context = OsgiContextStore.getOrCreateOsgiContext(extensionContext, testInstance);
+ osgiContextField.set(testInstance, context);
+ }
+ }
+ }
+
+ /**
+ * Support parameter injection for test methods of parameter type is derived from {@link OsgiContext}.
+ */
+ @Override
+ public boolean supportsParameter(ParameterContext parameterContext, ExtensionContext extensionContext) {
+ return OsgiContext.class.isAssignableFrom(parameterContext.getParameter().getType());
+ }
+
+ /**
+ * Resolve (or create) {@link OsgiContext} instance for test method parameter.
+ */
+ @Override
+ public Object resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext) {
+ return OsgiContextStore.getOrCreateOsgiContext(extensionContext, extensionContext.getRequiredTestInstance());
+ }
+
+ @Override
+ public void beforeEach(ExtensionContext extensionContext) throws Exception {
+ applyOsgiContext(extensionContext, osgiContext -> {
+ // call context plugins setup after all @BeforeEach methods were called
+ osgiContext.getContextPlugins().executeAfterSetUpCallback(osgiContext);
+ });
+ }
+
+ @Override
+ public void afterTestExecution(ExtensionContext extensionContext) throws Exception {
+ applyOsgiContext(extensionContext, osgiContext -> {
+ // call context plugins setup before any @AfterEach method is called
+ osgiContext.getContextPlugins().executeBeforeTearDownCallback(osgiContext);
+ });
+ }
+
+ @Override
+ public void afterEach(ExtensionContext extensionContext) {
+ applyOsgiContext(extensionContext, osgiContext -> {
+ // call context plugins setup after all @AfterEach methods were called
+ osgiContext.getContextPlugins().executeAfterTearDownCallback(osgiContext);
+
+ // Tear down {@link OsgiContext} after test is complete.
+ osgiContext.tearDownContext();
+ OsgiContextStore.removeOsgiContext(extensionContext, extensionContext.getRequiredTestInstance());
+ });
+ }
+
+ private void applyOsgiContext(ExtensionContext extensionContext, Consumer<OsgiContext> consumer) {
+ OsgiContext osgiContext = OsgiContextStore.getOsgiContext(extensionContext,
+ extensionContext.getRequiredTestInstance());
+ if (osgiContext != null) {
+ consumer.accept(osgiContext);
+ }
+ }
+
+ private Field getFieldFromTestInstance(Object testInstance, Class<?> type) {
+ Field contextField = Arrays.stream(testInstance.getClass().getDeclaredFields())
+ .filter(field -> type.isAssignableFrom(field.getType())).findFirst().orElse(null);
+ if (contextField != null) {
+ contextField.setAccessible(true);
+ }
+ return contextField;
+ }
+
+}
diff --git a/junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextStore.java b/junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextStore.java
new file mode 100644
index 0000000..f7f31d3
--- /dev/null
+++ b/junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextStore.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.testing.mock.osgi.junit5;
+
+import org.junit.jupiter.api.extension.ExtensionContext;
+import org.junit.jupiter.api.extension.ExtensionContext.Namespace;
+import org.junit.jupiter.api.extension.ExtensionContext.Store;
+
+/**
+ * Helper class managing storage of {@link OsgiContext} in extension context
+ * store.
+ */
+final class OsgiContextStore {
+
+ private static final Namespace OSGi_CONTEXT_NAMESPACE = Namespace.create(OsgiContextExtension.class);
+
+ private OsgiContextStore() {
+ // static methods only
+ }
+
+ /**
+ * Get {@link OsgiContext} from extension context store.
+ * @param extensionContext Extension context
+ * @param testInstance Test instance
+ * @return OsgiContext or null
+ */
+ public static OsgiContext getOsgiContext(ExtensionContext extensionContext, Object testInstance) {
+ return getStore(extensionContext).get(testInstance, OsgiContext.class);
+ }
+
+ /**
+ * Get {@link OsgiContext} from extension context store - if it does not
+ * exist create a new one and store it.
+ * @param extensionContext Extension context
+ * @param testInstance Test instance
+ * @return OsgiContext (never null)
+ */
+ public static OsgiContext getOrCreateOsgiContext(ExtensionContext extensionContext, Object testInstance) {
+ OsgiContext context = getOsgiContext(extensionContext, testInstance);
+ if (context == null) {
+ context = createOsgiContext(extensionContext);
+ storeOsgiContext(extensionContext, testInstance, context);
+ }
+ return context;
+ }
+
+ /**
+ * Removes {@link OsgiContext} from extension context store (if it exists).
+ * @param extensionContext Extension context
+ * @param testInstance Test instance
+ */
+ public static void removeOsgiContext(ExtensionContext extensionContext, Object testInstance) {
+ getStore(extensionContext).remove(testInstance);
+ }
+
+ /**
+ * Store {@link OsgiContext} in extension context store.
+ * @param extensionContext Extension context
+ * @param testInstance Test instance
+ * @param osgiContext OSGi context
+ */
+ public static void storeOsgiContext(ExtensionContext extensionContext, Object testInstance, OsgiContext osgiContext) {
+ getStore(extensionContext).put(testInstance, osgiContext);
+ }
+
+ private static Store getStore(ExtensionContext context) {
+ return context.getStore(OSGi_CONTEXT_NAMESPACE);
+ }
+
+ private static OsgiContext createOsgiContext(ExtensionContext extensionContext) {
+ OsgiContext osgiContext = new OsgiContext();
+ osgiContext.setUpContext();
+ return osgiContext;
+ }
+
+}
diff --git a/junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5/package-info.java b/junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5/package-info.java
new file mode 100644
index 0000000..7cb00c7
--- /dev/null
+++ b/junit5/src/main/java/org/apache/sling/testing/mock/osgi/junit5/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/**
+ * JUnit 5 extensions for OSGi context.
+ */
+@org.osgi.annotation.versioning.Version("1.0.0")
+package org.apache.sling.testing.mock.osgi.junit5;
diff --git a/junit5/src/test/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextMemberInstantiatedTest.java b/junit5/src/test/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextMemberInstantiatedTest.java
new file mode 100644
index 0000000..07a98b2
--- /dev/null
+++ b/junit5/src/test/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextMemberInstantiatedTest.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.testing.mock.osgi.junit5;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+
+/**
+ * Test with {@link OsgiContext} as class member variable already instantiated.
+ */
+@ExtendWith(OsgiContextExtension.class)
+class OsgiContextMemberInstantiatedTest {
+
+ OsgiContext context = new OsgiContext();
+
+ @Test
+ void testSimpleService() {
+ context.registerInjectActivateService(new Integer(5));
+
+ Integer service = context.getService(Integer.class);
+ assertEquals((Integer)5, service);
+ }
+
+}
diff --git a/junit5/src/test/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextMemberTest.java b/junit5/src/test/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextMemberTest.java
new file mode 100644
index 0000000..e1cf9c1
--- /dev/null
+++ b/junit5/src/test/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextMemberTest.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.testing.mock.osgi.junit5;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+
+/**
+ * Test with {@link OsgiContext} as class member variable.
+ */
+@ExtendWith(OsgiContextExtension.class)
+class OsgiContextMemberTest {
+
+ OsgiContext context;
+
+ @Test
+ void testSimpleService() {
+ context.registerInjectActivateService(new Integer(5));
+
+ Integer service = context.getService(Integer.class);
+ assertEquals((Integer)5, service);
+ }
+
+}
diff --git a/junit5/src/test/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextPluginTest.java b/junit5/src/test/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextPluginTest.java
new file mode 100644
index 0000000..111d6d6
--- /dev/null
+++ b/junit5/src/test/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextPluginTest.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.testing.mock.osgi.junit5;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+
+import org.jetbrains.annotations.NotNull;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+
+/**
+ * Test with {@link OsgiContext} with context plugins.
+ */
+@ExtendWith(OsgiContextExtension.class)
+class OsgiContextPluginTest {
+
+ private final @NotNull OsgiContextCallback contextBeforeSetup = mock(OsgiContextCallback.class);
+ private final @NotNull OsgiContextCallback contextAfterSetup = mock(OsgiContextCallback.class);
+ private final @NotNull OsgiContextCallback contextBeforeTeardown = mock(OsgiContextCallback.class);
+ private final @NotNull OsgiContextCallback contextAfterTeardown = mock(OsgiContextCallback.class);
+
+ private final @NotNull OsgiContext context = new OsgiContextBuilder()
+ .beforeSetUp(contextBeforeSetup)
+ .afterSetUp(contextAfterSetup)
+ .beforeTearDown(contextBeforeTeardown)
+ .afterTearDown(contextAfterTeardown)
+ .build();
+
+ @BeforeEach
+ public void setUp() throws Exception {
+ verify(contextBeforeSetup).execute(context);
+ }
+
+ @Test
+ public void testRequest() throws Exception {
+ verify(contextAfterSetup).execute(context);
+ }
+
+ @Test
+ public void testResourceResolverFactoryActivatorProps() throws Exception {
+ verify(contextAfterSetup).execute(context);
+ }
+
+ @AfterEach
+ public void tearDown() throws Exception {
+ verify(contextBeforeTeardown).execute(context);
+ }
+
+}
diff --git a/junit5/src/test/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextTest.java b/junit5/src/test/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextTest.java
new file mode 100644
index 0000000..40785f5
--- /dev/null
+++ b/junit5/src/test/java/org/apache/sling/testing/mock/osgi/junit5/OsgiContextTest.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.testing.mock.osgi.junit5;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+
+/**
+ * Test with {@link OsgiContext} as test method parameter.
+ */
+@ExtendWith(OsgiContextExtension.class)
+class OsgiContextTest {
+
+ @Test
+ void testSimpleService(OsgiContext context) {
+ context.registerInjectActivateService(new Integer(5));
+
+ Integer service = context.getService(Integer.class);
+ assertEquals((Integer)5, service);
+ }
+
+}
[sling-org-apache-sling-testing-osgi-mock] 02/05: SLING-7803 update
to latest mockito version, update dependencies
Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a commit to branch feature/SLING-7803-junit5
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git
commit 20c940ffdd4dd66b042183083d8d46644b425294
Author: sseifert <ss...@pro-vision.de>
AuthorDate: Mon Aug 6 14:40:36 2018 +0200
SLING-7803 update to latest mockito version, update dependencies
---
core/pom.xml | 32 +++++++++++++++-------
.../sling/testing/mock/osgi/OsgiMetadataUtil.java | 2 +-
...ckBundleContextDynamicReferencesOsgiR6Test.java | 2 +-
.../MockBundleContextDynamicReferencesTest.java | 2 +-
...ockBundleContextStaticGreedyReferencesTest.java | 2 +-
.../testing/mock/osgi/MockBundleContextTest.java | 4 +--
.../testing/mock/osgi/MockEventAdminTest.java | 10 +++----
.../mock/osgi/context/ContextPluginsTest.java | 2 +-
.../testing/mock/osgi/junit/OsgiContextTest.java | 2 +-
9 files changed, 35 insertions(+), 23 deletions(-)
diff --git a/core/pom.xml b/core/pom.xml
index 3a49e92..e8d3e49 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -35,22 +35,21 @@
<description>Mock implementation of selected OSGi APIs.</description>
<dependencies>
-
+
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.annotation.versioning</artifactId>
<scope>provided</scope>
</dependency>
-
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.core</artifactId>
- <scope>compile</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.cmpn</artifactId>
- <scope>compile</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
@@ -63,7 +62,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
- <version>3.0.1</version>
+ <version>3.3.2</version>
<scope>compile</scope>
</dependency>
<dependency>
@@ -151,8 +150,8 @@
<dependency>
<groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>1.9.5</version>
+ <artifactId>mockito-core</artifactId>
+ <version>2.19.1</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -168,16 +167,29 @@
</dependency>
</dependencies>
-
+
<build>
<plugins>
+ <!-- Publish test artifact -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
</plugin>
-
+
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
@@ -253,5 +265,5 @@
</plugins>
</build>
-
+
</project>
diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtil.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtil.java
index 1e0b8d3..1bee861 100644
--- a/core/src/main/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtil.java
+++ b/core/src/main/java/org/apache/sling/testing/mock/osgi/OsgiMetadataUtil.java
@@ -254,7 +254,7 @@ final class OsgiMetadataUtil {
* @return Cleaned up class name
*/
public static final String cleanupClassName(String className) {
- return StringUtils.substringBefore(className, "$$Enhancer");
+ return StringUtils.substringBefore(StringUtils.substringBefore(className, "$MockitoMock$"), "$$Enhancer");
}
private static String getComponentName(Class clazz, Document metadata) {
diff --git a/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesOsgiR6Test.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesOsgiR6Test.java
index 9de52ce..a23fd9a 100644
--- a/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesOsgiR6Test.java
+++ b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesOsgiR6Test.java
@@ -32,7 +32,7 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
-import org.mockito.runners.MockitoJUnitRunner;
+import org.mockito.junit.MockitoJUnitRunner;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
diff --git a/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesTest.java
index 4fcd531..5437e23 100644
--- a/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesTest.java
+++ b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextDynamicReferencesTest.java
@@ -32,7 +32,7 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
-import org.mockito.runners.MockitoJUnitRunner;
+import org.mockito.junit.MockitoJUnitRunner;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
diff --git a/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextStaticGreedyReferencesTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextStaticGreedyReferencesTest.java
index a78ad3c..503b0c4 100644
--- a/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextStaticGreedyReferencesTest.java
+++ b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextStaticGreedyReferencesTest.java
@@ -32,7 +32,7 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
-import org.mockito.runners.MockitoJUnitRunner;
+import org.mockito.junit.MockitoJUnitRunner;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
diff --git a/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java
index 0359040..dc425b0 100644
--- a/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java
+++ b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockBundleContextTest.java
@@ -25,7 +25,7 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
@@ -38,7 +38,7 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.runners.MockitoJUnitRunner;
+import org.mockito.junit.MockitoJUnitRunner;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleEvent;
diff --git a/core/src/test/java/org/apache/sling/testing/mock/osgi/MockEventAdminTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockEventAdminTest.java
index e8004d0..9e1ca1d 100644
--- a/core/src/test/java/org/apache/sling/testing/mock/osgi/MockEventAdminTest.java
+++ b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockEventAdminTest.java
@@ -23,8 +23,8 @@ import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
import java.util.Dictionary;
import java.util.List;
+import java.util.Objects;
-import org.apache.commons.lang3.ObjectUtils;
import org.apache.sling.testing.mock.osgi.junit.OsgiContext;
import org.junit.Before;
import org.junit.Rule;
@@ -110,10 +110,10 @@ public class MockEventAdminTest {
// wait until result is as expected (with timeout)
boolean expectedResult = false;
while (!expectedResult) {
- expectedResult = ObjectUtils.equals(ImmutableList.of(), eventHandler1.getReceivedEvents())
- && ObjectUtils.equals(ImmutableList.of(EVENT_SAMPLE_2), eventHandler12.getReceivedEvents())
- && ObjectUtils.equals(ImmutableList.of(EVENT_SAMPLE_2), eventHandlerSampleAll.getReceivedEvents())
- && ObjectUtils.equals(ImmutableList.of(EVENT_SAMPLE_2, EVENT_OTHER_3), eventHandlerAll.getReceivedEvents());
+ expectedResult = Objects.equals(ImmutableList.of(), eventHandler1.getReceivedEvents())
+ && Objects.equals(ImmutableList.of(EVENT_SAMPLE_2), eventHandler12.getReceivedEvents())
+ && Objects.equals(ImmutableList.of(EVENT_SAMPLE_2), eventHandlerSampleAll.getReceivedEvents())
+ && Objects.equals(ImmutableList.of(EVENT_SAMPLE_2, EVENT_OTHER_3), eventHandlerAll.getReceivedEvents());
}
}
diff --git a/core/src/test/java/org/apache/sling/testing/mock/osgi/context/ContextPluginsTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/context/ContextPluginsTest.java
index 1a97478..e3983fb 100644
--- a/core/src/test/java/org/apache/sling/testing/mock/osgi/context/ContextPluginsTest.java
+++ b/core/src/test/java/org/apache/sling/testing/mock/osgi/context/ContextPluginsTest.java
@@ -27,7 +27,7 @@ import org.apache.sling.testing.mock.osgi.junit.OsgiContext;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
-import org.mockito.runners.MockitoJUnitRunner;
+import org.mockito.junit.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
@SuppressWarnings({"unchecked","null"})
diff --git a/core/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextTest.java
index e374516..9c6c401 100644
--- a/core/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextTest.java
+++ b/core/src/test/java/org/apache/sling/testing/mock/osgi/junit/OsgiContextTest.java
@@ -26,7 +26,7 @@ import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.runners.MockitoJUnitRunner;
+import org.mockito.junit.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
@SuppressWarnings("null")