jkesselm commented on code in PR #1:
URL: https://github.com/apache/xalan-test/pull/1#discussion_r1189171486


##########
tests/bugzilla/Bugzilla1266.java:
##########
@@ -74,52 +94,58 @@ public void execute(Datalet d)
         Templates templates = null;
         Transformer transformer = null;
         try
-        {
-            factory = TransformerFactory.newInstance();
-            logger.logMsg(Logger.STATUSMSG, "About to factory.newTemplates(" + 
QetestUtils.filenameToURL("identity.xsl") + ")");
-            templates = factory.newTemplates(new 
StreamSource(QetestUtils.filenameToURL("identity.xsl")));
-            transformer = templates.newTransformer();
-
-            // Set the errorListener and validate it
-            transformer.setErrorListener(loggingErrorListener);
-            if (transformer.getErrorListener() == loggingErrorListener)
-                logger.checkPass("set/getErrorListener on transformer");
-            else
-                logger.checkFail("set/getErrorListener on transformer");
-
-            logger.logMsg(Logger.STATUSMSG, "Reproduce Bugzilla1266 - warning 
due to bad output props not propagated");
-            logger.logMsg(Logger.STATUSMSG, 
"transformer.setOutputProperty(encoding, illegal-encoding-value)");
-            transformer.setOutputProperty("encoding", 
"illegal-encoding-value");
-
-            logger.logMsg(Logger.STATUSMSG, "about to transform(...)");
-            transformer.transform(new 
StreamSource(QetestUtils.filenameToURL("identity.xml")), 
-                                  new StreamResult("Bugzilla1266.out"));
-            logger.logMsg(Logger.STATUSMSG, "after transform(...)");
-            logger.logMsg(Logger.STATUSMSG, "loggingErrorListener after 
transform:" + loggingErrorListener.getQuickCounters());
-
-            // Validate that one warning (about illegal-encoding-value) should 
have been reported
-            int[] errCtr = loggingErrorListener.getCounters();
-            if (errCtr[LoggingErrorListener.TYPE_WARNING] > 0)
-                logger.checkPass("At least one Warning listned to for 
illegal-encoding-value");
-            else
-                logger.checkFail("At least one Warning listned to for 
illegal-encoding-value");
+            {
+                factory = TransformerFactory.newInstance();
+                logger.logMsg(Logger.STATUSMSG, "About to 
factory.newTemplates(" + QetestUtils.filenameToURL("identity.xsl") + ")");
+                templates = factory.newTemplates(new 
StreamSource(QetestUtils.filenameToURL("identity.xsl")));
+                transformer = templates.newTransformer();
+
+                // Set the errorListener and validate it
+                transformer.setErrorListener(loggingErrorListener);
+                if (transformer.getErrorListener() == loggingErrorListener)
+                    logger.checkPass("set/getErrorListener on transformer");
+                else {
+                    logger.checkFail("set/getErrorListener on transformer");
+                   throw new Exception("failed set/getErrorListener on 
transformer");
+                }
+
+                logger.logMsg(Logger.STATUSMSG, "Reproduce Bugzilla1266 - 
warning due to bad output props not propagated");
+                logger.logMsg(Logger.STATUSMSG, 
"transformer.setOutputProperty(encoding, illegal-encoding-value)");
+                transformer.setOutputProperty("encoding", 
"illegal-encoding-value");
+
+                logger.logMsg(Logger.STATUSMSG, "about to transform(...)");
+                transformer.transform(new 
StreamSource(QetestUtils.filenameToURL("identity.xml")), 
+                                      new StreamResult("Bugzilla1266.out"));
+                logger.logMsg(Logger.STATUSMSG, "after transform(...)");
+                logger.logMsg(Logger.STATUSMSG, "loggingErrorListener after 
transform:" + loggingErrorListener.getQuickCounters());
+
+                // Validate that one warning (about illegal-encoding-value) 
should have been reported
+                int[] errCtr = loggingErrorListener.getCounters();
+                            
+                if (errCtr[LoggingErrorListener.TYPE_WARNING] > 0)
+                    logger.checkPass("At least one Warning listned to for 
illegal-encoding-value");
+                else {
+                    logger.checkFail("No Warning reported by listener for 
illegal-encoding-value");
+                   throw new Exception("No Warning reported by listener for 
illegal-encoding-value");
+                }
                 
-            // Validate the actual output file as well: in this case, 
-            //  the stylesheet should still work
-            CheckService fileChecker = new XHTFileCheckService();
-            fileChecker.check(logger, 
-                    new File("Bugzilla1266.out"), 
-                    new File("identity.gold"), 
-                    "transform of good xsl w/bad output props into: " + 
"Bugzilla1266.out");
+                // Validate the actual output file as well: in this case, 
+                //  the stylesheet should still work
+                CheckService fileChecker = new XHTFileCheckService();
+                fileChecker.check(logger, 
+                                  new File("Bugzilla1266.out"), 

Review Comment:
   One common indentation style for multi-line parameters, as seen earlier in 
the transformer.transform() call, is to align the parameters. As seen in the 
web view of this comment, that is in fact what's happening. Indentation has 
been done with spaces rather than tabs (safer when some editors allow setting 
the tab stops), but the style is consistent; I'm not sure why you're flagging 
this one. Clarify, please?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@xalan.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@xalan.apache.org
For additional commands, e-mail: dev-h...@xalan.apache.org

Reply via email to