diff --git a/src/main/java/com/xceptance/neodymium/util/Neodymium.java b/src/main/java/com/xceptance/neodymium/util/Neodymium.java index 1f841ae1a..dde01bc3f 100644 --- a/src/main/java/com/xceptance/neodymium/util/Neodymium.java +++ b/src/main/java/com/xceptance/neodymium/util/Neodymium.java @@ -396,5 +396,4 @@ public static boolean isSite(String... sites) } return false; } - } diff --git a/src/main/java/com/xceptance/neodymium/util/SelenideAddons.java b/src/main/java/com/xceptance/neodymium/util/SelenideAddons.java index a5bf0e382..bf5793649 100644 --- a/src/main/java/com/xceptance/neodymium/util/SelenideAddons.java +++ b/src/main/java/com/xceptance/neodymium/util/SelenideAddons.java @@ -403,7 +403,6 @@ public static void wrapAssertionError(final Runnable runnable) * @param verticalMovement * The offset for the vertical movement */ - public static void dragAndDrop(SelenideElement elementToMove, int horizontalMovement, int verticalMovement) { // perform drag and drop via the standard Selenium way diff --git a/src/test/java/com/xceptance/neodymium/tests/NeodymiumTestSelfTest.java b/src/test/java/com/xceptance/neodymium/tests/NeodymiumTestSelfTest.java index 2b3adde16..a518c276d 100644 --- a/src/test/java/com/xceptance/neodymium/tests/NeodymiumTestSelfTest.java +++ b/src/test/java/com/xceptance/neodymium/tests/NeodymiumTestSelfTest.java @@ -1,7 +1,6 @@ package com.xceptance.neodymium.tests; import java.lang.reflect.Field; -import java.util.HashMap; import java.util.Map; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.atomic.AtomicInteger; @@ -30,29 +29,18 @@ public void testCheckFailedOneFromOne() throws NoSuchFieldException, SecurityExc public void testCheckFailedOneFromTwo() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { final String errorMessage = "This is RuntimeException 1"; - final Result result = createResult(2, 0, new HashMap() - { - private static final long serialVersionUID = 2L; + final Result result = createResult(2, 0, Map.of(name.getMethodName().concat("1"), new RuntimeException(errorMessage))); - { - this.put(name.getMethodName() + "1", new RuntimeException("This is RuntimeException 1")); - } - }); checkFail(result, 2, 0, 1, errorMessage); } @Test public void testCheckFailedTwoFromTwoNumber() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - final Result result = createResult(2, 0, new HashMap() - { - private static final long serialVersionUID = 3L; - - { - this.put(name.getMethodName() + "1", new RuntimeException("This is RuntimeException 1")); - this.put(name.getMethodName() + "2", new RuntimeException("This is RuntimeException 1")); - } - }); + final String errorMessage1 = "This is RuntimeException 1"; + final String errorMessage2 = "This is RuntimeException 2"; + final Result result = createResult(2, 0, Map.of(name.getMethodName().concat("1"), new RuntimeException(errorMessage1), + name.getMethodName().concat("2"), new RuntimeException(errorMessage2))); // no assertion for failure message, as one is only possible for single fail checkFail(result, 2, 0, 2); @@ -61,41 +49,24 @@ public void testCheckFailedTwoFromTwoNumber() throws NoSuchFieldException, Secur @Test public void testCheckFailedTwoFromTwoOneFailureMessage() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - final Result result = createResult(2, 0, new HashMap() - { - private static final long serialVersionUID = 4L; - - { - this.put(name.getMethodName() + "1", new RuntimeException("This is RuntimeException 1")); - this.put(name.getMethodName() + "2", new RuntimeException("This is RuntimeException 1")); - } - }); + final String errorMessage = "This is RuntimeException 1"; + final Result result = createResult(2, 0, Map.of(name.getMethodName().concat("1"), new RuntimeException(errorMessage), + name.getMethodName().concat("2"), new RuntimeException(errorMessage))); // no assertion for failure message, as one is only possible for single fail - checkFail(result, 2, 0, 2, "This is RuntimeException 1"); + checkFail(result, 2, 0, 2, errorMessage); } @Test public void testCheckFailedTwoFromTwoTwoFailureMessages() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { - final Result result = createResult(2, 0, new HashMap() - { - private static final long serialVersionUID = 5L; - - { - this.put(name.getMethodName() + "1", new RuntimeException("This is RuntimeException 1")); - this.put(name.getMethodName() + "2", new RuntimeException("This is RuntimeException 2")); - } - }); - final HashMap expectedFailureMessages = new HashMap() - { - private static final long serialVersionUID = 6L; + final String errorMessage1 = "This is RuntimeException 1"; + final String errorMessage2 = "This is RuntimeException 2"; + final Result result = createResult(2, 0, Map.of(name.getMethodName().concat("1"), new RuntimeException(errorMessage1), + name.getMethodName().concat("2"), new RuntimeException(errorMessage2))); + final Map expectedFailureMessages = Map.of(name.getMethodName().concat("1"), errorMessage1, + name.getMethodName().concat("2"), errorMessage2); - { - this.put(name.getMethodName() + "1", "This is RuntimeException 1"); - this.put(name.getMethodName() + "2", "This is RuntimeException 2"); - } - }; // no assertion for failure message, as one is only possible for single fail checkFail(result, 2, 0, 2, expectedFailureMessages); } @@ -104,14 +75,7 @@ public void testCheckFailedTwoFromTwoTwoFailureMessages() throws NoSuchFieldExce public void testCheckOneFailedOneIgnoredFromTwo() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { final String errorMessage = "This is RuntimeException 1"; - final Result result = createResult(2, 1, new HashMap() - { - private static final long serialVersionUID = 7L; - - { - this.put(name.getMethodName() + "1", new RuntimeException(errorMessage)); - } - }); + final Result result = createResult(2, 1, Map.of(name.getMethodName().concat("1"), new RuntimeException(errorMessage))); checkFail(result, 2, 1, 1, errorMessage); }