This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-jxpath.git
commit 1eca05388a580d208b2dcef9be277b8725fcdb4c Author: Gary D. Gregory <garydgreg...@gmail.com> AuthorDate: Sat Apr 12 08:48:34 2025 -0400 Simplify test --- .../org/apache/commons/jxpath/util/ClassLoaderUtilTest.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/test/java/org/apache/commons/jxpath/util/ClassLoaderUtilTest.java b/src/test/java/org/apache/commons/jxpath/util/ClassLoaderUtilTest.java index 6f70b18..4bcc4ef 100644 --- a/src/test/java/org/apache/commons/jxpath/util/ClassLoaderUtilTest.java +++ b/src/test/java/org/apache/commons/jxpath/util/ClassLoaderUtilTest.java @@ -19,7 +19,6 @@ package org.apache.commons.jxpath.util; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.lang.reflect.InvocationTargetException; @@ -65,7 +64,7 @@ public class ClassLoaderUtilTest { byte[] clazzBytes; try { clazzBytes = IOUtils.toByteArray(classUrl); - } catch (IOException e) { + } catch (final IOException e) { throw new ClassNotFoundException(classUrl.toString(), e); } this.testCaseClass = this.defineClass(TEST_CASE_CLASS_NAME, clazzBytes, 0, clazzBytes.length); @@ -96,13 +95,7 @@ public class ClassLoaderUtilTest { */ public static void callExampleMessageMethodAndAssertSuccess() { final JXPathContext context = JXPathContext.newContext(new Object()); - Object value; - try { - value = context.selectSingleNode(EXAMPLE_CLASS_NAME + ".getMessage()"); - assertEquals("an example class", value); - } catch (final Exception e) { - fail(e.getMessage()); - } + assertEquals("an example class", context.selectSingleNode(EXAMPLE_CLASS_NAME + ".getMessage()")); } private ClassLoader orginalContextClassLoader;