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 2019/03/27 10:26:58 UTC

[sling-org-apache-sling-testing-sling-mock] branch master updated: enable junit tests for testing sling models registration from class path again

This is an automated email from the ASF dual-hosted git repository.

sseifert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git


The following commit(s) were added to refs/heads/master by this push:
     new 61ee21c  enable junit tests for testing sling models registration from class path again
61ee21c is described below

commit 61ee21c39aea7d3626babf10ec8fac509057b0e1
Author: sseifert <ss...@pro-vision.de>
AuthorDate: Wed Mar 27 11:26:48 2019 +0100

    enable junit tests for testing sling models registration from class path again
---
 .../apache/sling/testing/mock/sling/junit5/SlingContextPluginTest.java  | 2 --
 .../org/apache/sling/testing/mock/sling/junit5/SlingContextTest.java    | 2 --
 junit5/src/test/resources/META-INF/MANIFEST.MF                          | 1 +
 3 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/junit5/src/test/java/org/apache/sling/testing/mock/sling/junit5/SlingContextPluginTest.java b/junit5/src/test/java/org/apache/sling/testing/mock/sling/junit5/SlingContextPluginTest.java
index f322c9a..be31245 100644
--- a/junit5/src/test/java/org/apache/sling/testing/mock/sling/junit5/SlingContextPluginTest.java
+++ b/junit5/src/test/java/org/apache/sling/testing/mock/sling/junit5/SlingContextPluginTest.java
@@ -28,7 +28,6 @@ import org.apache.sling.testing.mock.sling.ResourceResolverType;
 import org.apache.sling.testing.mock.sling.context.modelsautoreg.ClasspathRegisteredModel;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 
@@ -92,7 +91,6 @@ class SlingContextPluginTest {
     }
 
     @Test
-    @Disabled  // test does not work on the command line as the customized META-INF/MANIFEST.mf is not contained in the sling-mock test jar
     public void testSlingModelClasspathRegistered() {
         context.request().setAttribute("prop1", "myValue");
         ClasspathRegisteredModel model = context.request().adaptTo(ClasspathRegisteredModel.class);
diff --git a/junit5/src/test/java/org/apache/sling/testing/mock/sling/junit5/SlingContextTest.java b/junit5/src/test/java/org/apache/sling/testing/mock/sling/junit5/SlingContextTest.java
index 7df9b8f..fc956ab 100644
--- a/junit5/src/test/java/org/apache/sling/testing/mock/sling/junit5/SlingContextTest.java
+++ b/junit5/src/test/java/org/apache/sling/testing/mock/sling/junit5/SlingContextTest.java
@@ -26,7 +26,6 @@ import org.apache.sling.testing.mock.sling.context.modelsautoreg.ClasspathRegist
 import org.apache.sling.testing.resourceresolver.MockResourceResolver;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 
@@ -51,7 +50,6 @@ class SlingContextTest {
     }
 
     @Test
-    @Disabled  // test does not work on the command line as the customized META-INF/MANIFEST.mf is not contained in the sling-mock test jar
     public void testSlingModelClasspathRegistered(SlingContext context) {
         context.request().setAttribute("prop1", "myValue");
         ClasspathRegisteredModel model = context.request().adaptTo(ClasspathRegisteredModel.class);
diff --git a/junit5/src/test/resources/META-INF/MANIFEST.MF b/junit5/src/test/resources/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..5423d41
--- /dev/null
+++ b/junit5/src/test/resources/META-INF/MANIFEST.MF
@@ -0,0 +1 @@
+Sling-Model-Packages: org.apache.sling.testing.mock.sling.context.modelsautoreg