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 2019/06/13 09:37:11 UTC

[sling-whiteboard] 02/08: Simplify output parsing logic

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

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

commit c45de91c13b23d763c4b6e3bb714f8db88a998d1
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Wed Jun 12 16:52:38 2019 +0200

    Simplify output parsing logic
---
 .../src/test/java/org/apache/sling/uca/impl/AgentIT.java             | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/url-connection-agent/src/test/java/org/apache/sling/uca/impl/AgentIT.java b/url-connection-agent/src/test/java/org/apache/sling/uca/impl/AgentIT.java
index 8ea2b52..7a6c0bc 100644
--- a/url-connection-agent/src/test/java/org/apache/sling/uca/impl/AgentIT.java
+++ b/url-connection-agent/src/test/java/org/apache/sling/uca/impl/AgentIT.java
@@ -147,7 +147,7 @@ public class AgentIT {
             throw new RuntimeException("Command terminated successfully. That is unexpected.");
         } else {
             return Files.lines(STDERR)
-                .filter( l -> l.startsWith("Exception in thread \"main\""))
+                .filter( l -> l.startsWith(EXCEPTION_MARKER))
                 .map( l -> newRecordedThrowable(l) )
                 .findFirst()
                 .orElseThrow(() -> new RuntimeException("Exit code was zero but did not find any exception information in stderr.txt"));
@@ -205,9 +205,6 @@ public class AgentIT {
 
     private RecordedThrowable newRecordedThrowable(String line) {
         
-        if ( !line.startsWith(EXCEPTION_MARKER) )
-            return null;
-     
         line = line.replace(EXCEPTION_MARKER, "");
 
         String className = line.substring(0, line.indexOf(':'));