From ba49c60d95c7e9e32caddf143981c2aea90134e8 Mon Sep 17 00:00:00 2001 From: Volodymyr Siedlecki Date: Tue, 1 Oct 2024 14:21:43 -0400 Subject: [PATCH] Update tests for MYFACES-4681 --- .../facelets/compiler/doctype/DoctypeTestCase.java | 10 ++++++---- .../updateheadres/UpdateHeadDynamicViewTestCase.java | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/impl/src/test/java/org/apache/myfaces/view/facelets/compiler/doctype/DoctypeTestCase.java b/impl/src/test/java/org/apache/myfaces/view/facelets/compiler/doctype/DoctypeTestCase.java index c2be9f99f..0e642e9e8 100644 --- a/impl/src/test/java/org/apache/myfaces/view/facelets/compiler/doctype/DoctypeTestCase.java +++ b/impl/src/test/java/org/apache/myfaces/view/facelets/compiler/doctype/DoctypeTestCase.java @@ -68,8 +68,9 @@ public void testCompilerXhtml() throws Exception { Assertions.assertNotNull(((AbstractFacelet) f).getDoctype()); Assertions.assertEquals("html", ((AbstractFacelet) f).getDoctype().getRootElement()); - Assertions.assertEquals("-//W3C//DTD XHTML 1.0 Transitional//EN", ((AbstractFacelet) f).getDoctype().getPublic()); - Assertions.assertEquals("http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd", ((AbstractFacelet) f).getDoctype().getSystem()); + // MYFACES-4681 - Simplified to + Assertions.assertEquals(null, ((AbstractFacelet) f).getDoctype().getPublic()); + Assertions.assertEquals(null, ((AbstractFacelet) f).getDoctype().getSystem()); } @Test @@ -92,7 +93,8 @@ public void testXhtml() throws Exception Assertions.assertNotNull(root.getDoctype()); Assertions.assertEquals("html", root.getDoctype().getRootElement()); - Assertions.assertEquals("-//W3C//DTD XHTML 1.0 Transitional//EN", root.getDoctype().getPublic()); - Assertions.assertEquals("http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd", root.getDoctype().getSystem()); + // MYFACES-4681 - Simplified to + Assertions.assertEquals(null, root.getDoctype().getPublic()); + Assertions.assertEquals(null, root.getDoctype().getSystem()); } } diff --git a/impl/src/test/java/org/apache/myfaces/view/facelets/updateheadres/UpdateHeadDynamicViewTestCase.java b/impl/src/test/java/org/apache/myfaces/view/facelets/updateheadres/UpdateHeadDynamicViewTestCase.java index 1ab11a690..df01097b8 100644 --- a/impl/src/test/java/org/apache/myfaces/view/facelets/updateheadres/UpdateHeadDynamicViewTestCase.java +++ b/impl/src/test/java/org/apache/myfaces/view/facelets/updateheadres/UpdateHeadDynamicViewTestCase.java @@ -97,7 +97,8 @@ public void testUpdateScript3Head() throws Exception // the inclusion should trigger update head Assertions.assertTrue(text.contains("update id=\"jakarta.faces.Resource\"")); Assertions.assertTrue(text.contains("alert(\"script3\");")); - Assertions.assertTrue(text.contains("link rel=\"stylesheet\" type=\"text/css\" href=\"/test/faces/jakarta.faces.resource/style3.css\"")); + // MYFACES-4681 - HTML5 is default output mode, so the type attribute is unnecessary + Assertions.assertTrue(text.contains("link rel=\"stylesheet\" href=\"/test/faces/jakarta.faces.resource/style3.css\"")); //System.out.println(text); endRequest(); }