summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2021-07-02 09:29:46 +0200
committerSimon Rettberg2021-07-02 09:29:46 +0200
commit1afa3d7713e6b46e66215d71ffb804fb021fcbeb (patch)
tree9a94df8ebfe117ff5a4b1dfd9b98bc83ec56d733
parentFix missing separation in transformation error output (diff)
downloadmaster-sync-shared-1afa3d7713e6b46e66215d71ffb804fb021fcbeb.tar.gz
master-sync-shared-1afa3d7713e6b46e66215d71ffb804fb021fcbeb.tar.xz
master-sync-shared-1afa3d7713e6b46e66215d71ffb804fb021fcbeb.zip
[tests] Print actual output if it doesn't match expected output
-rw-r--r--src/test/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicTestUtils.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/test/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicTestUtils.java b/src/test/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicTestUtils.java
index f162dc1..11f8ee6 100644
--- a/src/test/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicTestUtils.java
+++ b/src/test/java/org/openslx/virtualization/configuration/logic/ConfigurationLogicTestUtils.java
@@ -68,17 +68,23 @@ public class ConfigurationLogicTestUtils
return content;
}
- public static boolean isContentEqual( String content1, String content2 )
+ public static boolean isContentEqual( String expectedContent, String actualContent )
{
- final BufferedReader bfrContent1 = new BufferedReader( new StringReader( content1 ) );
- final BufferedReader bfrContent2 = new BufferedReader( new StringReader( content2 ) );
+ final BufferedReader bfrContent1 = new BufferedReader( new StringReader( expectedContent ) );
+ final BufferedReader bfrContent2 = new BufferedReader( new StringReader( actualContent ) );
final List<String> linesContent1 = bfrContent1.lines().collect( Collectors.toList() );
final List<String> linesContent2 = bfrContent2.lines().collect( Collectors.toList() );
Collections.sort( linesContent1 );
Collections.sort( linesContent2 );
- return linesContent1.equals( linesContent2 );
+ boolean ret = linesContent1.equals( linesContent2 );
+ if ( !ret ) {
+ System.out.println( "----- UNEXPECTED OUTPUT: -------------\n" );
+ System.out.println( actualContent );
+ System.out.println( "--------------------------------------\n" );
+ }
+ return ret;
}
public static String removeSourceFilePaths( String content )