This is an automated email from the ASF dual-hosted git repository. kwin pushed a commit to branch feature/it-with-slingstart in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-validation-core.git
commit 5dbea744fcd6274ada76fb684c8fee514df310a7 Author: Konrad Windszus <[email protected]> AuthorDate: Sat Dec 9 14:41:31 2017 +0100 SLING-7298 get rid of pax-exam for the IT instead rely on a slightly modified Sling Launchpad, built and started with slingstart-maven-plugin. --- pom.xml | 196 +++++++++------------ .../impl/it/tests/ValidationServiceIT.java | 109 ++++++------ .../impl/it/tests/ValidationTestSupport.java | 118 ------------- src/test/provisioning/model.txt | 42 +++++ src/test/resources/exam.properties | 19 -- src/test/resources/logback.xml | 32 ---- 6 files changed, 178 insertions(+), 338 deletions(-) diff --git a/pom.xml b/pom.xml index 91776ea..9770fad 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,9 @@ <properties> <sling.java.version>8</sling.java.version> - <org.ops4j.pax.exam.version>4.10.0</org.ops4j.pax.exam.version> + <http.host>localhost</http.host> + <!-- start with -DkeepITServerRunning=true to allow to rerun ITs or inspect the server after the ITs have been executed there --> + <keepITServerRunning>false</keepITServerRunning> </properties> <scm> @@ -60,34 +62,91 @@ </configuration> </plugin> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-failsafe-plugin</artifactId> + <!-- Find free ports to run our server --> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> <executions> <execution> + <id>reserve-server-port</id> <goals> - <goal>integration-test</goal> - <goal>verify</goal> + <goal>reserve-network-port</goal> + </goals> + <phase>pre-integration-test</phase> + <configuration> + <portNames> + <!-- reserved port must be stored in property because it must be passed to the slingstart-maven-plugin --> + <portName>http.port</portName> + </portNames> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <!-- the Sling instance is provisioned from the model in src/main/provisioning/model.txt --> + <groupId>org.apache.sling</groupId> + <artifactId>slingstart-maven-plugin</artifactId> + <extensions>true</extensions> + <executions> + <execution> + <id>prepare-launchpad-package</id> + <goals> + <goal>prepare-package</goal> + </goals> + <phase>pre-integration-test</phase> + </execution> + <execution> + <id>build-launchpad-package</id> + <goals> + <goal>package</goal> + </goals> + <phase>pre-integration-test</phase> + </execution> + <execution> + <id>start-container-before-IT</id> + <goals> + <goal>start</goal> + </goals> + <configuration> + </configuration> + </execution> + <execution> + <id>stop-container-after-IT</id> + <goals> + <goal>stop</goal> </goals> + <configuration> + <shouldBlockUntilKeyIsPressed>${keepITServerRunning}</shouldBlockUntilKeyIsPressed> + </configuration> </execution> </executions> <configuration> - <redirectTestOutputToFile>true</redirectTestOutputToFile> - <systemProperties> - <property> - <name>bundle.filename</name> - <value>${basedir}/target/${project.build.finalName}.jar</value> - </property> - </systemProperties> + <servers> + <!-- this configuration applies to both 'start' and 'stop' --> + <server> + <id>singleinstance</id> + <port>${http.port}</port> + <vmOpts>${sling.vm.options}</vmOpts> + <stdOutFile>sling/logs/stdout.log</stdOutFile> + </server> + </servers> + <!-- this configuration only applies to 'prepare-package' and 'package' --> + <disableExtendingMavenClasspath>true</disableExtendingMavenClasspath> </configuration> </plugin> <plugin> - <groupId>org.apache.servicemix.tooling</groupId> - <artifactId>depends-maven-plugin</artifactId> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> <executions> <execution> <goals> - <goal>generate-depends-file</goal> + <goal>integration-test</goal> + <goal>verify</goal> </goals> + <configuration> + <systemProperties> + <http.port>${http.port}</http.port> + </systemProperties> + </configuration> </execution> </executions> </plugin> @@ -141,12 +200,6 @@ </dependency> <dependency> <groupId>org.apache.sling</groupId> - <artifactId>org.apache.sling.resource.presence</artifactId> - <version>0.0.2</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.serviceusermapper</artifactId> <version>1.2.0</version> <scope>provided</scope> @@ -171,51 +224,35 @@ <version>2.2.0</version> <scope>provided</scope> </dependency> + + <!-- Testing dependencies --> <dependency> - <groupId>org.hamcrest</groupId> - <artifactId>hamcrest-library</artifactId> - <version>1.3</version> + <groupId>junit</groupId> + <artifactId>junit</artifactId> <scope>test</scope> </dependency> - <dependency> + <dependency> <groupId>org.hamcrest</groupId> - <artifactId>hamcrest-core</artifactId> + <artifactId>hamcrest-library</artifactId> <version>1.3</version> <scope>test</scope> </dependency> <dependency> - <groupId>org.powermock</groupId> - <artifactId>powermock-api-mockito</artifactId> - <version>1.4.12</version> - <scope>test</scope> - </dependency> - <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> <version>1.9.5</version> <scope>test</scope> </dependency> <dependency> - <groupId>javax.jcr</groupId> - <artifactId>jcr</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.sling</groupId> - <artifactId>org.apache.sling.auth.core</artifactId> - <version>1.3.24</version> - <scope>test</scope> - </dependency> - <dependency> <groupId>org.apache.sling</groupId> - <artifactId>org.apache.sling.engine</artifactId> - <version>2.6.6</version> + <artifactId>org.apache.sling.validation.test-services</artifactId> + <version>1.0.1-SNAPSHOT</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.sling</groupId> - <artifactId>org.apache.sling.validation.test-services</artifactId> - <version>1.0.1-SNAPSHOT</version> + <artifactId>org.apache.sling.testing.clients</artifactId> + <version>1.1.4</version> <scope>test</scope> </dependency> <dependency> @@ -237,74 +274,11 @@ <artifactId>slf4j-simple</artifactId> <scope>test</scope> </dependency> - - <!-- Apache Felix --> - <dependency> - <groupId>org.apache.felix</groupId> - <artifactId>org.apache.felix.framework</artifactId> - <version>5.6.2</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.sling</groupId> - <artifactId>org.apache.sling.testing.paxexam</artifactId> - <version>0.0.4</version> - <scope>test</scope> - </dependency> - <dependency> + <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.commons.johnzon</artifactId> <version>1.0.0</version> <scope>provided</scope> </dependency> - <dependency> - <groupId>org.apache.sling</groupId> - <artifactId>org.apache.sling.testing.tools</artifactId> - <!-- we need the latest snapshot due to switch to commons-johnzon in https://github.com/apache/sling-old-svn-mirror/commit/862cf2c34e306ac52e8b27fc62a0a5a5458e94c1#diff-80bdb2d8d02d199be853b4a26d559391 --> - <version>1.0.17-SNAPSHOT</version> - <scope>test</scope> - </dependency> - <!-- testing --> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.servicemix.bundles</groupId> - <artifactId>org.apache.servicemix.bundles.hamcrest</artifactId> - <version>1.3_1</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.ops4j.pax.exam</groupId> - <artifactId>pax-exam</artifactId> - <version>${org.ops4j.pax.exam.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.ops4j.pax.exam</groupId> - <artifactId>pax-exam-cm</artifactId> - <version>${org.ops4j.pax.exam.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.ops4j.pax.exam</groupId> - <artifactId>pax-exam-container-forked</artifactId> - <version>${org.ops4j.pax.exam.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.ops4j.pax.exam</groupId> - <artifactId>pax-exam-junit4</artifactId> - <version>${org.ops4j.pax.exam.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.ops4j.pax.exam</groupId> - <artifactId>pax-exam-link-mvn</artifactId> - <version>${org.ops4j.pax.exam.version}</version> - <scope>test</scope> - </dependency> </dependencies> </project> diff --git a/src/test/java/org/apache/sling/validation/impl/it/tests/ValidationServiceIT.java b/src/test/java/org/apache/sling/validation/impl/it/tests/ValidationServiceIT.java index 42c98b6..5f3bd42 100644 --- a/src/test/java/org/apache/sling/validation/impl/it/tests/ValidationServiceIT.java +++ b/src/test/java/org/apache/sling/validation/impl/it/tests/ValidationServiceIT.java @@ -18,77 +18,75 @@ */ package org.apache.sling.validation.impl.it.tests; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + import java.io.IOException; import java.io.StringReader; +import java.net.URI; +import java.util.Collections; +import java.util.concurrent.TimeoutException; import javax.json.Json; import javax.json.JsonException; import javax.json.JsonObject; -import org.apache.http.entity.mime.MultipartEntity; +import org.apache.http.Header; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.mime.MultipartEntityBuilder; import org.apache.http.entity.mime.content.StringBody; -import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.message.BasicHeader; import org.apache.sling.servlets.post.SlingPostConstants; -import org.apache.sling.testing.tools.http.RequestBuilder; -import org.apache.sling.testing.tools.http.RequestExecutor; -import org.junit.Before; +import org.apache.sling.testing.clients.ClientException; +import org.apache.sling.testing.clients.SlingHttpResponse; +import org.apache.sling.testing.clients.osgi.OsgiConsoleClient; +import org.apache.sling.validation.testservices.internal.ValidationPostOperation; +import org.junit.BeforeClass; import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; -import org.ops4j.pax.exam.spi.reactors.PerClass; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; /** * These tests leverage the {@link ValidationPostOperation} to validate the given request parameters. * The according validation model enforces the properties "field1" matching regex=^\\\p{Upper}+$ and "field2" (having an arbitrary value). * */ -@RunWith(PaxExam.class) -@ExamReactorStrategy(PerClass.class) -public class ValidationServiceIT extends ValidationTestSupport { - - protected DefaultHttpClient defaultHttpClient; +public class ValidationServiceIT { - protected RequestExecutor requestExecutor; + private static OsgiConsoleClient slingClient; - @Before - public void setup() throws IOException { - defaultHttpClient = new DefaultHttpClient(); - requestExecutor = new RequestExecutor(defaultHttpClient); + @BeforeClass + public static void setupOnce() throws IOException, ClientException, TimeoutException, InterruptedException { + URI uri = URI.create(String.format("http://localhost:%s", Integer.getInteger("http.port"))); + slingClient = new OsgiConsoleClient(uri, "admin", "admin"); + // wait until the model from the validation.test-services bundle has been deployed + slingClient.waitExists("/apps/sling/validation/models/model1", 20000, 200); + + // also wait for the test-services to be active, see https://issues.apache.org/jira/browse/SLING-7297 + // we cannot explicitly wait for that, but waiting until the bundle has been started should be enough here + slingClient.waitStartBundle("org.apache.sling.validation.test-services", 10000, 100); } @Test - public void testValidRequestModel1() throws IOException, JsonException { - final String url = String.format("http://localhost:%s", httpPort()); - final RequestBuilder requestBuilder = new RequestBuilder(url); - MultipartEntity entity = new MultipartEntity(); - entity.addPart("sling:resourceType", new StringBody("validation/test/resourceType1")); - entity.addPart("field1", new StringBody("HELLOWORLD")); - entity.addPart("field2", new StringBody("30.01.1988")); - entity.addPart(SlingPostConstants.RP_OPERATION, new StringBody("validation")); - RequestExecutor re = requestExecutor.execute(requestBuilder.buildPostRequest - ("/validation/testing/fakeFolder1/resource").withEntity(entity)).assertStatus(200); - String content = re.getContent(); - JsonObject jsonResponse = Json.createReader(new StringReader(content)).readObject(); + public void testValidRequestModel1() throws IOException, JsonException, ClientException { + MultipartEntityBuilder entityBuilder = MultipartEntityBuilder.create(); + entityBuilder.addPart("sling:resourceType", new StringBody("validation/test/resourceType1", ContentType.DEFAULT_TEXT)); + entityBuilder.addPart("field1", new StringBody("HELLOWORLD", ContentType.DEFAULT_TEXT)); + entityBuilder.addPart("field2", new StringBody("30.01.1988", ContentType.DEFAULT_TEXT)); + entityBuilder.addPart(SlingPostConstants.RP_OPERATION, new StringBody("validation", ContentType.DEFAULT_TEXT)); + SlingHttpResponse response = slingClient.doPost("/validation/testing/fakeFolder1/resource", entityBuilder.build(), null, 200); + JsonObject jsonResponse = Json.createReader(new StringReader(response.getContent())).readObject(); assertTrue(jsonResponse.getBoolean("valid")); } @Test - public void testInvalidRequestModel1() throws IOException, JsonException { - MultipartEntity entity = new MultipartEntity(); - entity.addPart("sling:resourceType", new StringBody("validation/test/resourceType1")); - entity.addPart("field1", new StringBody("Hello World")); - entity.addPart(SlingPostConstants.RP_OPERATION, new StringBody("validation")); - final String url = String.format("http://localhost:%s", httpPort()); - RequestBuilder requestBuilder = new RequestBuilder(url); - RequestExecutor re = requestExecutor.execute(requestBuilder.buildPostRequest - ("/validation/testing/fakeFolder1/resource").withEntity(entity)).assertStatus(200); - String content = re.getContent(); - JsonObject jsonResponse = Json.createReader(new StringReader(content)).readObject(); + public void testInvalidRequestModel1() throws IOException, JsonException, ClientException { + MultipartEntityBuilder entityBuilder = MultipartEntityBuilder.create(); + entityBuilder.addPart("sling:resourceType", new StringBody("validation/test/resourceType1", ContentType.DEFAULT_TEXT)); + entityBuilder.addPart("field1", new StringBody("Hello World", ContentType.DEFAULT_TEXT)); + entityBuilder.addPart(SlingPostConstants.RP_OPERATION, new StringBody("validation", ContentType.DEFAULT_TEXT)); + SlingHttpResponse response = slingClient.doPost("/validation/testing/fakeFolder1/resource", entityBuilder.build(), null, 200); + JsonObject jsonResponse = Json.createReader(new StringReader(response.getContent())).readObject(); assertFalse(jsonResponse.getBoolean("valid")); JsonObject failure = jsonResponse.getJsonArray("failures").getJsonObject(0); assertEquals("Property does not match the pattern \"^\\p{Upper}+$\".", failure.getString("message")); @@ -99,20 +97,15 @@ public class ValidationServiceIT extends ValidationTestSupport { assertEquals("", failure.getString("location")); // location is empty as the property is not found (property name is part of the message rather) assertEquals(0, failure.getInt("severity")); } - + @Test - public void testPostProcessorWithInvalidModel() throws IOException, JsonException { - MultipartEntity entity = new MultipartEntity(); - entity.addPart("sling:resourceType", new StringBody("validation/test/resourceType1")); - entity.addPart("field1", new StringBody("Hello World")); - final String url = String.format("http://localhost:%s", httpPort()); - RequestBuilder requestBuilder = new RequestBuilder(url); - // test JSON response, because the HTML response overwrites the original exception (https://issues.apache.org/jira/browse/SLING-6703) - RequestExecutor re = requestExecutor.execute(requestBuilder.buildPostRequest - ("/content/validated/invalidresource").withEntity(entity).withHeader("Accept", "application/json").withCredentials("admin", "admin")).assertStatus(500); - String content = re.getContent(); - JsonObject jsonResponse = Json.createReader(new StringReader(content)).readObject(); - + public void testPostProcessorWithInvalidModel() throws IOException, JsonException, ClientException { + MultipartEntityBuilder entityBuilder = MultipartEntityBuilder.create(); + entityBuilder.addPart("sling:resourceType", new StringBody("validation/test/resourceType1", ContentType.DEFAULT_TEXT)); + entityBuilder.addPart("field1", new StringBody("Hello World", ContentType.DEFAULT_TEXT)); + Header header = new BasicHeader("Accept", "application/json"); + SlingHttpResponse response = slingClient.doPost("/content/validated/invalidresource", entityBuilder.build(), Collections.singletonList(header), 500); + JsonObject jsonResponse = Json.createReader(new StringReader(response.getContent())).readObject(); JsonObject error = jsonResponse.getJsonObject("error"); assertEquals("org.apache.sling.validation.impl.postprocessor.InvalidResourcePostProcessorException", error.getString("class")); assertEquals("Validation errors: field1 : Property does not match the pattern \"^\\p{Upper}+$\"., Missing required property with name \"field2\".", error.getString("message")); diff --git a/src/test/java/org/apache/sling/validation/impl/it/tests/ValidationTestSupport.java b/src/test/java/org/apache/sling/validation/impl/it/tests/ValidationTestSupport.java deleted file mode 100644 index ced5b92..0000000 --- a/src/test/java/org/apache/sling/validation/impl/it/tests/ValidationTestSupport.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * 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.validation.impl.it.tests; - -import javax.inject.Inject; - -import org.apache.sling.api.servlets.ServletResolver; -import org.apache.sling.auth.core.AuthenticationSupport; -import org.apache.sling.engine.SlingRequestProcessor; -import org.apache.sling.resource.presence.ResourcePresence; -import org.apache.sling.testing.paxexam.TestSupport; -import org.apache.sling.validation.ValidationService; -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.util.Filter; -import org.ops4j.pax.exam.util.PathUtils; - -import static org.apache.sling.testing.paxexam.SlingOptions.slingExtensionI18n; -import static org.apache.sling.testing.paxexam.SlingOptions.slingExtensionResourcePresence; -import static org.apache.sling.testing.paxexam.SlingOptions.slingInstallerProviderJcr; -import static org.apache.sling.testing.paxexam.SlingOptions.slingLaunchpadOakTar; -import static org.ops4j.pax.exam.CoreOptions.composite; -import static org.ops4j.pax.exam.CoreOptions.junitBundles; -import static org.ops4j.pax.exam.CoreOptions.mavenBundle; -import static org.ops4j.pax.exam.CoreOptions.systemProperty; -import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.factoryConfiguration; -import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.newConfiguration; - -public class ValidationTestSupport extends TestSupport { - - @Inject - protected ServletResolver servletResolver; - - @Inject - protected SlingRequestProcessor slingRequestProcessor; - - @Inject - protected AuthenticationSupport authenticationSupport; - - @Inject - protected ValidationService validationService; - - @Inject - @Filter(value = "(path=/apps/sling/validation/models/model1)") - protected ResourcePresence models; - - @Configuration - public Option[] configuration() { - return new Option[]{ - baseConfiguration(), - launchpad(), - // Sling Validation - testBundle("bundle.filename"), - mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.validation.api").versionAsInProject(), - mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.validation.test-services").versionAsInProject(), - factoryConfiguration("org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended") - .put("user.mapping", new String[]{ - "org.apache.sling.validation.core=sling-validation", - "org.apache.sling.validation.test-services=sling-validation" - }) - .asOption(), - // configure post processor - newConfiguration("org.apache.sling.validation.impl.postprocessor.ValidationPostProcessor") - .put("enabledForPathPrefix", new String[] {"/content/validated"}) - .put("failForMissingValidationModels", Boolean.TRUE) - .asOption(), - // testing - mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.testing.tools").versionAsInProject(), - mavenBundle().groupId("org.apache.servicemix.bundles").artifactId("org.apache.servicemix.bundles.hamcrest").versionAsInProject(), - factoryConfiguration("org.apache.sling.resource.presence.internal.ResourcePresenter") - .put("path", "/apps/sling/validation/models/model1") - .asOption(), - junitBundles(), - logging() - }; - } - - protected Option launchpad() { - final int httpPort = findFreePort(); - final String workingDirectory = workingDirectory(); - return composite( - slingLaunchpadOakTar(workingDirectory, httpPort), - slingExtensionI18n(), - slingExtensionResourcePresence(), - slingInstallerProviderJcr(), - mavenBundle().groupId("org.apache.commons").artifactId("commons-collections4").versionAsInProject(), - mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.commons.johnzon").versionAsInProject() - ); - } - - protected Option logging() { - final String filename = String.format("file:%s/src/test/resources/logback.xml", PathUtils.getBaseDir()); - return composite( - systemProperty("logback.configurationFile").value(filename), - mavenBundle().groupId("org.slf4j").artifactId("slf4j-api").version("1.7.21"), - mavenBundle().groupId("org.slf4j").artifactId("jcl-over-slf4j").version("1.7.21"), - mavenBundle().groupId("ch.qos.logback").artifactId("logback-core").version("1.1.7"), - mavenBundle().groupId("ch.qos.logback").artifactId("logback-classic").version("1.1.7") - ); - } - -} diff --git a/src/test/provisioning/model.txt b/src/test/provisioning/model.txt new file mode 100644 index 0000000..2fad2bd --- /dev/null +++ b/src/test/provisioning/model.txt @@ -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. +# +[feature name=validation.core.it] +# Dependencies +[artifacts] + org.apache.sling/org.apache.sling.launchpad/9/slingstart + # deploy the to-be-tested bundle as well + org.apache.sling/org.apache.sling.validation.core/1.0.1-SNAPSHOT + # deploy an additional bundle which contains some server-side test classes and content + org.apache.sling/org.apache.sling.validation.test-services/1.0.1-SNAPSHOT + +[configurations] + # configure service user mapping for validation framework + org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-validation + user.mapping=[ \ + "org.apache.sling.validation.core\=sling-validation", \ + "org.apache.sling.validation.test-services\=sling-validation" \ + ] + + # configure post processor + org.apache.sling.validation.impl.postprocessor.ValidationPostProcessor + enabledForPathPrefix=["/content/validated"] + failForMissingValidationModel=B"true" + +[settings] + org.apache.sling.commons.log.julenabled=true diff --git a/src/test/resources/exam.properties b/src/test/resources/exam.properties deleted file mode 100644 index c98a668..0000000 --- a/src/test/resources/exam.properties +++ /dev/null @@ -1,19 +0,0 @@ -# -# 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. -# -pax.exam.logging=none diff --git a/src/test/resources/logback.xml b/src/test/resources/logback.xml deleted file mode 100644 index 699879a..0000000 --- a/src/test/resources/logback.xml +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - 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. ---> -<configuration> - <appender name="file" class="ch.qos.logback.core.FileAppender"> - <file>target/testing.log</file> - <encoder> - <pattern>%date %level [%thread] %logger{10} [%file : %line] %msg%n</pattern> - </encoder> - </appender> - <logger name="org.apache.sling.validation" level="DEBUG"/> - - <root level="INFO"> - <appender-ref ref="file"/> - </root> -</configuration> -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
