Skip to content

Commit

Permalink
Replaced Assert with SoftAssert to improve test result readability
Browse files Browse the repository at this point in the history
  • Loading branch information
SpencerKwok committed Jul 11, 2024
1 parent 0d3b91c commit 8ad9e8d
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import java.io.File;

import org.testng.Assert;
import org.testng.asserts.SoftAssert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

Expand Down Expand Up @@ -89,12 +89,17 @@ public void testExtensionSchemaValidation(String inputDir, boolean isValid, Stri
try
{
ExtensionSchemaValidationCmdLineApp.parseAndValidateExtensionSchemas(resolverPath, new File(inputPath));
Assert.assertTrue(isValid);
SoftAssert softAssert = new SoftAssert();
softAssert.assertTrue(isValid);
softAssert.assertEquals(null, errorMessage);
softAssert.assertAll();
}
catch (Exception e)
{
Assert.assertTrue(!isValid);
Assert.assertEquals(e.getMessage(), errorMessage);
SoftAssert softAssert = new SoftAssert();
softAssert.assertTrue(!isValid);
softAssert.assertEquals(e.getMessage(), errorMessage);
softAssert.assertAll();
}
}
}

0 comments on commit 8ad9e8d

Please sign in to comment.