[2/2] struts git commit: WW-2561 Throws a Struts exception when there is a bad character in template

2016-11-13 Thread lukaszlenart
WW-2561 Throws a Struts exception when there is a bad character in template


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/ef2939ff
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/ef2939ff
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/ef2939ff

Branch: refs/heads/master
Commit: ef2939ffd0663f8a5d86fafa105deb7183e2ac2d
Parents: 8aba301
Author: Lukasz Lenart 
Authored: Sun Nov 13 11:16:40 2016 +0100
Committer: Lukasz Lenart 
Committed: Sun Nov 13 11:16:40 2016 +0100

--
 .../apache/struts2/views/xslt/XSLTResult.java   | 42 ++--
 .../struts2/views/xslt/XSLTResultTest.java  | 13 +-
 .../resources/XSLTResultTest.bad.character.xsl  | 30 ++
 3 files changed, 61 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/struts/blob/ef2939ff/core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java
--
diff --git a/core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java 
b/core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java
index 5dfd5fb..fb5068c 100644
--- a/core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java
+++ b/core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java
@@ -1,6 +1,4 @@
 /*
- * $Id$
- *
  * 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
@@ -330,26 +328,7 @@ public class XSLTResult implements Result {
 transformer = 
TransformerFactory.newInstance().newTransformer();
 
 transformer.setURIResolver(getURIResolver());
-transformer.setErrorListener(new ErrorListener() {
-
-public void error(TransformerException exception)
-throws TransformerException {
-throw new StrutsException("Error transforming result", 
exception);
-}
-
-public void fatalError(TransformerException exception)
-throws TransformerException {
-throw new StrutsException("Fatal error transforming 
result", exception);
-}
-
-public void warning(TransformerException exception)
-throws TransformerException {
-if (LOG.isWarnEnabled()) {
-   LOG.warn(exception.getMessage(), exception);
-}
-}
-
-});
+transformer.setErrorListener(buildErrorListener());
 
 String mimeType;
 if (templates == null)
@@ -385,6 +364,24 @@ public class XSLTResult implements Result {
 }
 }
 
+protected ErrorListener buildErrorListener() {
+return new ErrorListener() {
+
+public void error(TransformerException exception) throws 
TransformerException {
+throw new StrutsException("Error transforming result", 
exception);
+}
+
+public void fatalError(TransformerException exception) throws 
TransformerException {
+throw new StrutsException("Fatal error transforming result", 
exception);
+}
+
+public void warning(TransformerException exception) throws 
TransformerException {
+LOG.warn(exception.getMessage(), exception);
+}
+
+};
+}
+
 protected AdapterFactory getAdapterFactory() {
 if (adapterFactory == null)
 adapterFactory = new AdapterFactory();
@@ -422,6 +419,7 @@ public class XSLTResult implements Result {
 
 TransformerFactory factory = TransformerFactory.newInstance();
 factory.setURIResolver(getURIResolver());
+factory.setErrorListener(buildErrorListener());
 templates = factory.newTemplates(new 
StreamSource(resource.openStream()));
 templatesCache.put(path, templates);
 }

http://git-wip-us.apache.org/repos/asf/struts/blob/ef2939ff/core/src/test/java/org/apache/struts2/views/xslt/XSLTResultTest.java
--
diff --git 
a/core/src/test/java/org/apache/struts2/views/xslt/XSLTResultTest.java 
b/core/src/test/java/org/apache/struts2/views/xslt/XSLTResultTest.java
index d1ad400..3e8c7f1 100644
--- a/core/src/test/java/org/apache/struts2/views/xslt/XSLTResultTest.java
+++ b/core/src/test/java/org/apache/struts2/views/xslt/XSLTResultTest.java
@@ -1,6 +1,4 @@
 /*
- * $Id$
- *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional inform

[1/2] struts git commit: WW-2454 Upgrades TestNG to latest 5.x version

2016-11-13 Thread lukaszlenart
Repository: struts
Updated Branches:
  refs/heads/master e1e2ea84a -> ef2939ffd


WW-2454 Upgrades TestNG to latest 5.x version


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/8aba301d
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/8aba301d
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/8aba301d

Branch: refs/heads/master
Commit: 8aba301da08ca056199fa313e419bd4828961c79
Parents: e1e2ea8
Author: Lukasz Lenart 
Authored: Sat Nov 12 18:09:10 2016 +0100
Committer: Lukasz Lenart 
Committed: Sat Nov 12 18:09:10 2016 +0100

--
 core/pom.xml | 1 -
 pom.xml  | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/struts/blob/8aba301d/core/pom.xml
--
diff --git a/core/pom.xml b/core/pom.xml
index e3dd236..5790faa 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -409,7 +409,6 @@
 testng
 compile
 true
-jdk15
 
 
 

http://git-wip-us.apache.org/repos/asf/struts/blob/8aba301d/pom.xml
--
diff --git a/pom.xml b/pom.xml
index b7b10dd..b120f6c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -869,10 +869,9 @@
 
 org.testng
 testng
-5.1
+5.14.10
 compile
 true
-jdk15