You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2025/03/25 13:18:21 UTC

(myfaces-tobago) branch main updated: test: avoid deprecated method (#6206)

This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/main by this push:
     new ac505b2f10 test: avoid deprecated method (#6206)
ac505b2f10 is described below

commit ac505b2f1037932693057d90c3f0a096fb949073
Author: Udo Schnurpfeil <lo...@apache.org>
AuthorDate: Tue Mar 25 14:18:15 2025 +0100

    test: avoid deprecated method (#6206)
---
 .../tobago/webapp/TobagoResponseWriterUnitTest.java      | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 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 9461e9f3a0..8975b7d24e 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
@@ -183,9 +183,9 @@ public void testPassthrough() throws IOException {
         facesContext, Tags.in.componentType(), RendererTypes.In, "id");
     c.getPassThroughAttributes().put("step", 1);
     c.getPassThroughAttributes().put("type", "number");
-    writer.startElement(HtmlElements.INPUT.getValue(), c);
-    writer.writeAttribute(HtmlAttributes.VALUE.getValue(), "100", null);
-    writer.endElement(HtmlElements.INPUT.getValue());
+    writer.startElement(HtmlElements.INPUT, c);
+    writer.writeAttribute(HtmlAttributes.VALUE, 100);
+    writer.endElement(HtmlElements.INPUT);
 
     Assertions.assertTrue(stringWriter.toString().trim().matches(
         "<input value='100' (step='1' type='number'|type='number' step='1')\\s*>"
@@ -197,10 +197,10 @@ public void testPassthroughChangeElementTag() throws IOException {
     final UIIn c = (UIIn) ComponentUtils.createComponent(
         facesContext, Tags.in.componentType(), RendererTypes.In, "id");
     c.getPassThroughAttributes().put("step", 1);
-    c.getPassThroughAttributes().put(Renderer.PASSTHROUGH_RENDERER_LOCALNAME_KEY, HtmlElements.TEXTAREA.getValue());
-    writer.startElement(HtmlElements.INPUT.getValue(), c);
-    writer.writeAttribute(HtmlAttributes.VALUE.getValue(), "100", null);
-    writer.endElement(HtmlElements.INPUT.getValue());
+    c.getPassThroughAttributes().put(Renderer.PASSTHROUGH_RENDERER_LOCALNAME_KEY, HtmlElements.TEXTAREA);
+    writer.startElement(HtmlElements.INPUT, c);
+    writer.writeAttribute(HtmlAttributes.VALUE, 100);
+    writer.endElement(HtmlElements.INPUT);
 
     Assertions.assertEquals("\n<textarea value='100' step='1'></textarea>",
         stringWriter.toString());
@@ -225,7 +225,7 @@ public void testPassthroughChangeElementTagInRender() throws IOException {
         facesContext, Tags.in.componentType(), RendererTypes.In, "id");
 
     c.getPassThroughAttributes().put("test", 1);
-    c.getPassThroughAttributes().put(Renderer.PASSTHROUGH_RENDERER_LOCALNAME_KEY, HtmlElements.TEXTAREA.getValue());
+    c.getPassThroughAttributes().put(Renderer.PASSTHROUGH_RENDERER_LOCALNAME_KEY, HtmlElements.TEXTAREA);
     c.encodeAll(facesContext);
     Assertions.assertEquals("\n<tobago-in id='id' class='tobago-auto-spacing'>\n"
         + "<textarea type='text' name='id' id='id::field' class='form-control' test='1'></textarea>"