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 <[email protected]> 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>
