You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by hn...@apache.org on 2024/11/19 08:42:32 UTC
(myfaces-tobago) branch tobago-5.x updated: Fixing flaky tests in TobagoResponseWriterUnitTest.java (#5703)
This is an automated email from the ASF dual-hosted git repository.
hnoeth pushed a commit to branch tobago-5.x
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git
The following commit(s) were added to refs/heads/tobago-5.x by this push:
new f79fc2e2c1 Fixing flaky tests in TobagoResponseWriterUnitTest.java (#5703)
f79fc2e2c1 is described below
commit f79fc2e2c1d834915f6a2e95ef313e8611a4cca7
Author: Mihir Gune <mi...@gmail.com>
AuthorDate: Tue Nov 19 02:19:54 2024 -0600
Fixing flaky tests in TobagoResponseWriterUnitTest.java (#5703)
* Fixing flaky tests in TobagoResponseWriterUnitTest.java
(cherry picked from commit a900c6d9d48a0f90b45bdfab88264534c1ca817c)
---
.../myfaces/tobago/webapp/TobagoResponseWriterUnitTest.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/tobago-core/src/test/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriterUnitTest.java b/tobago-core/src/test/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriterUnitTest.java
index 4982d460cb..6fa1d22905 100644
--- a/tobago-core/src/test/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriterUnitTest.java
+++ b/tobago-core/src/test/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriterUnitTest.java
@@ -173,8 +173,9 @@ public class TobagoResponseWriterUnitTest extends AbstractTobagoTestBase {
writer.writeAttribute(HtmlAttributes.VALUE.getValue(), "100", null);
writer.endElement(HtmlElements.INPUT.getValue());
- Assertions.assertEquals("\n<input value='100' step='1' type='number'>",
- stringWriter.toString());
+ Assertions.assertTrue(stringWriter.toString().trim().matches(
+ "<input value='100' (step='1' type='number'|type='number' step='1')\\s*>"
+ ));
}
@Test
@@ -199,9 +200,9 @@ public class TobagoResponseWriterUnitTest extends AbstractTobagoTestBase {
c.getPassThroughAttributes().put("step", 1);
c.getPassThroughAttributes().put("type", "number");
c.encodeAll(facesContext);
- Assertions.assertEquals("\n<tobago-in id='id' class='tobago-auto-spacing'>\n"
- + " <input name='id' id='id::field' class='form-control' step='1' type='number'>\n"
- + "</tobago-in>", getLastWritten());
+ Assertions.assertTrue(getLastWritten().trim().matches("<tobago-in id='id' class='tobago-auto-spacing'>\\s*"
+ + "<input name='id' id='id::field' class='form-control' (step='1' type='number'|type='number' step='1')\\s*>"
+ + "\\s*</tobago-in>"));
}
@Test