You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:55:41 UTC
[sling-org-apache-sling-models-api] annotated tag
org.apache.sling.models.api-1.3.2 created (now 3e99427)
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a change to annotated tag org.apache.sling.models.api-1.3.2
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-models-api.git.
at 3e99427 (tag)
tagging 273c3cdb6e81064bbde5b35680ef1c6f9378bb7d (commit)
by Stefan Seifert
on Mon Dec 19 09:12:33 2016 +0000
- Log -----------------------------------------------------------------
org.apache.sling.models.api-1.3.2
-----------------------------------------------------------------------
This annotated tag includes the following new commits:
new ec1ba92 SLING-3313 - adding initial version of Sling Models (nee YAMF)
new 7927f09 set svn:ignore
new 3d1d240 trivial change
new 45329bf [maven-release-plugin] prepare release org.apache.sling.models.api-1.0.0
new a50b83e [maven-release-plugin] prepare for next development iteration
new ae66b2b Update to parent pom v19
new 1e5625a SLING-3499 - adding support for custom annotation per injector (thanks Konrad Windszus for the patch!)
new d2fec0e SLING-3683 - breaking apart annotation processor factory selection from injector selection
new 3e99fd3 SLING-3696 - adding support for defining a default injection strategy of required or optional. Also adding a @Required annotation
new 0fec2aa [maven-release-plugin] prepare release org.apache.sling.models.api-1.0.2
new d9ac6ff [maven-release-plugin] prepare for next development iteration
new e442e40 Updated to parent version 20
new 58c47dd SLING-3716 SLING-3718 - adding support for constructor injection and self injection based on a patch from Stefan Seifert
new 27a5d46 SLING-3861 - adding condition option for @Model annotation
new 459c12d SLING-3869 - fixing branding issues with Sling Models. Thanks to Stefan Seifert for the patch!
new 037bb9e SLING-3877 - adding a resource path injector. also did some minor refactoring to avoid code duplication between injectors.
new 40eaf4e SLING-3715 - adding sling object injector. Thanks to Stefan for the patch!
new 85dbcb5 SLING-3879 - fixing NPE in PathInjector. Thanks Stefan for the patch!
new 1df4b0e SLING-3886 - adding support for adapter indirection where the adapting target is a superclass or implemented interface of the implementation class. Thanks to Stefan for the patch!
new b542260 [maven-release-plugin] prepare release org.apache.sling.models.api-1.1.0
new a78a0fc [maven-release-plugin] prepare for next development iteration
new 656d300 SLING-3911 - fixing issue where empty or wrong arrays are specified for default values
new 823e30d fix javadoc syntax error
new b68c19d fix invalid svn url
new 007d78c Update to Sling Parent POM 22 with baselining enabled
new 765c7f8 SLING-3709 - introduce new ModelFactory service interface which throws various exceptions based on failure conditions. Thanks to Konrad Windszus for the original patch!
new d501119 SLING-3709 - adding additional testing for missing elements and post construct failures
new bc02ffd SLING-4055 "Model" annotation should be @Documented
new 572b525 SLING-4057 ModelFactory: Ordering of method arguments inconsistent
new 727a0e8 move detailed JavaDoc description of SlingObject injector support to annotation, because this is what's usually only included as dependency in the projects
new c5b00fa SLING-4083 Enable SlingObject injector to inject all context objects when a request is attached to the current thread
new 964c994 SLING-4056 ModelFactory.canCreateFromAdaptable reports false errors when using "adapters" on models (patch suppplied by Konrad Windszus)
new 562c886 SLING-4083 revert all changes from trunk, copied to branch https://svn.apache.org/repos/asf/sling/whiteboard/sseifert/SLING-4083_models_slingobject_threadlocal
new ba862da SLING-4112 Sling Models: Optimize performance when read sling models annotations
new 7884144 SLING-4155, consider default injection strategy also for injector-specific annotations
new 15a96b1 SLING-4155 deprecate InjectAnnotationProcessorFactory as well
new 0513619 SLING-4161 support Sling Validation by a new field on the Model annotation
new 8af24e7 SLING-4112 fix typo in javadoc
new 938ee41 eliminate deprecation warnings by adding @SuppressWarning annotations
new 3f55c81 SLING-4212 Sling Models: Allow multiple values from ValueMap in the resource-path injector (applied patch by santiago garcĂa pimentel with some modifications)
new 00802f0 SLING-4698 - Set parent.relativePath to empty for all modules
new 7590532 SLING-4710 do not export javax.inject in sling models API bundle add javax.inject dependency in launchpad from org.apache.geronimo.specs/geronimo-atinject_1.0_spec/1.0 because the original javax.inject jar is not an osgi bundle
new be8063c SLING-4155 fix typo in annotation property: injectonStrategy => injectionStrategy
new 2bf803b SLING-3709 improve exception handling by using dedicated exception classes instead of the one global result object
new de6f3c0 fix typo
new 97b2004 SLING-4737 add JSR305 annotations
new 9b47c08 SLING-4737 add missing JSR 305 annotations
new 236a97c SLING-4767
new ee84ecc SLING-4767 clarify javadoc around PostConstructException
new f817ebe SLING-4161 move validation to separate bundle
new 6d039e3 remove some unused imports
new 2948ba2 fix javadoc errors so java 8 is not complaining
new ca544cc [maven-release-plugin] prepare release org.apache.sling.models.api-1.2.0
new f86f61e [maven-release-plugin] prepare for next development iteration
new 270a10c Update to Sling Parent 23
new 1d1ab42 Remove superflous sling.java.version=6 as it's the default now
new a807f07 set parent version to 24 and add empty relativePath where missing
new 067c92a SLING-4997 add new method isModelClass and deprecate the old one
new e910706 SLING-4997 mark ModelFactory as ProviderType and lower package version to 1.1
new 8842257 SLING-5013 add @ProviderType to API classes/interfaces and @ConsumerType to SPI classes/interfaces
new 9b53403 SLING-5013 add @ProviderType to API classes/interfaces and @ConsumerType to SPI classes/interfaces
new c328638 fix javadoc errors
new b4d4925 [maven-release-plugin] prepare release org.apache.sling.models.api-1.2.2
new 18b0da6 [maven-release-plugin] prepare for next development iteration
new d0fb449 Update the main reactor to parent 25
new 40eade3 Switch to parent pom 26
new 1357f70 SLING-5029 - clarify ModelFactory.canCreateFromAdaptable to always return false in case the according adapter factory is not available (for whatever reason)
new 79c6dd8 SLING-5451 mark exported packages explicitly as either provider or consumer type
new 602db9b SLING-5451 revert changes from commit r1726248 as consumer/providers are annotated on class level and this was already done in SLING-5013.
new 523b43b fix javadoc
new 33ab2f8 fix line endings
new d327166 SLING-5992 - Introduce resource type to model class binding
new c64f4f0 cosmetic: eliminate some code warnings (no functional change)
new 06f7281 SLING-6183 - add Sling Model Exporter feature
new 15073a8 [maven-release-plugin] prepare release org.apache.sling.models.api-1.3.0
new 9603c81 [maven-release-plugin] prepare for next development iteration
new 6b521a3 SLING-6369 MissingElementsException should not hide any stack traces of contained exceptions
new a25a6d6 [maven-release-plugin] prepare release org.apache.sling.models.api-1.3.2
new 273c3cd [maven-release-plugin] copy for tag org.apache.sling.models.api-1.3.2
The 79 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.
--
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].
[sling-org-apache-sling-models-api] 03/04: [maven-release-plugin]
prepare release org.apache.sling.models.api-1.3.2
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.models.api-1.3.2
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-models-api.git
commit a25a6d6dfd89d9d0760c0aa9bf3153e2e0cf3edf
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Dec 19 09:12:20 2016 +0000
[maven-release-plugin] prepare release org.apache.sling.models.api-1.3.2
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/api@1775023 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 196 ++++++++++++++++++++++++++++++++--------------------------------
1 file changed, 98 insertions(+), 98 deletions(-)
diff --git a/pom.xml b/pom.xml
index 7591337..74048a7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,98 +1,98 @@
-<?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/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.sling</groupId>
- <artifactId>sling</artifactId>
- <version>26</version>
- <relativePath />
- </parent>
-
- <artifactId>org.apache.sling.models.api</artifactId>
- <packaging>bundle</packaging>
- <version>1.3.1-SNAPSHOT</version>
- <name>Apache Sling Models API</name>
- <description>Apache Sling Models API</description>
- <scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/api</connection>
- <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/api</developerConnection>
- <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/api</url>
- </scm>
-
- <properties>
- <sling.java.version>7</sling.java.version>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-scr-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Export-Package>org.apache.sling.models.*</Export-Package>
- <DynamicImport-Package>org.apache.sling.validation.api.*</DynamicImport-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>javax.inject</groupId>
- <artifactId>javax.inject</artifactId>
- <version>1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>jsr305</artifactId>
- <version>3.0.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.api</artifactId>
- <version>2.2.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </dependency>
- <!-- testing dependencies -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-junit</artifactId>
- <version>2.0.0.0</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
+<?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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>sling</artifactId>
+ <version>26</version>
+ <relativePath />
+ </parent>
+
+ <artifactId>org.apache.sling.models.api</artifactId>
+ <packaging>bundle</packaging>
+ <version>1.3.2</version>
+ <name>Apache Sling Models API</name>
+ <description>Apache Sling Models API</description>
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.api-1.3.2</connection>
+ <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.api-1.3.2</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.models.api-1.3.2</url>
+ </scm>
+
+ <properties>
+ <sling.java.version>7</sling.java.version>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-scr-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Export-Package>org.apache.sling.models.*</Export-Package>
+ <DynamicImport-Package>org.apache.sling.validation.api.*</DynamicImport-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>jsr305</artifactId>
+ <version>3.0.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.api</artifactId>
+ <version>2.2.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+ <!-- testing dependencies -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-junit</artifactId>
+ <version>2.0.0.0</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-models-api] 01/04: [maven-release-plugin]
prepare for next development iteration
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.models.api-1.3.2
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-models-api.git
commit 9603c8180add2d0b06a59918a8170cac5ed6fcc5
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Sun Oct 30 23:47:39 2016 +0000
[maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/api@1767200 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pom.xml b/pom.xml
index da5bece..7da4d5f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,13 +28,13 @@
<artifactId>org.apache.sling.models.api</artifactId>
<packaging>bundle</packaging>
- <version>1.3.0</version>
+ <version>1.3.1-SNAPSHOT</version>
<name>Apache Sling Models API</name>
<description>Apache Sling Models API</description>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.api-1.3.0</connection>
- <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.api-1.3.0</developerConnection>
- <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.models.api-1.3.0</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/api</connection>
+ <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/api</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/api</url>
</scm>
<build>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-models-api] 04/04: [maven-release-plugin]
copy for tag org.apache.sling.models.api-1.3.2
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.models.api-1.3.2
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-models-api.git
commit 273c3cdb6e81064bbde5b35680ef1c6f9378bb7d
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Mon Dec 19 09:12:33 2016 +0000
[maven-release-plugin] copy for tag org.apache.sling.models.api-1.3.2
git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.api-1.3.2@1775024 13f79535-47bb-0310-9956-ffa450edef68
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-models-api] 02/04: SLING-6369
MissingElementsException should not hide any stack traces of contained
exceptions
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.models.api-1.3.2
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-models-api.git
commit 6b521a30e577eb1be430008c48ca65eeafb4bbb1
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Thu Dec 8 13:22:54 2016 +0000
SLING-6369 MissingElementsException should not hide any stack traces of contained exceptions
Rely on suppressed exceptions being introduced with Java7.
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/api@1773229 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 15 ++++++
.../models/factory/MissingElementsException.java | 16 +------
.../apache/sling/models/factory/package-info.java | 2 +-
.../factory/MissingElementsExceptionTest.java | 53 ++++++++++++++++++++++
4 files changed, 71 insertions(+), 15 deletions(-)
diff --git a/pom.xml b/pom.xml
index 7da4d5f..7591337 100644
--- a/pom.xml
+++ b/pom.xml
@@ -37,6 +37,9 @@
<url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/api</url>
</scm>
+ <properties>
+ <sling.java.version>7</sling.java.version>
+ </properties>
<build>
<plugins>
<plugin>
@@ -79,5 +82,17 @@
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
+ <!-- testing dependencies -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-junit</artifactId>
+ <version>2.0.0.0</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
diff --git a/src/main/java/org/apache/sling/models/factory/MissingElementsException.java b/src/main/java/org/apache/sling/models/factory/MissingElementsException.java
index e166847..fe712e8 100644
--- a/src/main/java/org/apache/sling/models/factory/MissingElementsException.java
+++ b/src/main/java/org/apache/sling/models/factory/MissingElementsException.java
@@ -44,21 +44,9 @@ public final class MissingElementsException extends RuntimeException {
missingElements = new ArrayList<MissingElementException>();
}
- @Override
- public String getMessage() {
- StringBuilder message = new StringBuilder(super.getMessage());
- for (MissingElementException e : missingElements) {
- message.append('\n');
- message.append(e.getMessage());
- if (e.getCause() != null) {
- message.append(" caused by ");
- message.append(e.getCause().getMessage());
- }
- }
- return message.toString();
- }
-
public void addMissingElementExceptions(MissingElementException e) {
+ // also add to suppressed list to make sure they appear as well with their full stack traces in the printStackTrace for this throwable
+ addSuppressed(e);
missingElements.add(e);
}
diff --git a/src/main/java/org/apache/sling/models/factory/package-info.java b/src/main/java/org/apache/sling/models/factory/package-info.java
index 8ee2982..2adb00f 100644
--- a/src/main/java/org/apache/sling/models/factory/package-info.java
+++ b/src/main/java/org/apache/sling/models/factory/package-info.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-@Version("1.3.0")
+@Version("1.3.1")
package org.apache.sling.models.factory;
import aQute.bnd.annotation.Version;
\ No newline at end of file
diff --git a/src/test/java/org/apache/sling/models/factory/MissingElementsExceptionTest.java b/src/test/java/org/apache/sling/models/factory/MissingElementsExceptionTest.java
new file mode 100644
index 0000000..1cec82b
--- /dev/null
+++ b/src/test/java/org/apache/sling/models/factory/MissingElementsExceptionTest.java
@@ -0,0 +1,53 @@
+/*
+ * 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.models.factory;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import org.hamcrest.Matchers;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class MissingElementsExceptionTest {
+
+ @Test
+ public void testMissingElementsExceptionStackTraceContainsTracesOfAggregatedExceptions() {
+ MissingElementsException wrapperException = new MissingElementsException("Test wrapper");
+ try {
+ try {
+ throw new IllegalStateException("Root exception");
+ } catch(IllegalStateException rootException) {
+ throw new MissingElementException(null, rootException);
+ }
+ } catch(MissingElementException e) {
+ wrapperException.addMissingElementExceptions(e);
+ }
+
+ // now evaluate exception message
+ Assert.assertThat(wrapperException.getMessage(), Matchers.not(Matchers.containsString("Root Exception")));
+ Assert.assertThat(wrapperException.getMessage(), Matchers.containsString("Test wrapper"));
+
+ // make sure the aggregated exceptions appear in the stack trace
+ StringWriter stringWriter = new StringWriter();
+ wrapperException.printStackTrace(new PrintWriter(stringWriter));
+ Assert.assertThat(stringWriter.toString(), Matchers.containsString("Root exception"));
+ Assert.assertThat(stringWriter.toString(), Matchers.containsString("Test wrapper"));
+ }
+}
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.