@@ -32,7 +36,7 @@
* should help to keep the wrapper classes in synch with the wrapped classes.
*
*/
-public class FacesWrapperTestCase extends TestCase {
+public class FacesWrapperTestCase {
private static List> wrapperClasses;
private static List> noWrapperClasses;
@@ -44,8 +48,8 @@ public class FacesWrapperTestCase extends TestCase {
* implementing FacesWrapper.
* @throws java.lang.Exception
*/
- @Override
- protected void setUp() throws Exception {
+ @BeforeEach
+ public void setUp() throws Exception {
if (wrapperClasses == null) {
loadWrapperClasses();
methodsToIgnore = new ArrayList();
@@ -56,22 +60,24 @@ protected void setUp() throws Exception {
/**
* Unit test to assert wrapperClasses list was loaded (see {@link #setUp()}.
*/
+ @Test
public void testWrapperClassesLoaded() {
assertNotNull(wrapperClasses);
- assertTrue("no wrapper classes found!", !wrapperClasses.isEmpty());
+ assertTrue(!wrapperClasses.isEmpty());
}
/**
* Unit test to assert there are no *Wrapper classes not implementing
* FacesWrapper.
*/
+ @Test
public void testWrapperClassesImplementFacesWrapper() {
assertNotNull(noWrapperClasses);
if (noWrapperClasses.size() > 0) {
System.out.println("Wrapper classes not implementing jakarta.faces.FacesWrapper:");
System.out.println(noWrapperClasses.toString());
}
- assertTrue("Found wrapper classes not implementing FacesWrapper!", noWrapperClasses
+ assertTrue(noWrapperClasses
.isEmpty());
}
@@ -80,6 +86,7 @@ public void testWrapperClassesImplementFacesWrapper() {
* implementing FacesWrapper do wrap all public and protected methods of the
* wrapped class.
*/
+ @Test
public void testWrapperClassWrapsPublicAndProtectedMethods() {
for (Class> wrapper : wrapperClasses) {
if (wrapper.isInterface()) {
@@ -95,7 +102,7 @@ public void testWrapperClassWrapsPublicAndProtectedMethods() {
if (isMethodContained(m, methodsToIgnore)) {
continue;
}
- assertTrue(msg + m.toString(), isMethodContained(m, wrapperMethods));
+ assertTrue(isMethodContained(m, wrapperMethods), msg + m.toString());
}
}
}
@@ -154,8 +161,8 @@ private void loadWrapperClasses() {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
try {
collectWrapperClasses(
- classLoader,
- JAVAX_FACES_PKG,
+ classLoader,
+ JAVAX_FACES_PKG,
new File(classLoader.getResource("jakarta/faces/Messages.properties").getFile())
.getParentFile());
} catch (Exception e) {
diff --git a/impl/src/test/java/jakarta/faces/FactoryFinderTestCase.java b/impl/src/test/java/jakarta/faces/FactoryFinderTestCase.java
index dce43b0c2d..4dc3fbe6f1 100644
--- a/impl/src/test/java/jakarta/faces/FactoryFinderTestCase.java
+++ b/impl/src/test/java/jakarta/faces/FactoryFinderTestCase.java
@@ -16,6 +16,17 @@
package jakarta.faces;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.io.File;
+import java.io.PrintWriter;
+import java.lang.reflect.Method;
+
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
import com.sun.faces.mock.MockHttpServletRequest;
import com.sun.faces.mock.MockHttpServletResponse;
import com.sun.faces.mock.MockServletContext;
@@ -27,25 +38,7 @@
import jakarta.faces.lifecycle.Lifecycle;
import jakarta.faces.lifecycle.LifecycleFactory;
-import java.io.File;
-import java.io.PrintWriter;
-import java.lang.reflect.Method;
-
-import junit.framework.TestCase;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class FactoryFinderTestCase extends TestCase {
-
- // ------------------------------------------------------------ Constructors
- /**
- * Construct a new instance of this test case.
- *
- * @param name Name of the test case
- */
- public FactoryFinderTestCase(String name) {
- super(name);
- }
+public class FactoryFinderTestCase {
public static String FACTORIES[][] = {
{FactoryFinder.APPLICATION_FACTORY,
@@ -67,10 +60,8 @@ public FactoryFinderTestCase(String name) {
// ---------------------------------------------------- Overall Test Methods
// Set up instance variables required by this test case.
- @Override
+ @BeforeEach
public void setUp() throws Exception {
- super.setUp();
-
Method method = FacesContext.class.getDeclaredMethod("setCurrentInstance", FacesContext.class);
method.setAccessible(true);
method.invoke(null, new Object[]{null});
@@ -80,15 +71,9 @@ public void setUp() throws Exception {
}
}
- // Return the tests included in this test case.
- public static Test suite() {
- return (new TestSuite(FactoryFinderTestCase.class));
- }
-
// Tear down instance variables required by ths test case
- @Override
+ @AfterEach
public void tearDown() throws Exception {
- super.tearDown();
FactoryFinder.releaseFactories();
for (int i = 0, len = FACTORIES.length; i < len; i++) {
System.getProperties().remove(FACTORIES[i][0]);
@@ -103,6 +88,7 @@ public void tearDown() throws Exception {
*
* @throws java.lang.Exception
*/
+ @Test
public void testFacesConfigCase() throws Exception {
Object factory = null;
Class> clazz = null;
@@ -122,7 +108,7 @@ public void testFacesConfigCase() throws Exception {
servicesDir.mkdirs();
File servicesFile = new File(servicesDir, "jakarta.faces.context.FacesContextFactory");
-
+
if (servicesFile.exists()) {
servicesFile.delete();
}
@@ -130,12 +116,12 @@ public void testFacesConfigCase() throws Exception {
writer.println("jakarta.faces.mock.MockFacesContextFactoryExtender");
writer.flush();
writer.close();
-
+
File cServicesDir = new File(System.getProperty("basedir"), "target/generated-classes/cobertura/META-INF/services");
cServicesDir.mkdirs();
File cServicesFile = new File(cServicesDir, "jakarta.faces.context.FacesContextFactory");
-
+
if (cServicesFile.exists()) {
cServicesFile.delete();
}
@@ -151,19 +137,19 @@ public void testFacesConfigCase() throws Exception {
for (i = 0, len = FACTORIES.length; i < len; i++) {
clazz = Class.forName(FACTORIES[i][0]);
factory = FactoryFinder.getFactory(FACTORIES[i][0]);
- assertTrue("Factory for " + clazz.getName()
- + " not of expected type.",
- clazz.isAssignableFrom(factory.getClass()));
+ assertTrue(
+ clazz.isAssignableFrom(factory.getClass()), "Factory for " + clazz.getName()
+ + " not of expected type.");
clazz = Class.forName(FACTORIES[i][1]);
- assertTrue("Factory " + FACTORIES[i][1] + " not of expected type",
- clazz.isAssignableFrom(factory.getClass()));
+ assertTrue(
+ clazz.isAssignableFrom(factory.getClass()), "Factory " + FACTORIES[i][1] + " not of expected type");
}
// verify that the delegation works
assertTrue(System.getProperty(FACTORIES[2][0]).equals("jakarta.faces.mock.MockFacesContextFactoryExtender2"));
assertTrue(System.getProperty("oldImpl").equals("jakarta.faces.mock.MockFacesContextFactoryExtender"));
- // Verify IllegalStateException when factory not found
+ // Verify IllegalStateException when factory not found
FactoryFinder.releaseFactories();
FactoryFinder.setFactory(FACTORIES[0][0], FACTORIES[0][1]);
FactoryFinder.setFactory(FACTORIES[1][0], FACTORIES[1][1]);
@@ -182,6 +168,7 @@ public void testFacesConfigCase() throws Exception {
}
// TODO re-enable
+ @Test
public void testNoFacesContext() throws Exception {
// assertNull(FacesContext.getCurrentInstance());
// Object result = FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
@@ -196,6 +183,7 @@ public void testNoFacesContext() throws Exception {
*
* @throws java.lang.Exception
*/
+ @Test
public void testServicesCase() throws Exception {
Object factory = null;
Class> clazz = null;
@@ -215,25 +203,25 @@ public void testServicesCase() throws Exception {
servicesDir.mkdirs();
File servicesFile = new File(servicesDir, "jakarta.faces.context.FacesContextFactory");
-
+
if (servicesFile.exists()) {
servicesFile.delete();
}
-
+
PrintWriter writer = new PrintWriter(servicesFile);
writer.println("jakarta.faces.mock.MockFacesContextFactoryExtender");
writer.flush();
writer.close();
-
+
File cServicesDir = new File(System.getProperty("basedir"), "target/generated-classes/cobertura/META-INF/services");
cServicesDir.mkdirs();
File cServicesFile = new File(cServicesDir, "jakarta.faces.context.FacesContextFactory");
-
+
if (cServicesFile.exists()) {
cServicesFile.delete();
}
-
+
PrintWriter cWriter = new PrintWriter(cServicesFile);
cWriter.println("jakarta.faces.mock.MockFacesContextFactoryExtender");
cWriter.flush();
@@ -243,12 +231,12 @@ public void testServicesCase() throws Exception {
for (i = 0, len = FACTORIES.length; i < len; i++) {
clazz = Class.forName(FACTORIES[i][0]);
factory = FactoryFinder.getFactory(FACTORIES[i][0]);
- assertTrue("Factory for " + clazz.getName()
- + " not of expected type.",
- clazz.isAssignableFrom(factory.getClass()));
+ assertTrue(
+ clazz.isAssignableFrom(factory.getClass()), "Factory for " + clazz.getName()
+ + " not of expected type.");
clazz = Class.forName(FACTORIES[i][1]);
- assertTrue("Factory " + FACTORIES[i][1] + " not of expected type",
- clazz.isAssignableFrom(factory.getClass()));
+ assertTrue(
+ clazz.isAssignableFrom(factory.getClass()), "Factory " + FACTORIES[i][1] + " not of expected type");
}
// verify that the delegation works
@@ -259,6 +247,7 @@ public void testServicesCase() throws Exception {
cServicesFile.delete();
}
+ @Test
public void testNoFacesContextInitially() throws Exception {
assertNull(FacesContext.getCurrentInstance());
diff --git a/impl/src/test/java/jakarta/faces/FactoryFinderTestCase2.java b/impl/src/test/java/jakarta/faces/FactoryFinderTestCase2.java
index e28e84c25c..8b91e1f928 100644
--- a/impl/src/test/java/jakarta/faces/FactoryFinderTestCase2.java
+++ b/impl/src/test/java/jakarta/faces/FactoryFinderTestCase2.java
@@ -16,59 +16,44 @@
package jakarta.faces;
-import junit.framework.TestCase;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import static org.junit.jupiter.api.Assertions.assertTrue;
-public class FactoryFinderTestCase2 extends TestCase {
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+public class FactoryFinderTestCase2 {
- // ------------------------------------------------------------ Constructors
- /**
- * Construct a new instance of this test case.
- *
- * @param name Name of the test case
- */
- public FactoryFinderTestCase2(String name) {
- super(name);
- }
-
public static String FACTORIES[][] = {
- { FactoryFinder.APPLICATION_FACTORY,
+ { FactoryFinder.APPLICATION_FACTORY,
"com.sun.faces.mock.MockApplicationFactory"
},
- { FactoryFinder.EXTERNAL_CONTEXT_FACTORY,
+ { FactoryFinder.EXTERNAL_CONTEXT_FACTORY,
"com.sun.faces.mock.MockExternalContextFactory"
},
- { FactoryFinder.FACES_CONTEXT_FACTORY,
+ { FactoryFinder.FACES_CONTEXT_FACTORY,
"com.sun.faces.mock.MockFacesContextFactory"
},
- { FactoryFinder.LIFECYCLE_FACTORY,
+ { FactoryFinder.LIFECYCLE_FACTORY,
"com.sun.faces.mock.MockLifecycleFactory"
},
- { FactoryFinder.RENDER_KIT_FACTORY,
+ { FactoryFinder.RENDER_KIT_FACTORY,
"com.sun.faces.mock.MockRenderKitFactory"
}
};
// ---------------------------------------------------- Overall Test Methods
// Set up instance variables required by this test case.
- @Override
+ @BeforeEach
public void setUp() throws Exception {
- super.setUp();
for (int i = 0, len = FactoryFinderTestCase2.FACTORIES.length; i < len; i++) {
System.getProperties().remove(FactoryFinderTestCase2.FACTORIES[i][0]);
}
}
- // Return the tests included in this test case.
- public static Test suite() {
- return (new TestSuite(FactoryFinderTestCase2.class));
- }
-
// Tear down instance variables required by ths test case
- @Override
+ @AfterEach
public void tearDown() throws Exception {
- super.tearDown();
FactoryFinder.releaseFactories();
for (int i = 0, len = FactoryFinderTestCase2.FACTORIES.length; i < len; i++) {
System.getProperties().remove(FactoryFinderTestCase2.FACTORIES[i][0]);
@@ -83,6 +68,7 @@ public void tearDown() throws Exception {
* precedence.
* @throws java.lang.Exception
*/
+ @Test
public void testJSFImplCase() throws Exception {
Object factory = null;
Class> clazz = null;
@@ -100,12 +86,12 @@ public void testJSFImplCase() throws Exception {
for (i = 0, len = FactoryFinderTestCase2.FACTORIES.length; i < len; i++) {
clazz = Class.forName(FactoryFinderTestCase2.FACTORIES[i][0]);
factory = FactoryFinder.getFactory(FactoryFinderTestCase2.FACTORIES[i][0]);
- assertTrue("Factory for " + clazz.getName()
- + " not of expected type.",
- clazz.isAssignableFrom(factory.getClass()));
+ assertTrue(
+ clazz.isAssignableFrom(factory.getClass()), "Factory for " + clazz.getName()
+ + " not of expected type.");
clazz = Class.forName(FactoryFinderTestCase2.FACTORIES[i][1]);
- assertTrue("Factory " + FactoryFinderTestCase2.FACTORIES[i][1] + " not of expected type",
- clazz.isAssignableFrom(factory.getClass()));
+ assertTrue(
+ clazz.isAssignableFrom(factory.getClass()), "Factory " + FactoryFinderTestCase2.FACTORIES[i][1] + " not of expected type");
}
}
}
diff --git a/impl/src/test/java/jakarta/faces/component/NamingContainerTestCase.java b/impl/src/test/java/jakarta/faces/component/NamingContainerTestCase.java
index c83be918e7..716212a50c 100644
--- a/impl/src/test/java/jakarta/faces/component/NamingContainerTestCase.java
+++ b/impl/src/test/java/jakarta/faces/component/NamingContainerTestCase.java
@@ -16,17 +16,23 @@
package jakarta.faces.component;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
+
import java.util.HashMap;
import java.util.Map;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
import com.sun.faces.junit.JUnitFacesTestCaseBase;
import com.sun.faces.mock.MockRenderKit;
import jakarta.faces.FactoryFinder;
import jakarta.faces.render.RenderKit;
import jakarta.faces.render.RenderKitFactory;
-import junit.framework.Test;
-import junit.framework.TestSuite;
/**
*
@@ -39,15 +45,10 @@ public class NamingContainerTestCase extends JUnitFacesTestCaseBase {
// The root of the component tree to be tested
private UIViewRoot root = null;
- // ------------------------------------------------------------ Constructors
- // Construct a new instance of this test case.
- public NamingContainerTestCase(String name) {
- super(name);
- }
-
// ---------------------------------------------------- Overall Test Methods
// Set up instance variables required by this test case.
@Override
+ @BeforeEach
public void setUp() throws Exception {
super.setUp();
@@ -67,15 +68,9 @@ public void setUp() throws Exception {
}
- // Return the tests included in this test case.
- public static Test suite() {
-
- return new TestSuite(NamingContainerTestCase.class);
-
- }
-
// Tear down instance variables required by this test case.
@Override
+ @AfterEach
public void tearDown() throws Exception {
root = null;
@@ -84,6 +79,7 @@ public void tearDown() throws Exception {
// ------------------------------------------------- Individual Test Methods
// Test nested NamingContainer callbacks
+ @Test
public void testNested() {
NamingContainerTestImpl a = new NamingContainerTestImpl();
@@ -134,6 +130,7 @@ public void testNested() {
}
// Test nested NamingContainer callbacks
+ @Test
public void testNested2() {
NamingContainerTestImpl a = new NamingContainerTestImpl();
@@ -184,6 +181,7 @@ public void testNested2() {
}
// Test standard NamingContainer functionality
+ @Test
public void testStandard() {
// Set up a component hierarchy as follows (component ids in quotes):
diff --git a/impl/src/test/java/jakarta/faces/component/SearchExpressionHandlerTest.java b/impl/src/test/java/jakarta/faces/component/SearchExpressionHandlerTest.java
index c2f87d76e5..85062251bc 100644
--- a/impl/src/test/java/jakarta/faces/component/SearchExpressionHandlerTest.java
+++ b/impl/src/test/java/jakarta/faces/component/SearchExpressionHandlerTest.java
@@ -16,13 +16,22 @@
package jakarta.faces.component;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotSame;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import org.junit.Assert;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import com.sun.faces.component.search.CompositeSearchKeywordResolver;
import com.sun.faces.component.search.SearchExpressionContextFactoryImpl;
@@ -57,11 +66,8 @@
public class SearchExpressionHandlerTest extends JUnitFacesTestCaseBase {
- public SearchExpressionHandlerTest(String name) {
- super(name);
- }
-
@Override
+ @BeforeEach
public void setUp() throws Exception {
super.setUp();
@@ -99,6 +105,7 @@ public void setUp() throws Exception {
}
@Override
+ @AfterEach
public void tearDown() throws Exception {
super.tearDown();
}
@@ -153,6 +160,7 @@ public void invokeContextCallback(FacesContext context, UIComponent target) {
}
}
+ @Test
public void test_ResolveComponent_Parent() {
UIComponent root = new UIPanel();
@@ -172,9 +180,10 @@ public void test_ResolveComponent_Parent() {
UIComponent source = new UICommand();
innerContainer.getChildren().add(source);
- assertSame("Failed", innerContainer, resolveComponent(source, "@parent"));
+ assertSame(innerContainer, resolveComponent(source, "@parent"));
}
+ @Test
public void test_ResolveComponent_ParentParent() {
UIComponent root = new UIPanel();
@@ -194,9 +203,10 @@ public void test_ResolveComponent_ParentParent() {
UIComponent source = new UICommand();
innerContainer.getChildren().add(source);
- assertSame("Failed", outerContainer, resolveComponent(source, "@parent:@parent"));
+ assertSame(outerContainer, resolveComponent(source, "@parent:@parent"));
}
+ @Test
public void test_ResolveComponent_Form() {
UIComponent root = new UIPanel();
@@ -216,9 +226,10 @@ public void test_ResolveComponent_Form() {
UIComponent source = new UICommand();
innerContainer.getChildren().add(source);
- assertSame("Failed", form, resolveComponent(source, "@form"));
+ assertSame(form, resolveComponent(source, "@form"));
}
+ @Test
public void test_ResolveComponent_FormParent() {
UIComponent root = new UIPanel();
@@ -238,9 +249,10 @@ public void test_ResolveComponent_FormParent() {
UIComponent source = new UICommand();
innerContainer.getChildren().add(source);
- assertSame("Failed", root, resolveComponent(source, "@form:@parent"));
+ assertSame(root, resolveComponent(source, "@form:@parent"));
}
+ @Test
public void test_ResolveComponent_All() {
UIComponent root = new UIPanel();
@@ -260,9 +272,10 @@ public void test_ResolveComponent_All() {
UIComponent source = new UICommand();
innerContainer.getChildren().add(source);
- assertSame("Failed", root, resolveComponent(source, "@all"));
+ assertSame(root, resolveComponent(source, "@all"));
}
+ @Test
public void test_ResolveComponent_This() {
UIComponent root = new UIPanel();
@@ -282,9 +295,10 @@ public void test_ResolveComponent_This() {
UIComponent source = new UICommand();
innerContainer.getChildren().add(source);
- assertSame("Failed", source, resolveComponent(source, "@this"));
+ assertSame(source, resolveComponent(source, "@this"));
}
+ @Test
public void test_ResolveComponent_ThisParent() {
UIComponent root = new UIPanel();
@@ -304,9 +318,10 @@ public void test_ResolveComponent_ThisParent() {
UIComponent source = new UICommand();
innerContainer.getChildren().add(source);
- assertSame("Failed", innerContainer, resolveComponent(source, "@this:@parent"));
+ assertSame(innerContainer, resolveComponent(source, "@this:@parent"));
}
+ @Test
public void test_ResolveComponent_Namingcontainer() {
UIComponent root = new UIPanel();
@@ -326,9 +341,10 @@ public void test_ResolveComponent_Namingcontainer() {
UIComponent source = new UICommand();
innerContainer.getChildren().add(source);
- assertSame("Failed", innerContainer, resolveComponent(source, "@namingcontainer"));
+ assertSame(innerContainer, resolveComponent(source, "@namingcontainer"));
}
+ @Test
public void test_ResolveComponent_Absolute() {
UIComponent root = new UIPanel();
@@ -353,9 +369,10 @@ public void test_ResolveComponent_Absolute() {
source.setId("source");
innerContainer.getChildren().add(source);
- assertSame("Failed", source, resolveComponent(source, " :form:outerContainer:innerContainer:source "));
+ assertSame(source, resolveComponent(source, " :form:outerContainer:innerContainer:source "));
}
+ @Test
public void test_ResolveComponent_Relative() {
UIComponent root = new UIPanel();
@@ -380,9 +397,10 @@ public void test_ResolveComponent_Relative() {
source.setId("source");
innerContainer.getChildren().add(source);
- assertSame("Failed", component, resolveComponent(source, " other "));
+ assertSame(component, resolveComponent(source, " other "));
}
+ @Test
public void test_ResolveComponent_AbsoluteForm() {
UIComponent root = new UIPanel();
@@ -408,9 +426,10 @@ public void test_ResolveComponent_AbsoluteForm() {
source.setId("source");
innerContainer.getChildren().add(source);
- assertSame("Failed", root, resolveComponent(source, " :form:@parent "));
+ assertSame(root, resolveComponent(source, " :form:@parent "));
}
+ @Test
public void test_ResolveComponent_ParentChild() {
UIComponent root = new UIPanel();
@@ -436,10 +455,11 @@ public void test_ResolveComponent_ParentChild() {
source.setId("source");
innerContainer.getChildren().add(source);
- assertSame("Failed", component, resolveComponent(source, " @parent:@child(0) "));
- assertSame("Failed", source, resolveComponent(source, " @parent:@child(1) "));
+ assertSame(component, resolveComponent(source, " @parent:@child(0) "));
+ assertSame(source, resolveComponent(source, " @parent:@child(1) "));
}
+ @Test
public void test_ResolveComponent_AbsoluteNamingcontainer() {
UIComponent root = new UIPanel();
@@ -465,9 +485,10 @@ public void test_ResolveComponent_AbsoluteNamingcontainer() {
source.setId("source");
innerContainer.getChildren().add(source);
- assertSame("Failed", form, resolveComponent(source, " :form:outerContainer:@namingcontainer "));
+ assertSame(form, resolveComponent(source, " :form:outerContainer:@namingcontainer "));
}
+ @Test
public void test_ResolveClientId_This() {
UIComponent root = new UIPanel();
@@ -491,9 +512,10 @@ public void test_ResolveClientId_This() {
source.setId("source");
innerContainer.getChildren().add(source);
- assertEquals("Failed", "form:outerContainer:innerContainer:source", resolveClientId(source, " @this "));
+ assertEquals("form:outerContainer:innerContainer:source", resolveClientId(source, " @this "));
}
+ @Test
public void test_ResolveClientId_Form() {
UIComponent root = new UIPanel();
@@ -517,9 +539,10 @@ public void test_ResolveClientId_Form() {
source.setId("source");
innerContainer.getChildren().add(source);
- assertEquals("Failed", "form", resolveClientId(source, " @form "));
+ assertEquals("form", resolveClientId(source, " @form "));
}
+ @Test
public void test_ResolveClientId_AbsoluteId() {
UIComponent root = new UIPanel();
@@ -543,9 +566,10 @@ public void test_ResolveClientId_AbsoluteId() {
UIComponent source = new UICommand();
innerContainer.getChildren().add(source);
- assertEquals("Failed", "form", resolveClientId(source, " :form "));
+ assertEquals("form", resolveClientId(source, " :form "));
}
+ @Test
public void test_ResolveClientId_Relative() {
UIComponent root = new UIPanel();
@@ -570,9 +594,10 @@ public void test_ResolveClientId_Relative() {
source.setId("source");
innerContainer.getChildren().add(source);
- assertEquals("Failed", "form:outerContainer:innerContainer:other", resolveClientId(source, " other "));
+ assertEquals("form:outerContainer:innerContainer:other", resolveClientId(source, " other "));
}
+ @Test
public void test_ResolveComponents_RelativeAndParentParent() {
UIComponent root = new UIPanel();
@@ -598,11 +623,12 @@ public void test_ResolveComponents_RelativeAndParentParent() {
innerContainer.getChildren().add(source);
List resolvedComponents = resolveComponents(source, " other @parent:@parent ");
- assertTrue("Failed", resolvedComponents.contains(component));
- assertTrue("Failed", resolvedComponents.contains(outerContainer));
- assertEquals("Failed", 2, resolvedComponents.size());
+ assertTrue(resolvedComponents.contains(component));
+ assertTrue(resolvedComponents.contains(outerContainer));
+ assertEquals(2, resolvedComponents.size());
}
+ @Test
public void test_ResolveComponents_RelativeAndThisParent() {
UIComponent root = new UIPanel();
@@ -628,11 +654,12 @@ public void test_ResolveComponents_RelativeAndThisParent() {
innerContainer.getChildren().add(source);
List resolvedComponents = resolveComponents(source, " other,@this:@parent @none ");
- assertTrue("Failed", resolvedComponents.contains(component));
- assertTrue("Failed", resolvedComponents.contains(innerContainer));
- assertEquals("Failed", 2, resolvedComponents.size());
+ assertTrue(resolvedComponents.contains(component));
+ assertTrue(resolvedComponents.contains(innerContainer));
+ assertEquals(2, resolvedComponents.size());
}
+ @Test
public void test_ResolveComponent_Next() {
UIComponent root = new UIPanel();
@@ -650,8 +677,8 @@ public void test_ResolveComponent_Next() {
command3.setId("command3");
root.getChildren().add(command3);
- assertSame("Failed", command2, resolveComponent(command1, " @next "));
- assertSame("Failed", command3, resolveComponent(command2, " @next "));
+ assertSame(command2, resolveComponent(command1, " @next "));
+ assertSame(command3, resolveComponent(command2, " @next "));
try {
resolveComponent(command3, " @next");
@@ -661,6 +688,7 @@ public void test_ResolveComponent_Next() {
}
}
+ @Test
public void test_ResolveComponent_NextNext() {
UIComponent root = new UIPanel();
@@ -678,7 +706,7 @@ public void test_ResolveComponent_NextNext() {
command3.setId("command3");
root.getChildren().add(command3);
- assertSame("Failed", command3, resolveComponent(command1, " @next:@next "));
+ assertSame(command3, resolveComponent(command1, " @next:@next "));
try {
resolveComponent(command2, " @next:@next");
@@ -695,6 +723,7 @@ public void test_ResolveComponent_NextNext() {
}
}
+ @Test
public void test_ResolveComponent_Previous() {
UIComponent root = new UIPanel();
@@ -712,8 +741,8 @@ public void test_ResolveComponent_Previous() {
command3.setId("command3");
root.getChildren().add(command3);
- assertSame("Failed", command1, resolveComponent(command2, " @previous "));
- assertSame("Failed", command2, resolveComponent(command3, " @previous "));
+ assertSame(command1, resolveComponent(command2, " @previous "));
+ assertSame(command2, resolveComponent(command3, " @previous "));
try {
resolveComponent(command1, " @previous");
@@ -723,6 +752,7 @@ public void test_ResolveComponent_Previous() {
}
}
+ @Test
public void test_ResolveComponent_Root() {
UIComponent root = new UIPanel();
@@ -740,9 +770,10 @@ public void test_ResolveComponent_Root() {
command3.setId("command3");
root.getChildren().add(command3);
- assertSame("Failed", facesContext.getViewRoot(), resolveComponent(command2, " @root "));
+ assertSame(facesContext.getViewRoot(), resolveComponent(command2, " @root "));
}
+ @Test
public void test_ResolveComponent_FormChildNextNext() {
UIForm root = new UIForm();
@@ -760,9 +791,10 @@ public void test_ResolveComponent_FormChildNextNext() {
command3.setId("command3");
root.getChildren().add(command3);
- assertSame("Failed", command3, resolveComponent(command1, " @form:@child(0):@next:@next "));
+ assertSame(command3, resolveComponent(command1, " @form:@child(0):@next:@next "));
}
+ @Test
public void test_ResolveComponent_IgnoreNoResult() {
UIForm root = new UIForm();
root.setId("form");
@@ -775,9 +807,10 @@ public void test_ResolveComponent_IgnoreNoResult() {
command2.setId("command2");
root.getChildren().add(command2);
- assertSame("Failed", null, resolveComponent(command1, " command3 ", SearchExpressionHint.IGNORE_NO_RESULT));
+ assertSame(null, resolveComponent(command1, " command3 ", SearchExpressionHint.IGNORE_NO_RESULT));
}
+ @Test
public void test_ResolveClientId_AbsoluteWithFormPrependIdFalse() {
UIComponent root = new UIPanel();
@@ -803,9 +836,10 @@ public void test_ResolveClientId_AbsoluteWithFormPrependIdFalse() {
source.setId("source");
innerContainer.getChildren().add(source);
- assertEquals("Failed", "outerContainer:innerContainer:source", resolveClientId(source, " :form:outerContainer:innerContainer:source "));
+ assertEquals("outerContainer:innerContainer:source", resolveClientId(source, " :form:outerContainer:innerContainer:source "));
}
+ @Test
public void test_ResolveClientId_AbsoluteWithFormPrependIdFalse_InvokeOnComponent() {
UIComponent root = new UIPanel();
@@ -831,76 +865,79 @@ public void test_ResolveClientId_AbsoluteWithFormPrependIdFalse_InvokeOnComponen
source.setId("source");
innerContainer.getChildren().add(source);
- assertEquals("Failed", "outerContainer:innerContainer:source", resolveClientId(source, " outerContainer:innerContainer:source "));
+ assertEquals("outerContainer:innerContainer:source", resolveClientId(source, " outerContainer:innerContainer:source "));
}
+ @Test
public void test_Passthrough() {
SearchExpressionHandler handler = facesContext.getApplication().getSearchExpressionHandler();
SearchExpressionContext searchExpressionContext = SearchExpressionContext.createSearchExpressionContext(facesContext, null);
- Assert.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "mainForm:showName"));
- Assert.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "mainForm:table:3:nested:1:nestedText"));
- Assert.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "mainForm:table:3:baseText"));
- Assert.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "mainForm:table:0:baseText"));
- Assert.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "mainForm:table:3:nested:0:nestedText"));
- Assert.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "mainForm:table:3:nested"));
- Assert.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "mainForm:table:1:nested:0:nestedText"));
-
- Assert.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@this"));
- Assert.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@this:@parent:showName"));
- Assert.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@parent:showName:@parent:showName"));
- Assert.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@form"));
- Assert.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@form:showName"));
- Assert.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@namingcontainer:showName"));
- Assert.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@previous"));
- Assert.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@next"));
- Assert.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@parent:@id(msgName)"));
-
- Assert.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@whoNows"));
- Assert.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@parent:@whoNows"));
- Assert.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "mainForm:@whoNows"));
- Assert.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "!whoNows"));
+ Assertions.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "mainForm:showName"));
+ Assertions.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "mainForm:table:3:nested:1:nestedText"));
+ Assertions.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "mainForm:table:3:baseText"));
+ Assertions.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "mainForm:table:0:baseText"));
+ Assertions.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "mainForm:table:3:nested:0:nestedText"));
+ Assertions.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "mainForm:table:3:nested"));
+ Assertions.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "mainForm:table:1:nested:0:nestedText"));
+
+ Assertions.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@this"));
+ Assertions.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@this:@parent:showName"));
+ Assertions.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@parent:showName:@parent:showName"));
+ Assertions.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@form"));
+ Assertions.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@form:showName"));
+ Assertions.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@namingcontainer:showName"));
+ Assertions.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@previous"));
+ Assertions.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@next"));
+ Assertions.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@parent:@id(msgName)"));
+
+ Assertions.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@whoNows"));
+ Assertions.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@parent:@whoNows"));
+ Assertions.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "mainForm:@whoNows"));
+ Assertions.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "!whoNows"));
Set hints = new HashSet<>();
hints.add(SearchExpressionHint.RESOLVE_CLIENT_SIDE);
searchExpressionContext = SearchExpressionContext.createSearchExpressionContext(facesContext, null, hints, null);
- Assert.assertTrue(handler.isPassthroughExpression(searchExpressionContext, "@form"));
- Assert.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@form:showName"));
- Assert.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@form:@child(0)"));
+ Assertions.assertTrue(handler.isPassthroughExpression(searchExpressionContext, "@form"));
+ Assertions.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@form:showName"));
+ Assertions.assertFalse(handler.isPassthroughExpression(searchExpressionContext, "@form:@child(0)"));
}
+ @Test
public void test_Valid() {
SearchExpressionHandler handler = facesContext.getApplication().getSearchExpressionHandler();
SearchExpressionContext searchExpressionContext = SearchExpressionContext.createSearchExpressionContext(facesContext, null);
- Assert.assertTrue(handler.isValidExpression(searchExpressionContext, "mainForm:showName"));
- Assert.assertTrue(handler.isValidExpression(searchExpressionContext, "mainForm:table:3:nested:1:nestedText"));
- Assert.assertTrue(handler.isValidExpression(searchExpressionContext, "mainForm:table:3:baseText"));
- Assert.assertTrue(handler.isValidExpression(searchExpressionContext, "mainForm:table:0:baseText"));
- Assert.assertTrue(handler.isValidExpression(searchExpressionContext, "mainForm:table:3:nested:0:nestedText"));
- Assert.assertTrue(handler.isValidExpression(searchExpressionContext, "mainForm:table:3:nested"));
- Assert.assertTrue(handler.isValidExpression(searchExpressionContext, "mainForm:table:1:nested:0:nestedText"));
-
- Assert.assertTrue(handler.isValidExpression(searchExpressionContext, "@this"));
- Assert.assertTrue(handler.isValidExpression(searchExpressionContext, "@this:@parent:showName"));
- Assert.assertTrue(handler.isValidExpression(searchExpressionContext, "@parent:showName:@parent:showName"));
- Assert.assertTrue(handler.isValidExpression(searchExpressionContext, "@form:showName"));
- Assert.assertTrue(handler.isValidExpression(searchExpressionContext, "@namingcontainer:showName"));
- Assert.assertTrue(handler.isValidExpression(searchExpressionContext, "@previous"));
- Assert.assertTrue(handler.isValidExpression(searchExpressionContext, "@next"));
- Assert.assertTrue(handler.isValidExpression(searchExpressionContext, "@parent:@id(msgName)"));
-
- Assert.assertFalse(handler.isValidExpression(searchExpressionContext, "@whoNows"));
- Assert.assertFalse(handler.isValidExpression(searchExpressionContext, "@parent:@whoNows"));
- Assert.assertFalse(handler.isValidExpression(searchExpressionContext, "mainForm:@whoNows"));
-
- Assert.assertFalse(handler.isValidExpression(searchExpressionContext, "@none:@parent"));
- Assert.assertFalse(handler.isValidExpression(searchExpressionContext, "@all:@parent"));
+ Assertions.assertTrue(handler.isValidExpression(searchExpressionContext, "mainForm:showName"));
+ Assertions.assertTrue(handler.isValidExpression(searchExpressionContext, "mainForm:table:3:nested:1:nestedText"));
+ Assertions.assertTrue(handler.isValidExpression(searchExpressionContext, "mainForm:table:3:baseText"));
+ Assertions.assertTrue(handler.isValidExpression(searchExpressionContext, "mainForm:table:0:baseText"));
+ Assertions.assertTrue(handler.isValidExpression(searchExpressionContext, "mainForm:table:3:nested:0:nestedText"));
+ Assertions.assertTrue(handler.isValidExpression(searchExpressionContext, "mainForm:table:3:nested"));
+ Assertions.assertTrue(handler.isValidExpression(searchExpressionContext, "mainForm:table:1:nested:0:nestedText"));
+
+ Assertions.assertTrue(handler.isValidExpression(searchExpressionContext, "@this"));
+ Assertions.assertTrue(handler.isValidExpression(searchExpressionContext, "@this:@parent:showName"));
+ Assertions.assertTrue(handler.isValidExpression(searchExpressionContext, "@parent:showName:@parent:showName"));
+ Assertions.assertTrue(handler.isValidExpression(searchExpressionContext, "@form:showName"));
+ Assertions.assertTrue(handler.isValidExpression(searchExpressionContext, "@namingcontainer:showName"));
+ Assertions.assertTrue(handler.isValidExpression(searchExpressionContext, "@previous"));
+ Assertions.assertTrue(handler.isValidExpression(searchExpressionContext, "@next"));
+ Assertions.assertTrue(handler.isValidExpression(searchExpressionContext, "@parent:@id(msgName)"));
+
+ Assertions.assertFalse(handler.isValidExpression(searchExpressionContext, "@whoNows"));
+ Assertions.assertFalse(handler.isValidExpression(searchExpressionContext, "@parent:@whoNows"));
+ Assertions.assertFalse(handler.isValidExpression(searchExpressionContext, "mainForm:@whoNows"));
+
+ Assertions.assertFalse(handler.isValidExpression(searchExpressionContext, "@none:@parent"));
+ Assertions.assertFalse(handler.isValidExpression(searchExpressionContext, "@all:@parent"));
}
+ @Test
public void test_ResolveComponents_Id() {
UIComponent root = new UIPanel();
FacesContext.getCurrentInstance().getViewRoot().getChildren().add(root);
@@ -938,6 +975,7 @@ public void test_ResolveComponents_Id() {
* The SearchExpression API was inspired by PrimeFaces. This test only tests, if PFS (PrimeFaces Selectors -> jQuery
* like selectors; like @(#myId > .myStyle)) can be correctly handled by the API+IMPL as a passthrough expression.
*/
+ @Test
public void test_PFS() {
CompositeSearchKeywordResolver s = (CompositeSearchKeywordResolver) application.getSearchKeywordResolver();
s.add(new SearchKeywordResolver() {
@@ -970,10 +1008,11 @@ public boolean isLeaf(SearchExpressionContext searchExpressionContext, String ke
SearchExpressionHandler handler = facesContext.getApplication().getSearchExpressionHandler();
SearchExpressionContext searchExpressionContext = SearchExpressionContext.createSearchExpressionContext(facesContext, null);
- Assert.assertTrue(handler.isValidExpression(searchExpressionContext, "@(.myPanel #id)"));
- Assert.assertFalse(handler.isValidExpression(searchExpressionContext, "@(.myPanel #id):test"));
+ Assertions.assertTrue(handler.isValidExpression(searchExpressionContext, "@(.myPanel #id)"));
+ Assertions.assertFalse(handler.isValidExpression(searchExpressionContext, "@(.myPanel #id):test"));
}
+ @Test
public void test_chainOfResponsability() {
CompositeSearchKeywordResolver s = (CompositeSearchKeywordResolver) application.getSearchKeywordResolver();
s.add(new CustomSearchKeywordResolverImplForm()); // drop in new @form resolver
@@ -995,8 +1034,8 @@ public void test_chainOfResponsability() {
UIComponent source = new UICommand();
innerContainer.getChildren().add(source);
- assertSame("Failed", source, resolveComponent(source, "@form"));
- assertNotSame("Failed", form, resolveComponent(source, "@form"));
+ assertSame(source, resolveComponent(source, "@form"));
+ assertNotSame(form, resolveComponent(source, "@form"));
}
class CustomSearchKeywordResolverImplForm extends SearchKeywordResolverImplForm {
@@ -1006,6 +1045,7 @@ public void resolve(SearchKeywordContext searchKeywordContext, UIComponent curre
}
}
+ @Test
public void test_ResolveComponent_LeafErrorHandling() {
UIComponent root = new UIPanel();
diff --git a/impl/src/test/java/jakarta/faces/component/StateHolderSaverTestCase.java b/impl/src/test/java/jakarta/faces/component/StateHolderSaverTestCase.java
index 803413d60a..721dce80c4 100644
--- a/impl/src/test/java/jakarta/faces/component/StateHolderSaverTestCase.java
+++ b/impl/src/test/java/jakarta/faces/component/StateHolderSaverTestCase.java
@@ -16,42 +16,37 @@
package jakarta.faces.component;
-import jakarta.faces.convert.IntegerConverter;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
-public class StateHolderSaverTestCase extends UIComponentBaseTestCase {
+import org.junit.jupiter.api.Test;
- // ------------------------------------------------------ Instance Variables
- // ------------------------------------------------------------ Constructors
- // Construct a new instance of this test case.
- public StateHolderSaverTestCase(String name) {
- super(name);
- }
+import jakarta.faces.convert.IntegerConverter;
- // ---------------------------------------------------- Overall Test Methods
- // Return the tests included in this test case.
- public static Test suite() {
- return new TestSuite(StateHolderSaverTestCase.class);
- }
+public class StateHolderSaverTestCase extends UIComponentBaseTestCase {
// ------------------------------------------------- Individual Test Methods
@Override
+ @Test
public void testLifecycleManagement() {
}
@Override
+ @Test
public void testChildrenRecursive() {
}
@Override
+ @Test
public void testComponentReconnect() {
}
@Override
+ @Test
public void testComponentRemoval() {
}
+ @Test
public void testImplementsStateHolder() throws Exception {
StateHolderSaver saver = null;
UIInput postSave, preSave = new UIInput();
@@ -63,6 +58,7 @@ public void testImplementsStateHolder() throws Exception {
assertEquals(postSave.getId(), preSave.getId());
}
+ @Test
public void testImplementsSerializable() throws Exception {
StateHolderSaver saver = null;
String preSave = "hello";
@@ -73,6 +69,7 @@ public void testImplementsSerializable() throws Exception {
assertTrue(preSave.equals(postSave));
}
+ @Test
public void testImplementsNeither() throws Exception {
StateHolderSaver saver = null;
IntegerConverter preSave = new IntegerConverter(), postSave = null;
diff --git a/impl/src/test/java/jakarta/faces/component/UIColumnTestCase.java b/impl/src/test/java/jakarta/faces/component/UIColumnTestCase.java
index 252331471b..e17feeb7cf 100644
--- a/impl/src/test/java/jakarta/faces/component/UIColumnTestCase.java
+++ b/impl/src/test/java/jakarta/faces/component/UIColumnTestCase.java
@@ -16,8 +16,9 @@
package jakarta.faces.component;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
/**
*
@@ -26,19 +27,10 @@
*/
public class UIColumnTestCase extends UIComponentBaseTestCase {
- // ------------------------------------------------------------ Constructors
- /**
- * Construct a new instance of this test case.
- *
- * @param name Name of the test case
- */
- public UIColumnTestCase(String name) {
- super(name);
- }
-
// ---------------------------------------------------- Overall Test Methods
// Set up instance variables required by this test case.
@Override
+ @BeforeEach
public void setUp() throws Exception {
super.setUp();
component = new UIColumn();
@@ -47,13 +39,9 @@ public void setUp() throws Exception {
expectedRendererType = null;
}
- // Return the tests included in this test case.
- public static Test suite() {
- return new TestSuite(UIColumnTestCase.class);
- }
-
// Tear down instance variables required by ths test case
@Override
+ @AfterEach
public void tearDown() throws Exception {
super.tearDown();
}
@@ -61,6 +49,7 @@ public void tearDown() throws Exception {
// ------------------------------------------------- Individual Test Methods
// Suppress lifecycle tests since we do not have a renderer
@Override
+ @Test
public void testLifecycleManagement() {
}
diff --git a/impl/src/test/java/jakarta/faces/component/UICommandTestCase.java b/impl/src/test/java/jakarta/faces/component/UICommandTestCase.java
index 40be6928ca..b6d12aea60 100644
--- a/impl/src/test/java/jakarta/faces/component/UICommandTestCase.java
+++ b/impl/src/test/java/jakarta/faces/component/UICommandTestCase.java
@@ -16,10 +16,16 @@
package jakarta.faces.component;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
import com.sun.faces.mock.MockExternalContext;
import jakarta.faces.FactoryFinder;
@@ -30,8 +36,6 @@
import jakarta.faces.render.RenderKit;
import jakarta.faces.render.RenderKitFactory;
import jakarta.faces.render.Renderer;
-import junit.framework.Test;
-import junit.framework.TestSuite;
/**
*
@@ -40,19 +44,10 @@
*/
public class UICommandTestCase extends UIComponentBaseTestCase {
- // ------------------------------------------------------------ Constructors
- /**
- * Construct a new instance of this test case.
- *
- * @param name Name of the test case
- */
- public UICommandTestCase(String name) {
- super(name);
- }
-
// ---------------------------------------------------- Overall Test Methods
// Set up instance variables required by this test case.
@Override
+ @BeforeEach
public void setUp() throws Exception {
super.setUp();
component = new UICommand();
@@ -61,11 +56,6 @@ public void setUp() throws Exception {
expectedRendererType = "jakarta.faces.Button";
}
- // Return the tests included in this test case.
- public static Test suite() {
- return new TestSuite(UICommandTestCase.class);
- }
-
// ------------------------------------------------- Individual Test Methods
// Test order of action listener calls with actionListener also
public void PENDING_FIXME_testActionOrder() throws Exception {
@@ -98,6 +88,7 @@ public void PENDING_FIXME_testActionOrder() throws Exception {
}
// Test event queuing and broadcasting (any phase listeners)
+ @Test
public void testEventsGeneric() {
UICommand command = (UICommand) component;
@@ -122,6 +113,7 @@ public void testEventsGeneric() {
}
// Test event queuing and broadcasting (mixed phase listeners)
+ @Test
public void testEventsMixed() {
UICommand command = (UICommand) component;
@@ -147,6 +139,7 @@ public void testEventsMixed() {
// Test event queuing and broadcasting (mixed phase listeners), with
// immediate set.
+ @Test
public void testEventsMixedImmediate() {
UICommand command = (UICommand) component;
@@ -172,6 +165,7 @@ public void testEventsMixedImmediate() {
}
// Test listener registration and deregistration
+ @Test
public void testListeners() {
CommandTestImpl command = new CommandTestImpl();
@@ -191,6 +185,7 @@ public void testListeners() {
}
// Test empty listener list
+ @Test
public void testEmptyListeners() {
CommandTestImpl command = new CommandTestImpl();
@@ -203,9 +198,11 @@ public void testEmptyListeners() {
// Suppress lifecycle tests since we do not have a renderer
@Override
+ @Test
public void testLifecycleManagement() {
}
+ @Test
public void testNestedCommands() {
UIViewRoot root = new UIViewRoot();
UICommand c1 = new UICommand();
@@ -229,6 +226,7 @@ public void testNestedCommands() {
assertTrue(ae.getPhaseId().equals(PhaseId.INVOKE_APPLICATION));
}
+ @Test
public void testGetActionListeners() throws Exception {
UICommand command = (UICommand) component;
UIViewRoot root = facesContext.getApplication().getViewHandler().createView(facesContext, null);
diff --git a/impl/src/test/java/jakarta/faces/component/UIComponentBaseAttachedStateTestCase.java b/impl/src/test/java/jakarta/faces/component/UIComponentBaseAttachedStateTestCase.java
index 12fd79a66f..37d97bc789 100644
--- a/impl/src/test/java/jakarta/faces/component/UIComponentBaseAttachedStateTestCase.java
+++ b/impl/src/test/java/jakarta/faces/component/UIComponentBaseAttachedStateTestCase.java
@@ -16,6 +16,11 @@
package jakarta.faces.component;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.HashSet;
@@ -23,6 +28,10 @@
import java.util.Set;
import java.util.Stack;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
import com.sun.faces.mock.MockExternalContext;
import com.sun.faces.mock.MockFacesContext;
import com.sun.faces.mock.MockHttpServletRequest;
@@ -34,29 +43,16 @@
import jakarta.faces.context.FacesContext;
import jakarta.faces.event.FacesListener;
import jakarta.faces.event.ValueChangeListener;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-public class UIComponentBaseAttachedStateTestCase extends TestCase {
+public class UIComponentBaseAttachedStateTestCase {
private MockFacesContext facesContext = null;
private MockServletContext servletContext;
private MockHttpServletRequest request;
private MockHttpServletResponse response;
- public UIComponentBaseAttachedStateTestCase(String arg0) {
- super(arg0);
- }
-
- // Return the tests included in this test case.
- public static Test suite() {
- return new TestSuite(UIComponentBaseAttachedStateTestCase.class);
- }
-
- @Override
+ @BeforeEach
public void setUp() throws Exception {
- super.setUp();
facesContext = new MockFacesContext();
servletContext = new MockServletContext();
@@ -71,9 +67,8 @@ public void setUp() throws Exception {
}
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
+ @AfterEach
+ public void tearDown() throws Exception {
FactoryFinder.releaseFactories();
Method reInitializeFactoryManager = FactoryFinder.class.getDeclaredMethod("reInitializeFactoryManager", (Class>[]) null);
reInitializeFactoryManager.setAccessible(true);
@@ -81,6 +76,7 @@ protected void tearDown() throws Exception {
}
+ @Test
public void testAttachedObjectsSet() throws Exception {
Set attachedObjects = new HashSet<>();
ValueChangeListener toAdd = new ValueChangeListenerTestImpl();
@@ -96,6 +92,7 @@ public void testAttachedObjectsSet() throws Exception {
assertNotNull(returnedAttachedObjects);
}
+ @Test
public void testAttachedObjectsStack() throws Exception {
Stack attachedObjects = new Stack<>();
ValueChangeListener toAdd = new ValueChangeListenerTestImpl();
@@ -111,6 +108,7 @@ public void testAttachedObjectsStack() throws Exception {
assertNotNull(returnedAttachedObjects);
}
+ @Test
public void testAttachedObjectsMap() throws Exception {
Map attachedObjects = new HashMap<>();
ValueChangeListener toAdd = new ValueChangeListenerTestImpl();
@@ -144,6 +142,7 @@ public void testAttachedObjectsCount() throws Exception {
assertEquals(firstSize, secondSize);
}
+ @Test
public void testFacesListenerState() {
UIComponent component = new UIOutput();
TestFacesListener listener = new TestFacesListener();
@@ -171,7 +170,7 @@ public void testFacesListenerState() {
component.addFacesListener(listener);
listener.setValue("newinitial");
component.restoreState(facesContext, state);
- assertTrue("newvalue".equals(listener.getValue()));
+ assertEquals("newvalue", listener.getValue());
// verify listeners are overwritten when using full state saving
component = new UIOutput();
@@ -185,9 +184,10 @@ public void testFacesListenerState() {
component.restoreState(facesContext, state);
TestFacesListener l = (TestFacesListener) component.getFacesListeners(TestFacesListener.class)[0];
assertTrue(l != listener);
- assertTrue("initial".equals(l.getValue()));
+ assertEquals("initial", l.getValue());
}
+ @Test
public void testTransientListenersState() {
UIComponent output = new UIOutput();
output.markInitialState();
@@ -227,6 +227,7 @@ public void testTransientListenersState() {
assertTrue(listeners.length == 0);
}
+ @Test
public void testTransientListenersState2() {
UIComponent output = new UIOutput();
TestFacesListener l1 = new TestFacesListener();
diff --git a/impl/src/test/java/jakarta/faces/component/UIComponentBaseBehaviorTestCase.java b/impl/src/test/java/jakarta/faces/component/UIComponentBaseBehaviorTestCase.java
index f5b070350e..2c8fd6a567 100644
--- a/impl/src/test/java/jakarta/faces/component/UIComponentBaseBehaviorTestCase.java
+++ b/impl/src/test/java/jakarta/faces/component/UIComponentBaseBehaviorTestCase.java
@@ -16,6 +16,10 @@
package jakarta.faces.component;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
import java.io.Serializable;
import java.util.Collection;
import java.util.Collections;
@@ -24,6 +28,8 @@
import java.util.Map;
import java.util.Set;
+import org.junit.jupiter.api.Test;
+
import jakarta.faces.component.behavior.ClientBehavior;
import jakarta.faces.component.behavior.ClientBehaviorContext;
import jakarta.faces.component.behavior.ClientBehaviorHint;
@@ -138,10 +144,6 @@ public String toString() {
}
}
- public UIComponentBaseBehaviorTestCase(String name) {
- super(name);
- }
-
/**
* Test method for {@link jakarta.faces.component.UIComponentBase#saveState(jakarta.faces.context.FacesContext)}.
*/
@@ -173,6 +175,7 @@ public void testSaveState() {
assertEquals(behavior2, behaviors.get(ONCLICK).get(1));
}
+ @Test
public void testNonClientBehaviorHolder() throws Exception {
UIInput input = new UIInput();
try {
diff --git a/impl/src/test/java/jakarta/faces/component/UIComponentBaseTestCase.java b/impl/src/test/java/jakarta/faces/component/UIComponentBaseTestCase.java
index b332ecf334..c3f39023dd 100644
--- a/impl/src/test/java/jakarta/faces/component/UIComponentBaseTestCase.java
+++ b/impl/src/test/java/jakarta/faces/component/UIComponentBaseTestCase.java
@@ -16,6 +16,12 @@
package jakarta.faces.component;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
+
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
@@ -25,6 +31,10 @@
import java.util.List;
import java.util.Map;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
import jakarta.faces.FacesException;
import jakarta.faces.context.FacesContext;
import jakarta.faces.event.AbortProcessingException;
@@ -35,8 +45,6 @@
import jakarta.faces.event.PreRenderComponentEvent;
import jakarta.faces.event.SystemEvent;
import jakarta.faces.event.SystemEventListener;
-import junit.framework.Test;
-import junit.framework.TestSuite;
/**
*
@@ -45,21 +53,10 @@
*/
public class UIComponentBaseTestCase extends UIComponentTestCase {
- // ------------------------------------------------------ Instance Variables
- // Mock object instances for our tests
- // ------------------------------------------------------------ Constructors
- /**
- * Construct a new instance of this test case.
- *
- * @param name Name of the test case
- */
- public UIComponentBaseTestCase(String name) {
- super(name);
- }
-
// ---------------------------------------------------- Overall Test Methods
// Set up instance variables required by this test case.
@Override
+ @BeforeEach
public void setUp() throws Exception {
// Set up the component under test
@@ -68,13 +65,9 @@ public void setUp() throws Exception {
}
- // Return the tests included in this test case.
- public static Test suite() {
- return new TestSuite(UIComponentBaseTestCase.class);
- }
-
// Tear down instance variables required by ths test case
@Override
+ @AfterEach
public void tearDown() throws Exception {
externalContext.setRequestParameterMap(null);
@@ -84,6 +77,7 @@ public void tearDown() throws Exception {
// ------------------------------------------------- Individual Test Methods
// Test lifecycle management methods
+ @Test
public void testLifecycleManagement() {
checkLifecycleParentRendered();
@@ -93,6 +87,7 @@ public void testLifecycleManagement() {
}
+ @Test
public void testComponentToFromEL2() throws Exception {
final FacesContext ctx = facesContext;
@@ -165,6 +160,7 @@ public void testComponentToFromEL2() throws Exception {
}
+ @Test
public void testEncodeChildren() throws Exception {
ComponentTestImpl.trace(null);
UIComponent comp1 = new ComponentTestImpl("one");
@@ -184,6 +180,7 @@ public void testEncodeChildren() throws Exception {
}
// Test recursive adding and removing child trees with ids
+ @Test
public void testChildrenRecursive() {
// Create the components we will need
@@ -219,6 +216,7 @@ public void testChildrenRecursive() {
}
+ @Test
public void testChildrenAndFacetsWithNullGetParent() throws Exception {
ComponentTestImpl child = new ComponentTestImpl() {
@Override
@@ -239,6 +237,7 @@ public UIComponent getParent() {
}
// Test reconnecting a child or facet to a different component
+ @Test
public void testComponentReconnect() {
UIComponent parent1 = new ComponentTestImpl();
@@ -292,6 +291,7 @@ public void testComponentReconnect() {
}
// Test removing components from our naming container.
+ @Test
public void testComponentRemoval() {
UIComponent testComponent = new ComponentTestImpl();
@@ -348,6 +348,7 @@ public void testComponentRemoval() {
assertTrue(!kidItr.hasNext());
}
+ @Test
public void testStateHolder2() throws Exception {
UIComponent c = new UIComponentListener();
@@ -361,6 +362,7 @@ public void testStateHolder2() throws Exception {
}
+ @Test
public void testAttributesThatAreSetStateHolder() throws Exception {
ComponentTestImpl c = new ComponentTestImpl();
c.getAttributes().put("attr1", "value1");
@@ -376,6 +378,7 @@ public void testAttributesThatAreSetStateHolder() throws Exception {
assertEquals(Arrays.asList("attr1", "attr2"), c.getAttributes().get("jakarta.faces.component.UIComponentBase.attributesThatAreSet"));
}
+ @Test
public void testValueExpressions() throws Exception {
UIComponentBase test = (UIComponentBase) component;
@@ -504,17 +507,17 @@ private void checkLifecycleParentRendered() {
// Test processDecodes()
ComponentTestImpl.trace(null);
component.processDecodes(facesContext);
- assertEquals("processDecodes", lifecycleTrace("pD", "d"), ComponentTestImpl.trace());
+ assertEquals(lifecycleTrace("pD", "d"), ComponentTestImpl.trace());
// Test processValidators()
ComponentTestImpl.trace(null);
component.processValidators(facesContext);
- assertEquals("processValidators", lifecycleTrace("pV", null), ComponentTestImpl.trace());
+ assertEquals(lifecycleTrace("pV", null), ComponentTestImpl.trace());
// Test processUpdates()
ComponentTestImpl.trace(null);
component.processUpdates(facesContext);
- assertEquals("processUpdates", lifecycleTrace("pU", null), ComponentTestImpl.trace());
+ assertEquals(lifecycleTrace("pU", null), ComponentTestImpl.trace());
}
@@ -567,17 +570,17 @@ private void checkLifecycleParentUnrendered() {
// Test processDecodes()
ComponentTestImpl.trace(null);
component.processDecodes(facesContext);
- assertEquals("processDecodes", lifecycleTrace("pD", "d"), ComponentTestImpl.trace());
+ assertEquals(lifecycleTrace("pD", "d"), ComponentTestImpl.trace());
// Test processValidators()
ComponentTestImpl.trace(null);
component.processValidators(facesContext);
- assertEquals("processValidators", lifecycleTrace("pV", null), ComponentTestImpl.trace());
+ assertEquals(lifecycleTrace("pV", null), ComponentTestImpl.trace());
// Test processUpdates()
ComponentTestImpl.trace(null);
component.processUpdates(facesContext);
- assertEquals("processUpdates", lifecycleTrace("pU", null), ComponentTestImpl.trace());
+ assertEquals(lifecycleTrace("pU", null), ComponentTestImpl.trace());
}
@@ -627,17 +630,17 @@ private void checkLifecycleSelfRendered() {
// Test processDecodes()
ComponentTestImpl.trace(null);
component.processDecodes(facesContext);
- assertEquals("processDecodes", lifecycleTrace("pD", "d"), ComponentTestImpl.trace());
+ assertEquals(lifecycleTrace("pD", "d"), ComponentTestImpl.trace());
// Test processValidators()
ComponentTestImpl.trace(null);
component.processValidators(facesContext);
- assertEquals("processValidators", lifecycleTrace("pV", null), ComponentTestImpl.trace());
+ assertEquals(lifecycleTrace("pV", null), ComponentTestImpl.trace());
// Test processUpdates()
ComponentTestImpl.trace(null);
component.processUpdates(facesContext);
- assertEquals("processUpdates", lifecycleTrace("pU", null), ComponentTestImpl.trace());
+ assertEquals(lifecycleTrace("pU", null), ComponentTestImpl.trace());
}
@@ -687,17 +690,17 @@ private void checkLifecycleSelfUnrendered() {
// Test processDecodes()
ComponentTestImpl.trace(null);
component.processDecodes(facesContext);
- assertEquals("processDecodes", lifecycleTrace("pD", "d"), ComponentTestImpl.trace());
+ assertEquals(lifecycleTrace("pD", "d"), ComponentTestImpl.trace());
// Test processValidators()
ComponentTestImpl.trace(null);
component.processValidators(facesContext);
- assertEquals("processValidators", lifecycleTrace("pV", null), ComponentTestImpl.trace());
+ assertEquals(lifecycleTrace("pV", null), ComponentTestImpl.trace());
// Test processUpdates()
ComponentTestImpl.trace(null);
component.processUpdates(facesContext);
- assertEquals("processUpdates", lifecycleTrace("pU", null), ComponentTestImpl.trace());
+ assertEquals(lifecycleTrace("pU", null), ComponentTestImpl.trace());
}
@@ -772,6 +775,7 @@ protected void lifecycleTrace(String lmethod, String cmethod, UIComponent compon
}
+ @Test
public void testGetFacetsAndChildren() {
UIComponent testComponent = new ComponentTestImpl();
@@ -829,21 +833,21 @@ public void testGetFacetsAndChildren() {
*
*
@@ -895,6 +899,7 @@ private Map setupInvokeOnComponentTree() {
return result;
}
+ @Test
public void testInvokeOnComponentPositive() throws Exception {
Map tree = setupInvokeOnComponentTree();
@@ -910,8 +915,7 @@ public void testInvokeOnComponentPositive() throws Exception {
result = root.invokeOnComponent(facesContext, input1.getClientId(facesContext), new ContextCallback() {
@Override
public void invokeContextCallback(FacesContext context, UIComponent component) {
- assertEquals("getCurrentComponent does not return the current component during" + "invokeOnComponent", UIComponent.getCurrentComponent(context),
- component);
+ assertEquals(UIComponent.getCurrentComponent(context), component);
foundComponent = component;
}
});
@@ -921,6 +925,7 @@ public void invokeContextCallback(FacesContext context, UIComponent component) {
}
+ @Test
public void testInvokeOnComponentNegative() throws Exception {
Map tree = setupInvokeOnComponentTree();
@@ -1012,6 +1017,7 @@ public void invokeContextCallback(FacesContext context, UIComponent component) {
}
+ @Test
public void testInvokeOnComponentWithPrependId() throws Exception {
Map tree = setupInvokeOnComponentTree();
@@ -1160,6 +1166,7 @@ public void invokeContextCallback(FacesContext context, UIComponent component) {
}
+ @Test
public void testChildrenListAfterAddPublish() {
Listener listener = new Listener();
@@ -1197,6 +1204,7 @@ public void testChildrenListAfterAddPublish() {
}
+ @Test
public void testFacetMapAfterAddViewPublish() {
QueueingListener listener = new QueueingListener();
@@ -1209,11 +1217,11 @@ public void testFacetMapAfterAddViewPublish() {
List e = listener.getEvents();
Map facets = c1.getFacets();
facets.put("c2", c2);
- assertTrue("Expected Event queue size of 0, found: " + e.size(), e.isEmpty());
+ assertEquals(0, e.size());
UIViewRoot root = new UIViewRoot();
root.getChildren().add(c1);
- assertTrue("Expected Event queue size of 2, found: " + e.size(), e.size() == 2);
+ assertEquals(2, e.size());
assertTrue(e.get(0).getSource() == c1);
assertTrue(e.get(1).getSource() == c2);
@@ -1223,13 +1231,13 @@ public void testFacetMapAfterAddViewPublish() {
root.getChildren().remove(c1);
facets = c1.getFacets();
facets.put("c3", c3);
- assertTrue("Expected Event queue size of 0, found: " + e.size(), e.isEmpty());
+ assertEquals(0, e.size());
// reorganize the facet structure to ensure nested facets work
facets.remove("c3");
c2.getFacets().put("c3", c3);
root.getChildren().add(c1);
- assertTrue("Expected Event queue size of 3, found: " + e.size(), e.size() == 3);
+ assertEquals(3, e.size());
assertTrue(e.get(0).getSource() == c1);
assertTrue(e.get(1).getSource() == c2);
assertTrue(e.get(2).getSource() == c3);
@@ -1239,12 +1247,13 @@ public void testFacetMapAfterAddViewPublish() {
facets.clear();
c2.getFacets().remove("c3");
c2.getFacets().put("c3", c3);
- assertTrue("Expected Event queue size of 0, found: " + e.size(), e.isEmpty());
+ assertEquals(0, e.size());
application.unsubscribeFromEvent(PostAddToViewEvent.class, listener);
}
+ @Test
public void testChildrenListAfterAddViewPublish() {
QueueingListener listener = new QueueingListener();
@@ -1265,11 +1274,11 @@ public void testChildrenListAfterAddViewPublish() {
// sub-tree has been added to the view. Ensure that subsequent additions
// to that sub-tree cause the PostAddToViewEvent to fire.
c2.getChildren().add(c4);
- assertTrue("Expected Event queue size of 4, found: " + e.size(), e.size() == 4);
+ assertEquals(4, e.size());
UIComponent[] comps = { c1, c2, c3, c4 };
for (int i = 0; i < comps.length; i++) {
- assertTrue("Index " + i + " invalid", e.get(i).getSource() == comps[i]);
+ assertTrue(e.get(i).getSource() == comps[i], "Index " + i + " invalid");
}
// remove c1 and it's children from the subview, then remove and
@@ -1279,18 +1288,18 @@ public void testChildrenListAfterAddViewPublish() {
root.getChildren().remove(c1);
c2.getChildren().remove(c4);
c2.getChildren().add(c4);
- assertTrue("AfterAddToView events queued after a sub-tree was removed from the view, and a child added to the sub-view", e.isEmpty());
+ assertEquals(0, e.size());
c2.getChildren().remove(c4);
c1.getChildren().add(c4);
- assertTrue("AfterAddToView events queued after a sub-tree was removed from the view, and a child added to the sub-view", e.isEmpty());
+ assertEquals(0, e.size());
// re-wire c1 as a child of root and ensure all children get re-notified
root.getChildren().add(c1);
- assertTrue("Expected Event queue size of 4, found: " + e.size(), e.size() == 4);
+ assertEquals(4, e.size());
for (int i = 0; i < comps.length; i++) {
- assertTrue("Index " + i + " invalid", e.get(i).getSource() == comps[i]);
+ assertTrue(e.get(i).getSource() == comps[i], "Index " + i + " invalid");
}
// validate clearing c1's children (effectively removing them from the view
@@ -1302,24 +1311,24 @@ public void testChildrenListAfterAddViewPublish() {
UIComponent temp = createComponent();
e.clear();
c2.getChildren().add(temp);
- assertTrue("AfterAddToView events queued after a sub-tree was removed from the view, and a child added to the sub-view", e.isEmpty());
+ assertEquals(0, e.size());
c2.getChildren().remove(temp);
c3.getChildren().add(temp);
- assertTrue("AfterAddToView events queued after a sub-tree was removed from the view, and a child added to the sub-view", e.isEmpty());
+ assertEquals(0, e.size());
c3.getChildren().remove(temp);
c4.getChildren().add(temp);
- assertTrue("AfterAddToView events queued after a sub-tree was removed from the view, and a child added to the sub-view", e.isEmpty());
+ assertEquals(0, e.size());
c4.getChildren().remove(temp);
// now add c2 and c4 as children of c1. This should cause three
// events to fire
c1.getChildren().add(c2);
c1.getChildren().add(c4);
- assertTrue("Expected Event queue size of 3, found: " + e.size(), e.size() == 3);
+ assertEquals(3, e.size());
UIComponent[] comps2 = { c2, c3, c4 };
for (int i = 0; i < comps2.length; i++) {
- assertTrue("Index " + i + " invalid", e.get(i).getSource() == comps2[i]);
+ assertTrue(e.get(i).getSource() == comps2[i], "Index " + i + " invalid");
}
// validate add(int, UIComponent) fires events
@@ -1329,7 +1338,7 @@ public void testChildrenListAfterAddViewPublish() {
assertTrue(c1.getChildren().get(0) == c4);
assertTrue(c1.getChildren().get(1) == c2);
- assertTrue("Expected Event queue size of 1, found: " + e.size(), e.size() == 1);
+ assertEquals(1, e.size());
assertTrue(e.get(0).getSource() == c4);
// validate addAll(Collection) fires events
@@ -1340,7 +1349,7 @@ public void testChildrenListAfterAddViewPublish() {
c1.getChildren().addAll(children);
assertTrue(c1.getChildren().get(0) == c2);
assertTrue(c1.getChildren().get(1) == c4);
- assertTrue("Expected Event queue size of 3, found: " + e.size(), e.size() == 3);
+ assertEquals(3, e.size());
assertTrue(e.get(0).getSource() == c2);
assertTrue(e.get(2).getSource() == c4);
@@ -1355,7 +1364,7 @@ public void testChildrenListAfterAddViewPublish() {
assertTrue(c1.getChildren().get(1) == t2);
assertTrue(c1.getChildren().get(2) == c2);
assertTrue(c1.getChildren().get(3) == c4);
- assertTrue("Expected Event queue size of 2, found: " + e.size(), e.size() == 2);
+ assertEquals(2, e.size());
assertTrue(e.get(0).getSource() == t1);
assertTrue(e.get(1).getSource() == t2);
@@ -1370,7 +1379,7 @@ public void testChildrenListAfterAddViewPublish() {
assertTrue(c1.getChildren().get(0) == c2);
assertTrue(c1.getChildren().get(1) == c4);
t1.getChildren().add(t2);
- assertTrue("Expected Event queue size of 0, found: " + e.size(), e.isEmpty());
+ assertEquals(0, e.size());
// test set(int, UIComponent) properly fires an event if the parent
// the component is being added to is wired to the view
@@ -1379,7 +1388,7 @@ public void testChildrenListAfterAddViewPublish() {
assertTrue(c1.getChildren().size() == 2);
assertTrue(c1.getChildren().get(0) == t1);
assertTrue(c1.getChildren().get(1) == c4);
- assertTrue("Expected Event queue size of 2, found: " + e.size(), e.size() == 2);
+ assertEquals(2, e.size());
assertTrue(e.get(0).getSource() == t1);
assertTrue(e.get(1).getSource() == t2);
@@ -1388,7 +1397,7 @@ public void testChildrenListAfterAddViewPublish() {
e.clear();
UIComponent t3 = createComponent();
c2.getChildren().add(t3);
- assertTrue("Expected Event queue size of 0, found: " + e.size(), e.isEmpty());
+ assertEquals(0, e.size());
application.unsubscribeFromEvent(PostAddToViewEvent.class, listener);
@@ -1403,17 +1412,18 @@ public void testChildrenListAfterAddViewPublish() {
// to t1, t2, or c4 should result in no events being fired
e.clear();
t1.getChildren().add(temp);
- assertTrue("AfterAddToView events queued after a sub-tree was removed from the view, and a child added to the sub-view", e.isEmpty());
+ assertEquals(0, e.size());
t1.getChildren().remove(temp);
t2.getChildren().add(temp);
- assertTrue("AfterAddToView events queued after a sub-tree was removed from the view, and a child added to the sub-view", e.isEmpty());
+ assertEquals(0, e.size());
t2.getChildren().remove(temp);
c4.getChildren().add(temp);
- assertTrue("AfterAddToView events queued after a sub-tree was removed from the view, and a child added to the sub-view", e.isEmpty());
+ assertEquals(0, e.size());
c4.getChildren().remove(temp);
}
+ @Test
public void testEncodeBeginPublish() throws Exception {
Listener listener = new Listener();
@@ -1537,7 +1547,6 @@ public static final class CustomAbortProcessingException extends AbortProcessing
private static final long serialVersionUID = 1L;
public CustomAbortProcessingException() {
- super();
}
public CustomAbortProcessingException(String message) {
diff --git a/impl/src/test/java/jakarta/faces/component/UIComponentTestCase.java b/impl/src/test/java/jakarta/faces/component/UIComponentTestCase.java
index 9143f7ae71..0e3eb7f9f9 100644
--- a/impl/src/test/java/jakarta/faces/component/UIComponentTestCase.java
+++ b/impl/src/test/java/jakarta/faces/component/UIComponentTestCase.java
@@ -16,6 +16,12 @@
package jakarta.faces.component;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
+
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
@@ -27,6 +33,10 @@
import java.util.Map;
import java.util.Set;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
import com.sun.faces.junit.JUnitFacesTestCaseBase;
import com.sun.faces.mock.MockRenderKit;
@@ -41,8 +51,6 @@
import jakarta.faces.render.RenderKitFactory;
import jakarta.faces.validator.Validator;
import jakarta.faces.validator.ValidatorException;
-import junit.framework.Test;
-import junit.framework.TestSuite;
/**
*
@@ -101,15 +109,10 @@ public UIComponent setValue(UIComponent value) {
};
- // ------------------------------------------------------------ Constructors
- // Construct a new instance of this test case.
- public UIComponentTestCase(String name) {
- super(name);
- }
-
// ---------------------------------------------------- Overall Test Methods
// Set up instance variables required by this test case.
@Override
+ @BeforeEach
public void setUp() throws Exception {
super.setUp();
@@ -133,13 +136,9 @@ public void setUp() throws Exception {
component = new ComponentTestImpl(expectedId);
}
- // Return the tests included in this test case.
- public static Test suite() {
- return new TestSuite(UIComponentTestCase.class);
- }
-
// Tear down instance variables required by this test case.
@Override
+ @AfterEach
public void tearDown() throws Exception {
component = null;
@@ -154,6 +153,7 @@ public void tearDown() throws Exception {
}
// ------------------------------------------------- Individual Test Methods
+ @Test
public void testValidationEvents() {
Listener prelistener = new Listener();
Listener postlistener = new Listener();
@@ -196,12 +196,13 @@ public void testValidationEvents() {
((UIInput) col.getChildren().get(0)).setSubmittedValue("hello");
data.setRowIndex(-1);
root.processValidators(facesContext);
- assertEquals("root/out/form/data/in/", "root/out/form/data/in/", prelistener.getResults());
- assertEquals("out/*/in/data/form/root/", "out/*/in/data/form/root/", postlistener.getResults());
+ assertEquals("root/out/form/data/in/", prelistener.getResults());
+ assertEquals("out/*/in/data/form/root/", postlistener.getResults());
}
// Test behavior of Map returned by getAttributes()
+ @Test
public void testAttributesMap() {
// Initialize some attributes
@@ -218,12 +219,12 @@ public void testAttributesMap() {
assertTrue(!attributes.containsKey("parent")); // Property name
// Test get()
- assertEquals("bar", (String) attributes.get("foo"));
- assertEquals("bop", (String) attributes.get("baz"));
+ assertEquals("bar", attributes.get("foo"));
+ assertEquals("bop", attributes.get("baz"));
assertNull(attributes.get("bar"));
assertNull(attributes.get("bop"));
component.setId("oldvalue");
- assertEquals("oldvalue", (String) attributes.get("id")); // Property
+ assertEquals("oldvalue", attributes.get("id")); // Property
component.setRendered(false);
assertTrue(!((Boolean) attributes.get("rendered")).booleanValue());
component.setRendered(true);
@@ -249,7 +250,7 @@ public void testAttributesMap() {
// Expected result
}
attributes.put("id", "newvalue");
- assertEquals("newvalue", (String) attributes.get("id"));
+ assertEquals("newvalue", attributes.get("id"));
assertEquals("newvalue", component.getId());
attributes.put("rendered", Boolean.TRUE);
assertTrue(component.isRendered());
@@ -270,6 +271,7 @@ public void testAttributesMap() {
}
// Negative tests on attribute methods
+ @Test
public void testAttributesNegative() {
// getAttributes().get() - null
@@ -291,6 +293,7 @@ public void testAttributesNegative() {
}
// Positive tests on attribute methods
+ @Test
public void testAttributesPositive() {
checkAttributeCount(component, expectedAttributes.length);
@@ -320,13 +323,14 @@ public void testAttributesPositive() {
}
// Test attribute-property transparency
+ @Test
public void testAttributesTransparency() {
assertEquals(component.getChildren(), component.getAttributes().get("children"));
assertEquals(component.getFacets(), component.getAttributes().get("facets"));
- assertEquals(component.getId(), (String) component.getAttributes().get("id"));
+ assertEquals(component.getId(), component.getAttributes().get("id"));
assertEquals(component.getParent(), component.getAttributes().get("parent"));
@@ -341,7 +345,7 @@ public void testAttributesTransparency() {
assertTrue(component.isRendered());
component.setRendererType("foo");
- assertEquals("foo", (String) component.getAttributes().get("rendererType"));
+ assertEquals("foo", component.getAttributes().get("rendererType"));
component.setRendererType(null);
assertNull(component.getAttributes().get("rendererType"));
component.getAttributes().put("rendererType", "bar");
@@ -354,6 +358,7 @@ public void testAttributesTransparency() {
}
// Test getChildren().iterator()
+ @Test
public void testChildrenIterator() {
Iterator kids;
@@ -407,6 +412,7 @@ public void testChildrenIterator() {
}
// Test getChildren().listIterator()
+ @Test
public void testChildrenListIterator() {
ListIterator kids;
@@ -581,6 +587,7 @@ public void testChildrenListIterator() {
}
// Negative tests on children methods
+ @Test
public void testChidrenNegative() {
// Construct components we will need
@@ -694,6 +701,7 @@ public void testChidrenNegative() {
}
// Positive tests on children methods
+ @Test
public void testChildrenPositive() {
// Construct components we will need
@@ -861,6 +869,7 @@ public void testChildrenPositive() {
}
// Test replacing a child with a new one that has the same id
+ @Test
public void testChidrenReplace() {
ComponentTestImpl child1 = new ComponentTestImpl("child");
@@ -881,6 +890,7 @@ public void testChidrenReplace() {
}
// Test Set returned by getFacets().entrySet()
+ @Test
public void testFacetsMapEntrySet() {
Map facets;
@@ -1067,6 +1077,7 @@ public void testFacetsMapEntrySet() {
}
// Test Set returned by getFacets().keySet()
+ @Test
public void testFacetsMapKeySet() {
Map facets;
@@ -1220,6 +1231,7 @@ public void testFacetsMapKeySet() {
}
// Test Collection returned by getFacets().values()
+ @Test
public void testFacetsMapValues() {
Map facets;
@@ -1398,6 +1410,7 @@ public void testFacetsMapValues() {
}
// Negative tests on facet methods
+ @Test
public void testFacetsNegative() {
// Construct components we will need
@@ -1441,6 +1454,7 @@ public void testFacetsNegative() {
}
// Positive tests on facet methods
+ @Test
public void testFacetsPositive() {
// Construct components we will need
@@ -1517,6 +1531,7 @@ public void testFacetsPositive() {
}
// Test a pristine UIComponent instance
+ @Test
public void testPristine() {
// Validate attributes
@@ -1526,28 +1541,29 @@ public void testPristine() {
}
// Validate properties
- assertEquals("expected family", expectedFamily, component.getFamily());
- assertEquals("expected id", expectedId, component.getId());
- assertNull("no parent", component.getParent());
- assertEquals("expected rendered", expectedRendered, component.isRendered());
- assertEquals("expected rendererType", expectedRendererType, component.getRendererType());
- assertEquals("expected rendersChildren", expectedRendersChildren, component.getRendersChildren());
+ assertEquals(expectedFamily, component.getFamily());
+ assertEquals(expectedId, component.getId());
+ assertNull(component.getParent());
+ assertEquals(expectedRendered, component.isRendered());
+ assertEquals(expectedRendererType, component.getRendererType());
+ assertEquals(expectedRendersChildren, component.getRendersChildren());
// Validate children and facets
checkChildCount(component, 0);
checkFacetCount(component, 0);
int n = 0;
Iterator> items = component.getFacetsAndChildren();
- assertNotNull("iterator returned", items);
+ assertNotNull(items);
while (items.hasNext()) {
items.next();
n++;
}
- assertEquals("facets and children", 0, n);
+ assertEquals(0, n);
}
// Test setting properties to invalid values
+ @Test
public void testPropertiesInvalid() throws Exception {
// id - zero length
@@ -1593,28 +1609,29 @@ public void testPropertiesInvalid() throws Exception {
}
// Test setting properties to valid values
+ @Test
public void testPropertiesValid() throws Exception {
// id - simple name
component.setId("foo");
- assertEquals("expected id", "foo", component.getId());
+ assertEquals("foo", component.getId());
// id - complex name
component.setId("a123-bcd_e");
- assertEquals("expected id", "a123-bcd_e", component.getId());
+ assertEquals("a123-bcd_e", component.getId());
// parent
UIComponent parent = new ComponentTestImpl("parent");
component.setParent(parent);
- assertEquals("expected parent", parent, component.getParent());
+ assertEquals(parent, component.getParent());
// rendered
component.setRendered(!expectedRendered);
- assertEquals("expected rendered", !expectedRendered, component.isRendered());
+ assertEquals(!expectedRendered, component.isRendered());
// rendererType
component.setRendererType("foo");
- assertEquals("expected rendererType", "foo", component.getRendererType());
+ assertEquals("foo", component.getRendererType());
}
@@ -1627,12 +1644,12 @@ protected void checkAttributeCount(UIComponent component, int count) {
names.next();
result++;
}
- assertEquals("attribute count", count, result);
+ assertEquals(count, result);
}
// Validate that the specified attribute name is not present
protected void checkAttributeMissing(UIComponent component, String name) {
- assertNull("Attribute " + name + " should be missing", component.getAttributes().get(name));
+ assertNull(component.getAttributes().get(name), "Attribute " + name + " should be missing");
Iterator> keys = component.getAttributes().keySet().iterator();
while (keys.hasNext()) {
String key = (String) keys.next();
@@ -1645,16 +1662,16 @@ protected void checkAttributeMissing(UIComponent component, String name) {
// Validate that the specified attribute name is present with the
// specified value (if value is not null)
protected void checkAttributePresent(UIComponent component, String name, Object value) {
- assertNotNull("attribute " + name + " should be present", component.getAttributes().get(name));
+ assertNotNull(component.getAttributes().get(name), "attribute " + name + " should be present");
if (value != null) {
- assertEquals("attribute " + name + " value should be equal", value, component.getAttributes().get(name));
+ assertEquals(value, component.getAttributes().get(name));
}
Iterator> keys = component.getAttributes().keySet().iterator();
while (keys.hasNext()) {
String key = (String) keys.next();
if (name.equals(key)) {
if (value != null) {
- assertEquals("attribute " + name + " value should match", value, component.getAttributes().get(name));
+ assertEquals(value, component.getAttributes().get(name));
}
return;
}
@@ -1665,22 +1682,22 @@ protected void checkAttributePresent(UIComponent component, String name, Object
// Validate that the specified number of children are present
protected void checkChildCount(UIComponent component, int count) {
- assertEquals("child count 1", count, component.getChildCount());
- assertEquals("child count 2", count, component.getChildren().size());
- assertEquals("child count 3", count, component.getChildCount());
+ assertEquals(count, component.getChildCount());
+ assertEquals(count, component.getChildren().size());
+ assertEquals(count, component.getChildCount());
if (count == 0) {
- assertTrue("children empty", component.getChildren().isEmpty());
+ assertTrue(component.getChildren().isEmpty());
} else {
- assertTrue("children not empty", !component.getChildren().isEmpty());
+ assertTrue(!component.getChildren().isEmpty());
}
}
// Validate that the specified child is not present
protected void checkChildMissing(UIComponent component, UIComponent child) {
- assertNull("child " + child + " has no parent", child.getParent());
+ assertNull(child.getParent(), "child " + child + " has no parent");
List> children = component.getChildren();
- assertTrue("child " + child + " should not be contained", !children.contains(child));
- assertEquals("child " + child + " should not be found by indexOf", -1, children.indexOf(child));
+ assertTrue(!children.contains(child), "child " + child + " should not be contained");
+ assertEquals(-1, children.indexOf(child));
for (int i = 0; i < children.size(); i++) {
if (child.equals(children.get(i))) {
fail("child " + child + " should be missing");
@@ -1691,31 +1708,31 @@ protected void checkChildMissing(UIComponent component, UIComponent child) {
// Validate that the specified child is present at the specified index
protected void checkChildPresent(UIComponent component, UIComponent child, int index) {
List children = component.getChildren();
- assertTrue("child " + child + " should be contained", children.contains(child));
- assertEquals("child " + child + " should be found by indexOf", index, children.indexOf(child));
+ assertTrue(children.contains(child), "child " + child + " should be contained");
+ assertEquals(index, children.indexOf(child));
UIComponent kid = children.get(index);
- assertEquals("child " + child + " should be present", child, kid);
- assertEquals("child " + child + " has correct parent", component, kid.getParent());
+ assertEquals(child, kid);
+ assertEquals(component, kid.getParent());
}
// Validate that the specified number of facets is present
protected void checkFacetCount(UIComponent component, int count) {
- assertEquals("facet count", count, component.getFacets().size());
+ assertEquals(count, component.getFacets().size());
if (count == 0) {
- assertTrue("facets empty", component.getFacets().isEmpty());
+ assertTrue(component.getFacets().isEmpty());
} else {
- assertTrue("facets not empty", !component.getFacets().isEmpty());
+ assertTrue(!component.getFacets().isEmpty());
}
}
// Validate that the specified facet is not present
protected void checkFacetMissing(UIComponent component, String name, UIComponent facet) {
- assertNull("facet " + name + " has no parent", facet.getParent());
+ assertNull(facet.getParent(), "facet " + name + " has no parent");
Map facets = component.getFacets();
- assertTrue("facet " + name + " key not present", !facets.containsKey(name));
- assertTrue("facet " + name + " value not present", !facets.containsValue(facet));
- assertNull("facet " + name + " key not found by get", facets.get(name));
- assertNull("facet " + name + " not returned by getFacet(String)", component.getFacet(name));
+ assertTrue(!facets.containsKey(name), "facet " + name + " key not present");
+ assertTrue(!facets.containsValue(facet), "facet " + name + " value not present");
+ assertNull(facets.get(name), "facet " + name + " key not found by get");
+ assertNull(component.getFacet(name), "facet " + name + " not returned by getFacet(String)");
Iterator keys = facets.keySet().iterator();
while (keys.hasNext()) {
String key = keys.next();
@@ -1735,12 +1752,12 @@ protected void checkFacetMissing(UIComponent component, String name, UIComponent
// Validate that the specified facet is present
protected void checkFacetPresent(UIComponent component, String name, UIComponent facet) {
- assertEquals("facet " + name + " has correct parent", component, facet.getParent());
+ assertEquals(component, facet.getParent());
Map facets = component.getFacets();
- assertTrue("facet " + name + " key is present", facets.containsKey(name));
- assertTrue("facet " + name + " value is present", facets.containsValue(facet));
- assertEquals("facet " + name + " has correct value", facet, facets.get(name));
- assertTrue("facet " + name + " returned by getFacet(String)", facet == component.getFacet(name));
+ assertTrue(facets.containsKey(name), "facet " + name + " key is present");
+ assertTrue(facets.containsValue(facet), "facet " + name + " value is present");
+ assertEquals(facet, facets.get(name));
+ assertTrue(facet == component.getFacet(name), "facet " + name + " returned by getFacet(String)");
boolean found = false;
Iterator keys = facets.keySet().iterator();
while (keys.hasNext()) {
diff --git a/impl/src/test/java/jakarta/faces/component/UIDataTest.java b/impl/src/test/java/jakarta/faces/component/UIDataTest.java
index 392d89a727..7b91edecb3 100644
--- a/impl/src/test/java/jakarta/faces/component/UIDataTest.java
+++ b/impl/src/test/java/jakarta/faces/component/UIDataTest.java
@@ -21,14 +21,11 @@
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
import static org.powermock.api.easymock.PowerMock.createNicePartialMockAndInvokeDefaultConstructor;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.powermock.reflect.Whitebox;
import jakarta.faces.context.FacesContext;
@@ -96,6 +93,6 @@ public void setRowIndex(int rowIndex) {
data.invokeOnComponent(context, "differentId", (contextInLambda, target) -> {
});
- assertThat(context.getAttributes().get("setRowIndexCalled"), is(nullValue()));
+ assertNull(context.getAttributes().get("setRowIndexCalled"));
}
}
diff --git a/impl/src/test/java/jakarta/faces/component/UIGraphicTestCase.java b/impl/src/test/java/jakarta/faces/component/UIGraphicTestCase.java
index e3399e052f..01380c37da 100644
--- a/impl/src/test/java/jakarta/faces/component/UIGraphicTestCase.java
+++ b/impl/src/test/java/jakarta/faces/component/UIGraphicTestCase.java
@@ -16,8 +16,11 @@
package jakarta.faces.component;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
/**
*
@@ -26,19 +29,10 @@
*/
public class UIGraphicTestCase extends UIComponentBaseTestCase {
- // ------------------------------------------------------------ Constructors
- /**
- * Construct a new instance of this test case.
- *
- * @param name Name of the test case
- */
- public UIGraphicTestCase(String name) {
- super(name);
- }
-
// ---------------------------------------------------- Overall Test Methods
// Set up instance variables required by this test case.
@Override
+ @BeforeEach
public void setUp() throws Exception {
super.setUp();
component = new UIGraphic();
@@ -47,14 +41,10 @@ public void setUp() throws Exception {
expectedRendererType = "jakarta.faces.Image";
}
- // Return the tests included in this test case.
- public static Test suite() {
- return new TestSuite(UIGraphicTestCase.class);
- }
-
// ------------------------------------------------- Individual Test Methods
// Test attribute-property transparency
@Override
+ @Test
public void testAttributesTransparency() {
super.testAttributesTransparency();
@@ -62,7 +52,7 @@ public void testAttributesTransparency() {
assertEquals(graphic.getValue(), component.getAttributes().get("value"));
graphic.setValue("foo");
- assertEquals("foo", (String) component.getAttributes().get("value"));
+ assertEquals("foo", component.getAttributes().get("value"));
graphic.setValue(null);
assertNull(component.getAttributes().get("value"));
component.getAttributes().put("value", "bar");
@@ -70,9 +60,9 @@ public void testAttributesTransparency() {
component.getAttributes().put("value", null);
assertNull(graphic.getValue());
- assertEquals(graphic.getUrl(), (String) graphic.getAttributes().get("url"));
+ assertEquals(graphic.getUrl(), graphic.getAttributes().get("url"));
graphic.setUrl("foo");
- assertEquals("foo", (String) graphic.getAttributes().get("url"));
+ assertEquals("foo", graphic.getAttributes().get("url"));
graphic.setUrl(null);
assertNull(graphic.getAttributes().get("url"));
graphic.getAttributes().put("url", "bar");
@@ -83,21 +73,24 @@ public void testAttributesTransparency() {
// Suppress lifecycle tests since we do not have a renderer
@Override
+ @Test
public void testLifecycleManagement() {
}
// Test a pristine UIGraphic instance
@Override
+ @Test
public void testPristine() {
super.testPristine();
UIGraphic graphic = (UIGraphic) component;
- assertNull("no value", graphic.getValue());
- assertNull("no url", graphic.getUrl());
+ assertNull(graphic.getValue());
+ assertNull(graphic.getUrl());
}
// Test setting properties to invalid values
@Override
+ @Test
public void testPropertiesInvalid() throws Exception {
super.testPropertiesInvalid();
}
diff --git a/impl/src/test/java/jakarta/faces/component/UIInputTest.java b/impl/src/test/java/jakarta/faces/component/UIInputTest.java
index 173c294502..80c174175a 100644
--- a/impl/src/test/java/jakarta/faces/component/UIInputTest.java
+++ b/impl/src/test/java/jakarta/faces/component/UIInputTest.java
@@ -18,12 +18,13 @@
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import org.easymock.EasyMock;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import jakarta.faces.context.FacesContext;
import jakarta.faces.validator.LengthValidator;
@@ -44,10 +45,10 @@ public void testSaveState() {
verify(context);
}
- @Test(expected = NullPointerException.class)
+ @Test
public void testSaveState2() {
UIInput input = new UIInput();
- input.saveState(null);
+ assertThrows(NullPointerException.class, () -> input.saveState(null));
}
@Test
@@ -89,12 +90,12 @@ public void testRestoreState() {
verify(context);
}
- @Test(expected = NullPointerException.class)
+ @Test
public void testRestoreState2() {
FacesContext context = EasyMock.createMock(FacesContext.class);
UIInput input = new UIInput();
replay(context);
- input.restoreState(null, null);
+ assertThrows(NullPointerException.class, () -> input.restoreState(null, null));
verify(context);
}
diff --git a/impl/src/test/java/jakarta/faces/component/UIInputTestCase.java b/impl/src/test/java/jakarta/faces/component/UIInputTestCase.java
index 339ff2d173..1013cd5732 100644
--- a/impl/src/test/java/jakarta/faces/component/UIInputTestCase.java
+++ b/impl/src/test/java/jakarta/faces/component/UIInputTestCase.java
@@ -16,16 +16,22 @@
package jakarta.faces.component;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
import java.util.Iterator;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
import jakarta.faces.application.FacesMessage;
import jakarta.faces.context.FacesContext;
import jakarta.faces.event.PhaseId;
import jakarta.faces.event.ValueChangeEvent;
import jakarta.faces.event.ValueChangeListener;
import jakarta.faces.validator.Validator;
-import junit.framework.Test;
-import junit.framework.TestSuite;
/**
*
@@ -34,19 +40,10 @@
*/
public class UIInputTestCase extends UIOutputTestCase {
- // ------------------------------------------------------------ Constructors
- /**
- * Construct a new instance of this test case.
- *
- * @param name Name of the test case
- */
- public UIInputTestCase(String name) {
- super(name);
- }
-
// ---------------------------------------------------- Overall Test Methods
// Set up instance variables required by this test case.
@Override
+ @BeforeEach
public void setUp() throws Exception {
super.setUp();
component = new UIInput();
@@ -54,21 +51,17 @@ public void setUp() throws Exception {
expectedRendererType = "jakarta.faces.Text";
}
- // Return the tests included in this test case.
- public static Test suite() {
- return new TestSuite(UIInputTestCase.class);
- }
-
// ------------------------------------------------- Individual Test Methods
// Test attribute-property transparency
@Override
+ @Test
public void testAttributesTransparency() {
super.testAttributesTransparency();
UIInput input = (UIInput) component;
assertEquals(input.getSubmittedValue(), input.getAttributes().get("submittedValue"));
input.setSubmittedValue("foo");
- assertEquals("foo", (String) input.getAttributes().get("submittedValue"));
+ assertEquals("foo", input.getAttributes().get("submittedValue"));
input.setSubmittedValue(null);
assertNull(input.getAttributes().get("submittedValue"));
input.getAttributes().put("submittedValue", "bar");
@@ -95,6 +88,7 @@ public void testAttributesTransparency() {
}
// Test the compareValues() method
+ @Test
public void testCompareValues() {
InputTestImpl input = new InputTestImpl();
Object value1a = "foo";
@@ -115,6 +109,7 @@ public void testCompareValues() {
}
// Test event queuing and broadcasting (any phase listeners)
+ @Test
public void testEventsGeneric() {
UIInput input = (UIInput) component;
ValueChangeEvent event = new ValueChangeEvent(input, null, null);
@@ -131,6 +126,7 @@ public void testEventsGeneric() {
}
// Test event queuing and broadcasting (mixed phase listeners)
+ @Test
public void testEventsMixed() {
UIInput input = (UIInput) component;
input.setRendererType(null);
@@ -164,6 +160,7 @@ public void testEventsMixed() {
}
// Test listener registration and deregistration
+ @Test
public void testListeners() {
InputTestImpl input = new InputTestImpl();
@@ -181,6 +178,7 @@ public void testListeners() {
}
// Test empty listener list
+ @Test
public void testEmptyListeners() {
InputTestImpl input = new InputTestImpl();
@@ -191,24 +189,27 @@ public void testEmptyListeners() {
// Test a pristine UIInput instance
@Override
+ @Test
public void testPristine() {
super.testPristine();
UIInput input = (UIInput) component;
- assertNull("no submittedValue", input.getSubmittedValue());
- assertTrue("not required", !input.isRequired());
- assertTrue("is valid", input.isValid());
- assertTrue("is not immediate", !input.isImmediate());
+ assertNull(input.getSubmittedValue());
+ assertTrue(!input.isRequired());
+ assertTrue(input.isValid());
+ assertTrue(!input.isImmediate());
}
// Test setting properties to invalid values
@Override
+ @Test
public void testPropertiesInvalid() throws Exception {
super.testPropertiesInvalid();
UIInput input = (UIInput) component;
}
// Test validation of a required field
+ @Test
public void testValidateRequired() throws Exception {
UIViewRoot root = facesContext.getApplication().getViewHandler().createView(facesContext, null);
root.getChildren().add(component);
@@ -245,6 +246,7 @@ public void testValidateRequired() throws Exception {
assertTrue(input.isValid());
}
+ @Test
public void testGetValueChangeListeners() throws Exception {
UIInput command = (UIInput) component;
UIViewRoot root = facesContext.getApplication().getViewHandler().createView(facesContext, null);
@@ -269,11 +271,11 @@ protected void checkMessages(int expected) {
Iterator messages = facesContext.getMessages();
while (messages.hasNext()) {
FacesMessage message = messages.next();
- assertEquals("Severity == ERROR", FacesMessage.SEVERITY_ERROR, message.getSeverity());
+ assertEquals(FacesMessage.SEVERITY_ERROR, message.getSeverity());
n++;
// System.err.println(message.getSummary());
}
- assertEquals("expected message count", expected, n);
+ assertEquals(expected, n);
}
// Create a pristine component of the type to be used in state holder tests
diff --git a/impl/src/test/java/jakarta/faces/component/UIOutputAttachedObjectStateTestCase.java b/impl/src/test/java/jakarta/faces/component/UIOutputAttachedObjectStateTestCase.java
index 4f99e07294..cabd4b5704 100644
--- a/impl/src/test/java/jakarta/faces/component/UIOutputAttachedObjectStateTestCase.java
+++ b/impl/src/test/java/jakarta/faces/component/UIOutputAttachedObjectStateTestCase.java
@@ -16,8 +16,17 @@
package jakarta.faces.component;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
import java.lang.reflect.Method;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
import com.sun.faces.mock.MockExternalContext;
import com.sun.faces.mock.MockFacesContext;
import com.sun.faces.mock.MockHttpServletRequest;
@@ -28,29 +37,16 @@
import jakarta.faces.FactoryFinder;
import jakarta.faces.convert.Converter;
import jakarta.faces.convert.DateTimeConverter;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-public class UIOutputAttachedObjectStateTestCase extends TestCase {
+public class UIOutputAttachedObjectStateTestCase {
private MockFacesContext facesContext = null;
private MockServletContext servletContext;
private MockHttpServletRequest request;
private MockHttpServletResponse response;
- public UIOutputAttachedObjectStateTestCase(String arg0) {
- super(arg0);
- }
-
- // Return the tests included in this test case.
- public static Test suite() {
- return new TestSuite(UIOutputAttachedObjectStateTestCase.class);
- }
-
- @Override
+ @BeforeEach
public void setUp() throws Exception {
- super.setUp();
facesContext = new MockFacesContext();
facesContext = new MockFacesContext();
@@ -66,9 +62,8 @@ public void setUp() throws Exception {
}
- @Override
+ @AfterEach
protected void tearDown() throws Exception {
- super.tearDown();
FactoryFinder.releaseFactories();
Method reInitializeFactoryManager = FactoryFinder.class.getDeclaredMethod("reInitializeFactoryManager", (Class>[]) null);
reInitializeFactoryManager.setAccessible(true);
@@ -76,6 +71,8 @@ protected void tearDown() throws Exception {
}
// ------------------------------------------------------------ Test Methods
+
+ @Test
public void testConverterState() {
UIOutput output = new UIOutput();
DateTimeConverter converter = new DateTimeConverter();
@@ -124,7 +121,7 @@ public void testConverterState() {
// for the component.
output.restoreState(facesContext, state);
assertTrue(output.getConverter() != null);
- assertTrue("dd-MM-yy".equals(converter.getPattern()));
+ assertEquals("dd-MM-yy", converter.getPattern());
// now validate the case where UIOutput has some event
// that adds a converter *after* initial state has been
@@ -154,6 +151,6 @@ public void testConverterState() {
assertNotNull(c);
assertTrue(c instanceof DateTimeConverter);
converter = (DateTimeConverter) c;
- assertTrue("dd-MM-yy".equals(converter.getPattern()));
+ assertEquals("dd-MM-yy", converter.getPattern());
}
}
diff --git a/impl/src/test/java/jakarta/faces/component/UIOutputTestCase.java b/impl/src/test/java/jakarta/faces/component/UIOutputTestCase.java
index e8520ade88..c5a620a011 100644
--- a/impl/src/test/java/jakarta/faces/component/UIOutputTestCase.java
+++ b/impl/src/test/java/jakarta/faces/component/UIOutputTestCase.java
@@ -16,8 +16,8 @@
package jakarta.faces.component;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
/**
*
@@ -26,19 +26,10 @@
*/
public class UIOutputTestCase extends ValueHolderTestCaseBase {
- // ------------------------------------------------------------ Constructors
- /**
- * Construct a new instance of this test case.
- *
- * @param name Name of the test case
- */
- public UIOutputTestCase(String name) {
- super(name);
- }
-
// ---------------------------------------------------- Overall Test Methods
// Set up instance variables required by this test case.
@Override
+ @BeforeEach
public void setUp() throws Exception {
super.setUp();
component = new UIOutput();
@@ -47,14 +38,10 @@ public void setUp() throws Exception {
expectedRendererType = "jakarta.faces.Text";
}
- // Return the tests included in this test case.
- public static Test suite() {
- return new TestSuite(UIOutputTestCase.class);
- }
-
// ------------------------------------------------- Individual Test Methods
// Suppress lifecycle tests since we do not have a renderer
@Override
+ @Test
public void testLifecycleManagement() {
}
diff --git a/impl/src/test/java/jakarta/faces/component/UIPanelTestCase.java b/impl/src/test/java/jakarta/faces/component/UIPanelTestCase.java
index e79b15d395..d551eaaa97 100644
--- a/impl/src/test/java/jakarta/faces/component/UIPanelTestCase.java
+++ b/impl/src/test/java/jakarta/faces/component/UIPanelTestCase.java
@@ -16,8 +16,8 @@
package jakarta.faces.component;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
/**
*
@@ -26,19 +26,10 @@
*/
public class UIPanelTestCase extends UIComponentBaseTestCase {
- // ------------------------------------------------------------ Constructors
- /**
- * Construct a new instance of this test case.
- *
- * @param name Name of the test case
- */
- public UIPanelTestCase(String name) {
- super(name);
- }
-
// ---------------------------------------------------- Overall Test Methods
// Set up instance variables required by this test case.
@Override
+ @BeforeEach
public void setUp() throws Exception {
super.setUp();
component = new UIPanel();
@@ -48,14 +39,10 @@ public void setUp() throws Exception {
expectedRendersChildren = false;
}
- // Return the tests included in this test case.
- public static Test suite() {
- return new TestSuite(UIPanelTestCase.class);
- }
-
// ------------------------------------------------- Individual Test Methods
// Suppress lifecycle tests since we do not have a renderer
@Override
+ @Test
public void testLifecycleManagement() {
}
diff --git a/impl/src/test/java/jakarta/faces/component/UIParameterTest.java b/impl/src/test/java/jakarta/faces/component/UIParameterTest.java
index 9b53117b78..8fa156263a 100644
--- a/impl/src/test/java/jakarta/faces/component/UIParameterTest.java
+++ b/impl/src/test/java/jakarta/faces/component/UIParameterTest.java
@@ -19,11 +19,11 @@
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.lang.reflect.Method;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.powermock.api.easymock.PowerMock;
import jakarta.el.ELContext;
diff --git a/impl/src/test/java/jakarta/faces/component/UIParameterTestCase.java b/impl/src/test/java/jakarta/faces/component/UIParameterTestCase.java
index d720720e29..a8b312a8cb 100644
--- a/impl/src/test/java/jakarta/faces/component/UIParameterTestCase.java
+++ b/impl/src/test/java/jakarta/faces/component/UIParameterTestCase.java
@@ -16,8 +16,11 @@
package jakarta.faces.component;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
/**
*
@@ -26,19 +29,10 @@
*/
public class UIParameterTestCase extends UIComponentBaseTestCase {
- // ------------------------------------------------------------ Constructors
- /**
- * Construct a new instance of this test case.
- *
- * @param name Name of the test case
- */
- public UIParameterTestCase(String name) {
- super(name);
- }
-
// ---------------------------------------------------- Overall Test Methods
// Set up instance variables required by this test case.
@Override
+ @BeforeEach
public void setUp() throws Exception {
super.setUp();
component = new UIParameter();
@@ -47,21 +41,17 @@ public void setUp() throws Exception {
expectedRendererType = null;
}
- // Return the tests included in this test case.
- public static Test suite() {
- return new TestSuite(UIParameterTestCase.class);
- }
-
// ------------------------------------------------- Individual Test Methods
// Test attribute-property transparency
@Override
+ @Test
public void testAttributesTransparency() {
super.testAttributesTransparency();
UIParameter parameter = (UIParameter) component;
assertEquals(parameter.getValue(), component.getAttributes().get("value"));
parameter.setValue("foo");
- assertEquals("foo", (String) component.getAttributes().get("value"));
+ assertEquals("foo", component.getAttributes().get("value"));
parameter.setValue(null);
assertNull(component.getAttributes().get("value"));
component.getAttributes().put("value", "bar");
@@ -69,9 +59,9 @@ public void testAttributesTransparency() {
component.getAttributes().put("value", null);
assertNull(parameter.getValue());
- assertEquals(parameter.getName(), (String) parameter.getAttributes().get("name"));
+ assertEquals(parameter.getName(), parameter.getAttributes().get("name"));
parameter.setName("foo");
- assertEquals("foo", (String) parameter.getAttributes().get("name"));
+ assertEquals("foo", parameter.getAttributes().get("name"));
parameter.setName(null);
assertNull(parameter.getAttributes().get("name"));
parameter.getAttributes().put("name", "bar");
@@ -82,30 +72,33 @@ public void testAttributesTransparency() {
// Suppress lifecycle tests since we do not have a renderer
@Override
+ @Test
public void testLifecycleManagement() {
}
// Test a pristine UIParameter instance
@Override
+ @Test
public void testPristine() {
super.testPristine();
UIParameter parameter = (UIParameter) component;
- assertNull("no value", parameter.getValue());
- assertNull("no name", parameter.getName());
+ assertNull(parameter.getValue());
+ assertNull(parameter.getName());
}
// Test setting properties to valid values
@Override
+ @Test
public void testPropertiesValid() throws Exception {
super.testPropertiesValid();
UIParameter parameter = (UIParameter) component;
// value
parameter.setValue("foo.bar");
- assertEquals("expected value", "foo.bar", parameter.getValue());
+ assertEquals("foo.bar", parameter.getValue());
parameter.setValue(null);
- assertNull("erased value", parameter.getValue());
+ assertNull(parameter.getValue());
parameter.setName("foo");
assertEquals("foo", parameter.getName());
diff --git a/impl/src/test/java/jakarta/faces/component/UISelectBooleanTestCase.java b/impl/src/test/java/jakarta/faces/component/UISelectBooleanTestCase.java
index 00e01b26bf..423bf4c708 100644
--- a/impl/src/test/java/jakarta/faces/component/UISelectBooleanTestCase.java
+++ b/impl/src/test/java/jakarta/faces/component/UISelectBooleanTestCase.java
@@ -16,8 +16,11 @@
package jakarta.faces.component;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
/**
*
@@ -26,19 +29,10 @@
*/
public class UISelectBooleanTestCase extends UIInputTestCase {
- // ------------------------------------------------------------ Constructors
- /**
- * Construct a new instance of this test case.
- *
- * @param name Name of the test case
- */
- public UISelectBooleanTestCase(String name) {
- super(name);
- }
-
// ---------------------------------------------------- Overall Test Methods
// Set up instance variables required by this test case.
@Override
+ @BeforeEach
public void setUp() throws Exception {
super.setUp();
component = new UISelectBoolean();
@@ -46,14 +40,10 @@ public void setUp() throws Exception {
expectedRendererType = "jakarta.faces.Checkbox";
}
- // Return the tests included in this test case.
- public static Test suite() {
- return new TestSuite(UISelectBooleanTestCase.class);
- }
-
// ------------------------------------------------- Individual Test Methods
// Test attribute-property transparency
@Override
+ @Test
public void testAttributesTransparency() {
super.testAttributesTransparency();
UISelectBoolean selectBoolean = (UISelectBoolean) component;
@@ -70,10 +60,11 @@ public void testAttributesTransparency() {
// Test a pristine UISelectBoolean instance
@Override
+ @Test
public void testPristine() {
super.testPristine();
UISelectBoolean selectBoolean = (UISelectBoolean) component;
- assertTrue("not selected", !selectBoolean.isSelected());
+ assertTrue(!selectBoolean.isSelected());
}
// --------------------------------------------------------- Support Methods
diff --git a/impl/src/test/java/jakarta/faces/component/UISelectItemSub.java b/impl/src/test/java/jakarta/faces/component/UISelectItemSub.java
index fd58550a6d..bdb949ae80 100644
--- a/impl/src/test/java/jakarta/faces/component/UISelectItemSub.java
+++ b/impl/src/test/java/jakarta/faces/component/UISelectItemSub.java
@@ -19,7 +19,6 @@
public class UISelectItemSub extends UISelectItem {
public UISelectItemSub(String value, String label, String description) {
- super();
setItemValue(value);
setItemLabel(label);
setItemDescription(description);
diff --git a/impl/src/test/java/jakarta/faces/component/UISelectItemTestCase.java b/impl/src/test/java/jakarta/faces/component/UISelectItemTestCase.java
index ead566ec80..4cb3712e38 100644
--- a/impl/src/test/java/jakarta/faces/component/UISelectItemTestCase.java
+++ b/impl/src/test/java/jakarta/faces/component/UISelectItemTestCase.java
@@ -16,9 +16,15 @@
package jakarta.faces.component;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
import jakarta.faces.model.SelectItem;
-import junit.framework.Test;
-import junit.framework.TestSuite;
/**
*
@@ -27,19 +33,10 @@
*/
public class UISelectItemTestCase extends UIComponentBaseTestCase {
- // ------------------------------------------------------------ Constructors
- /**
- * Construct a new instance of this test case.
- *
- * @param name Name of the test case
- */
- public UISelectItemTestCase(String name) {
- super(name);
- }
-
// ---------------------------------------------------- Overall Test Methods
// Set up instance variables required by this test case.
@Override
+ @BeforeEach
public void setUp() throws Exception {
super.setUp();
component = new UISelectItem();
@@ -48,19 +45,16 @@ public void setUp() throws Exception {
expectedRendererType = null;
}
- // Return the tests included in this test case.
- public static Test suite() {
- return new TestSuite(UISelectItemTestCase.class);
- }
-
// ------------------------------------------------- Individual Test Methods
// Suppress lifecycle tests since we do not have a renderer
@Override
+ @Test
public void testLifecycleManagement() {
}
// Test attribute-property transparency
@Override
+ @Test
public void testAttributesTransparency() {
super.testAttributesTransparency();
UISelectItem selectItem = (UISelectItem) component;
@@ -77,9 +71,9 @@ public void testAttributesTransparency() {
component.getAttributes().put("value", null);
assertNull(selectItem.getValue());
- assertEquals(selectItem.getItemDescription(), (String) selectItem.getAttributes().get("itemDescription"));
+ assertEquals(selectItem.getItemDescription(), selectItem.getAttributes().get("itemDescription"));
selectItem.setItemDescription("foo");
- assertEquals("foo", (String) selectItem.getAttributes().get("itemDescription"));
+ assertEquals("foo", selectItem.getAttributes().get("itemDescription"));
selectItem.setItemDescription(null);
assertNull(selectItem.getAttributes().get("itemDescription"));
selectItem.getAttributes().put("itemDescription", "bar");
@@ -97,9 +91,9 @@ public void testAttributesTransparency() {
selectItem.getAttributes().put("itemDisabled", Boolean.TRUE);
assertTrue(selectItem.isItemDisabled());
- assertEquals(selectItem.getItemLabel(), (String) selectItem.getAttributes().get("itemLabel"));
+ assertEquals(selectItem.getItemLabel(), selectItem.getAttributes().get("itemLabel"));
selectItem.setItemLabel("foo");
- assertEquals("foo", (String) selectItem.getAttributes().get("itemLabel"));
+ assertEquals("foo", selectItem.getAttributes().get("itemLabel"));
selectItem.setItemLabel(null);
assertNull(selectItem.getAttributes().get("itemLabel"));
selectItem.getAttributes().put("itemLabel", "bar");
@@ -109,7 +103,7 @@ public void testAttributesTransparency() {
assertEquals(selectItem.getItemValue(), selectItem.getAttributes().get("itemValue"));
selectItem.setItemValue("foo");
- assertEquals("foo", (String) selectItem.getAttributes().get("itemValue"));
+ assertEquals("foo", selectItem.getAttributes().get("itemValue"));
selectItem.setItemValue(null);
assertNull(selectItem.getAttributes().get("itemValue"));
selectItem.getAttributes().put("itemValue", "bar");
@@ -120,19 +114,21 @@ public void testAttributesTransparency() {
// Test a pristine UISelectItem instance
@Override
+ @Test
public void testPristine() {
super.testPristine();
UISelectItem selectItem = (UISelectItem) component;
- assertNull("no value", selectItem.getValue());
- assertNull("no itemDescription", selectItem.getItemDescription());
- assertFalse("no itemDisabled", selectItem.isItemDisabled());
- assertNull("no itemLabel", selectItem.getItemLabel());
- assertNull("no itemValue", selectItem.getItemValue());
+ assertNull(selectItem.getValue());
+ assertNull(selectItem.getItemDescription());
+ assertFalse(selectItem.isItemDisabled());
+ assertNull(selectItem.getItemLabel());
+ assertNull(selectItem.getItemValue());
}
// Test setting properties to valid values
@Override
+ @Test
public void testPropertiesValid() throws Exception {
super.testPropertiesValid();
UISelectItem selectItem = (UISelectItem) component;
@@ -140,9 +136,9 @@ public void testPropertiesValid() throws Exception {
// value
SelectItem item = new SelectItem("foo");
selectItem.setValue(item);
- assertEquals("expected value", item, selectItem.getValue());
+ assertEquals(item, selectItem.getValue());
selectItem.setValue(null);
- assertNull("erased value", selectItem.getValue());
+ assertNull(selectItem.getValue());
selectItem.setItemDescription("foo");
assertEquals("foo", selectItem.getItemDescription());
diff --git a/impl/src/test/java/jakarta/faces/component/UISelectItemsTestCase.java b/impl/src/test/java/jakarta/faces/component/UISelectItemsTestCase.java
index a4a6bc9c36..cde6a1e6b1 100644
--- a/impl/src/test/java/jakarta/faces/component/UISelectItemsTestCase.java
+++ b/impl/src/test/java/jakarta/faces/component/UISelectItemsTestCase.java
@@ -16,9 +16,13 @@
package jakarta.faces.component;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
import jakarta.faces.model.SelectItem;
-import junit.framework.Test;
-import junit.framework.TestSuite;
/**
*
@@ -27,19 +31,10 @@
*/
public class UISelectItemsTestCase extends UIComponentBaseTestCase {
- // ------------------------------------------------------------ Constructors
- /**
- * Construct a new instance of this test case.
- *
- * @param name Name of the test case
- */
- public UISelectItemsTestCase(String name) {
- super(name);
- }
-
// ---------------------------------------------------- Overall Test Methods
// Set up instance variables required by this test case.
@Override
+ @BeforeEach
public void setUp() throws Exception {
super.setUp();
component = new UISelectItems();
@@ -48,14 +43,10 @@ public void setUp() throws Exception {
expectedRendererType = null;
}
- // Return the tests included in this test case.
- public static Test suite() {
- return new TestSuite(UISelectItemsTestCase.class);
- }
-
// ------------------------------------------------- Individual Test Methods
// Test attribute-property transparency
@Override
+ @Test
public void testAttributesTransparency() {
super.testAttributesTransparency();
UISelectItems selectItems = (UISelectItems) component;
@@ -74,19 +65,22 @@ public void testAttributesTransparency() {
// Suppress lifecycle tests since we do not have a renderer
@Override
+ @Test
public void testLifecycleManagement() {
}
// Test a pristine UISelectItems instance
@Override
+ @Test
public void testPristine() {
super.testPristine();
UISelectItems selectItems = (UISelectItems) component;
- assertNull("no value", selectItems.getValue());
+ assertNull(selectItems.getValue());
}
// Test setting properties to valid values
@Override
+ @Test
public void testPropertiesValid() throws Exception {
super.testPropertiesValid();
UISelectItems selectItems = (UISelectItems) component;
@@ -94,9 +88,9 @@ public void testPropertiesValid() throws Exception {
// value
SelectItem item = new SelectItem("foo");
selectItems.setValue(item);
- assertEquals("expected value", item, selectItems.getValue());
+ assertEquals(item, selectItems.getValue());
selectItems.setValue(null);
- assertNull("erased value", selectItems.getValue());
+ assertNull(selectItems.getValue());
}
// --------------------------------------------------------- Support Methods
diff --git a/impl/src/test/java/jakarta/faces/component/UISelectManyTestCase.java b/impl/src/test/java/jakarta/faces/component/UISelectManyTestCase.java
index d7f6bec985..019f132a87 100644
--- a/impl/src/test/java/jakarta/faces/component/UISelectManyTestCase.java
+++ b/impl/src/test/java/jakarta/faces/component/UISelectManyTestCase.java
@@ -16,6 +16,12 @@
package jakarta.faces.component;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -27,14 +33,15 @@
import java.util.NoSuchElementException;
import java.util.Set;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
import com.sun.faces.renderkit.SelectItemsIterator;
import jakarta.faces.application.FacesMessage;
import jakarta.faces.model.ListDataModel;
import jakarta.faces.model.SelectItem;
import jakarta.faces.model.SelectItemGroup;
-import junit.framework.Test;
-import junit.framework.TestSuite;
/**
*
@@ -43,19 +50,10 @@
*/
public class UISelectManyTestCase extends UIInputTestCase {
- // ------------------------------------------------------------ Constructors
- /**
- * Construct a new instance of this test case.
- *
- * @param name Name of the test case
- */
- public UISelectManyTestCase(String name) {
- super(name);
- }
-
// ---------------------------------------------------- Overall Test Methods
// Set up instance variables required by this test case.
@Override
+ @BeforeEach
public void setUp() throws Exception {
super.setUp();
component = new UISelectMany();
@@ -63,14 +61,10 @@ public void setUp() throws Exception {
expectedRendererType = "jakarta.faces.Listbox";
}
- // Return the tests included in this test case.
- public static Test suite() {
- return new TestSuite(UISelectManyTestCase.class);
- }
-
// ------------------------------------------------- Individual Test Methods
// Test the compareValues() method
@Override
+ @Test
public void testCompareValues() {
SelectManyTestImpl selectMany = new SelectManyTestImpl();
Object values1a[] = new Object[] { "foo", "bar", "baz" };
@@ -99,20 +93,23 @@ public void testCompareValues() {
// Test a pristine UISelectMany instance
@Override
+ @Test
public void testPristine() {
super.testPristine();
UISelectMany selectMany = (UISelectMany) component;
- assertNull("no selectedValues", selectMany.getSelectedValues());
+ assertNull(selectMany.getSelectedValues());
}
// Test setting properties to invalid values
@Override
+ @Test
public void testPropertiesInvalid() throws Exception {
super.testPropertiesInvalid();
}
// Test validation of value against the valid list
+ @Test
public void testValidation() throws Exception {
// Put our component under test in a tree under a UIViewRoot
UIViewRoot root = facesContext.getApplication().getViewHandler().createView(facesContext, null);
@@ -146,6 +143,7 @@ public void testValidation() throws Exception {
}
// Test validation of component with UISelectItems pointing to map
+ @Test
public void testValidation2() throws Exception {
// Put our component under test in a tree under a UIViewRoot
UIViewRoot root = facesContext.getApplication().getViewHandler().createView(facesContext, null);
@@ -177,6 +175,7 @@ public void testValidation2() throws Exception {
// Test validation of component with UISelectItems pointing to Set and the
// value of the component is Set
+ @Test
public void testValidation3() throws Exception {
Set items = new HashSet<>();
items.add(new SelectItem("foo"));
@@ -192,6 +191,7 @@ public void testValidation3() throws Exception {
}
// Test validation of component with UISelectItems pointing to List
+ @Test
public void testValidation4() throws Exception {
List items = new ArrayList<>();
items.add(new SelectItem("foo"));
@@ -207,6 +207,7 @@ public void testValidation4() throws Exception {
}
// Test validation of component with UISelectItems pointing to an Array
+ @Test
public void testValidation5() throws Exception {
// Put our component under test in a tree under a UIViewRoot
UIViewRoot root = facesContext.getApplication().getViewHandler().createView(facesContext, null);
@@ -260,6 +261,7 @@ private void testValidateWithCollection(Collection selectItems, Obje
private String illegalValues[] = { "D1", "D2", "Group A", "Group B", "Group C" };
// Test validation against a nested list of available options
+ @Test
public void testValidateNested() throws Exception {
// Set up UISelectMany with nested UISelectItems
UIViewRoot root = facesContext.getApplication().getViewHandler().createView(facesContext, null);
@@ -276,7 +278,7 @@ public void testValidateNested() throws Exception {
selectMany.setValid(true);
selectMany.setSubmittedValue(new Object[] { legalValues[0], legalValues[i] });
selectMany.validate(facesContext);
- assertTrue("Value '" + legalValues[i] + "' found", selectMany.isValid());
+ assertTrue(selectMany.isValid(), "Value '" + legalValues[i] + "' found");
checkMessages(0);
}
@@ -285,12 +287,13 @@ public void testValidateNested() throws Exception {
selectMany.setValid(true);
selectMany.setSubmittedValue(new Object[] { legalValues[0], illegalValues[i] });
selectMany.validate(facesContext);
- assertTrue("Value '" + illegalValues[i] + "' not found", !selectMany.isValid());
+ assertTrue(!selectMany.isValid(), "Value '" + illegalValues[i] + "' not found");
checkMessages(i + 1);
}
}
// Test validation against a nested Set of available options
+ @Test
public void testValidateNestedSet() throws Exception {
// Set up UISelectMany with nested UISelectItems
UIViewRoot root = facesContext.getApplication().getViewHandler().createView(facesContext, null);
@@ -307,7 +310,7 @@ public void testValidateNestedSet() throws Exception {
selectMany.setValid(true);
selectMany.setSubmittedValue(new Object[] { legalValues[0], legalValues[i] });
selectMany.validate(facesContext);
- assertTrue("Value '" + legalValues[i] + "' found", selectMany.isValid());
+ assertTrue(selectMany.isValid(), "Value '" + legalValues[i] + "' found");
checkMessages(0);
}
@@ -316,13 +319,14 @@ public void testValidateNestedSet() throws Exception {
selectMany.setValid(true);
selectMany.setSubmittedValue(new Object[] { legalValues[0], illegalValues[i] });
selectMany.validate(facesContext);
- assertTrue("Value '" + illegalValues[i] + "' not found", !selectMany.isValid());
+ assertTrue(!selectMany.isValid(), "Value '" + illegalValues[i] + "' not found");
checkMessages(i + 1);
}
}
// Test validation of a required field
@Override
+ @Test
public void testValidateRequired() throws Exception {
UIViewRoot root = facesContext.getApplication().getViewHandler().createView(facesContext, null);
root.getChildren().add(component);
@@ -361,6 +365,7 @@ public void testValidateRequired() throws Exception {
assertTrue(selectMany.isValid());
}
+ @Test
public void testSelectItemsIterator() {
// sub test 1: non-selectitem at end
UISelectMany selectMany = (UISelectMany) component;
diff --git a/impl/src/test/java/jakarta/faces/component/UISelectOneTestCase.java b/impl/src/test/java/jakarta/faces/component/UISelectOneTestCase.java
index 26f5e4f42a..dae1499e7f 100644
--- a/impl/src/test/java/jakarta/faces/component/UISelectOneTestCase.java
+++ b/impl/src/test/java/jakarta/faces/component/UISelectOneTestCase.java
@@ -16,6 +16,8 @@
package jakarta.faces.component;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -25,11 +27,12 @@
import java.util.Map;
import java.util.Set;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
import jakarta.faces.application.FacesMessage;
import jakarta.faces.model.SelectItem;
import jakarta.faces.model.SelectItemGroup;
-import junit.framework.Test;
-import junit.framework.TestSuite;
/**
*
diff --git a/impl/src/main/resources/com/sun/faces/metadata/taglib/tags.core.taglib.xml b/impl/src/main/resources/com/sun/faces/metadata/taglib/tags.core.taglib.xml
index d4de234080..a6942cc353 100644
--- a/impl/src/main/resources/com/sun/faces/metadata/taglib/tags.core.taglib.xml
+++ b/impl/src/main/resources/com/sun/faces/metadata/taglib/tags.core.taglib.xml
@@ -20,8 +20,8 @@
Jakarta Tags Core Tag Library
diff --git a/impl/src/main/resources/com/sun/faces/metadata/taglib/tags.functions.taglib.xml b/impl/src/main/resources/com/sun/faces/metadata/taglib/tags.functions.taglib.xml
index e041bc93d5..bba2172b00 100644
--- a/impl/src/main/resources/com/sun/faces/metadata/taglib/tags.functions.taglib.xml
+++ b/impl/src/main/resources/com/sun/faces/metadata/taglib/tags.functions.taglib.xml
@@ -20,8 +20,8 @@
Jakarta Tags Functions Tag Library
diff --git a/impl/src/main/resources/com/sun/faces/web-facelettaglibrary_4_1.xsd b/impl/src/main/resources/com/sun/faces/web-facelettaglibrary_4_1.xsd
new file mode 100644
index 0000000000..8346e03dc0
--- /dev/null
+++ b/impl/src/main/resources/com/sun/faces/web-facelettaglibrary_4_1.xsd
@@ -0,0 +1,751 @@
+
+
+
+
+
+
+
+ Copyright (c) 2024 Contributors to Eclipse Foundation.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v. 2.0, which is available at
+ http://www.eclipse.org/legal/epl-2.0.
+
+ This Source Code may also be made available under the following Secondary
+ Licenses when the conditions for such availability set forth in the
+ Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ version 2 with the GNU Classpath Exception, which is available at
+ https://www.gnu.org/software/classpath/license.html.
+
+ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+
+
+
+
+
+
+ The XML Schema for the Tag Libraries in the Jakarta Faces
+ Standard Facelets View Declaration Language (Facelets VDL)
+ (Version 4.1).
+
+
Jakarta Faces 4.1 Facelet Tag Libraries that wish to conform to
+ this schema must declare it in the following manner.
The instance documents may indicate the published
+ version of the schema using xsi:schemaLocation attribute
+ for jakartaee namespace with the following location:
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+ tag-names must be unique within a document.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+ Behavior IDs must be unique within a document.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+ Converter IDs must be unique within a document.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+ Validator IDs must be unique within a document.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The top level XML element in a facelet tag library XML file.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ An advisory short name for usages of tags from this tag library.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for facelet-taglib. It may contain
+ implementation specific content.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ If the tag library XML
+ file contains individual tag declarations rather than pointing
+ to a library-class or a declaring a composite-library name, the
+ individual tags are enclosed in tag elements.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
The attribute element defines an attribute for the nesting
+ tag. The attribute element may have several subelements
+ defining:
+
+
+
+
description
a description of the attribute
+
+
+
name
the name of the attribute
+
+
+
required
whether the attribute is required or
+ optional
+
+
+
type
the type of the attribute
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+ Defines if the nesting attribute is required or
+ optional.
+
+
If not present then the default is "false", i.e
+ the attribute is optional.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+ Defines the Java type of the attributes
+ value. If this element is omitted, the
+ expected type is assumed to be
+ "java.lang.Object".
+
+ ]]>
+
+
+
+
+
+
+
+
+ Defines the method signature for a MethodExpression-
+ enabled attribute. The syntax of the method-signature
+ element is as follows (taken from the function-signature
+ EBNF in web-jsptaglibrary_2_1.xsd):
+
+
+
+
Type is a basic type or a fully qualified
+ Java class name (including package name), as per the 'Type'
+ production in the Java Language Specification, Second Edition,
+ Chapter 18.
+
+
Identifier is a Java identifier, as per the
+ 'Identifier' production in the Java Language Specification,
+ Second Edition, Chapter 18.
+
+
+
+
Example:
+
+
java.lang.String nickName( java.lang.String, int )
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for tag It may contain
+ implementation specific content.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ If the tag library XML file contains individual function
+ declarations rather than pointing to a library-class or a
+ declaring a composite-library name, the individual functions are
+ enclosed in function elements.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Within a tag element, the behavior element encapsulates
+ information specific to a Faces Behavior.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for behavior. It may contain
+ implementation specific content.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Within a tag element, the component
+ element encapsulates information specific to a Faces UIComponent.
+
+
+
+
As of 3.0 of the specification, this requirement is no longer
+ present: This element must have exactly one of
+ <component-type>, <resource-id>,
+ or <handler-class> among its child elements.
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+ A valid resource identifier
+ as specified in the Jakarta Faces Specification Document section 2.6.1.3 "Resource Identifiers".
+ For example:
+
+
<resource-id>myCC/ccName.xhtml</resource-id>
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for component It may contain
+ implementation specific content.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Within a tag element, the converter element encapsulates
+ information specific to a Faces Converter.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for converter It may contain
+ implementation specific content.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Within a tag element, the validator element encapsulates
+ information specific to a Faces Validator.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for validator It may contain
+ implementation specific content.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This type contains the recognized versions of
+ facelet-taglib supported.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Defines the canonical name of a tag or attribute being
+ defined.
+
+
The name must conform to the lexical rules for an NCName
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
diff --git a/impl/src/main/resources/com/sun/faces/web-facesconfig_4_1.xsd b/impl/src/main/resources/com/sun/faces/web-facesconfig_4_1.xsd
new file mode 100644
index 0000000000..d2e129cf3b
--- /dev/null
+++ b/impl/src/main/resources/com/sun/faces/web-facesconfig_4_1.xsd
@@ -0,0 +1,3447 @@
+
+
+
+
+
+
+
+ Copyright (c) 2024 Contributors to Eclipse Foundation.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v. 2.0, which is available at
+ http://www.eclipse.org/legal/epl-2.0.
+
+ This Source Code may also be made available under the following Secondary
+ Licenses when the conditions for such availability set forth in the
+ Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ version 2 with the GNU Classpath Exception, which is available at
+ https://www.gnu.org/software/classpath/license.html.
+
+ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+
+
+
+
+
+
+ The XML Schema for the Jakarta Faces Application
+ Configuration File (Version 4.1).
+
+
All Jakarta Faces configuration files must indicate
+ the Jakarta Faces schema by indicating the
+ Jakarta Faces namespace:
+
+
https://jakarta.ee/xml/ns/jakartaee
+
+
and by indicating the version of the schema by
+ using the version element as shown below:
The instance documents may indicate the published
+ version of the schema using xsi:schemaLocation attribute
+ for jakartaee namespace with the following location:
+
+ ]]>
+
+
+
+
+
+
+
+
+
+ The "faces-config" element is the root of the configuration
+ information hierarchy, and contains nested elements for all
+ of the other configuration settings.
+
+ ]]>
+
+
+
+
+
+ Behavior IDs must be unique within a document.
+
+ ]]>
+
+
+
+
+
+
+
+
+ Converter IDs must be unique within a document.
+
+ ]]>
+
+
+
+
+
+
+
+
+ 'converter-for-class' element values must be unique
+ within a document.
+
+ ]]>
+
+
+
+
+
+
+
+
+ Validator IDs must be unique within a document.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "faces-config" element is the root of the configuration
+ information hierarchy, and contains nested elements for all
+ of the other configuration settings.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "name" element
+ within the top level "faces-config"
+ element declares the name of this application
+ configuration resource. Such names are used
+ in the document ordering scheme specified in section
+ 11.3.8 "Ordering of Artifacts" of the Jakarta Faces Specification Document.
+
+
This value is taken to be the
+ defining document id of any <flow-definition> elements
+ defined in this Application Configuration Resource file. If this
+ element is not specified, the runtime must take the empty string
+ as its value.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The metadata-complete attribute defines whether this
+ Faces application is complete, or whether
+ the class files available to this module and packaged with
+ this application should be examined for annotations
+ that specify configuration information.
+
+ This attribute is only inspected on the application
+ configuration resource file located at "WEB-INF/faces-config.xml".
+ The presence of this attribute on any application configuration
+ resource other than the one located at "WEB-INF/faces-config.xml",
+ including any files named using the jakarta.faces.CONFIG_FILES
+ attribute, must be ignored.
+
+ If metadata-complete is set to "true", the Faces
+ runtime must ignore any annotations that specify configuration
+ information, which might be present in the class files
+ of the application.
+
+ If metadata-complete is not specified or is set to
+ "false", the Faces runtime must examine the class
+ files of the application for annotations, as specified by
+ the specification.
+
+ If "WEB-INF/faces-config.xml" is not present, the
+ Faces runtime will assume metadata-complete to be "false".
+
+ The value of this attribute will have no impact on
+ runtime annotations such as @ResourceDependency or
+ @ListenerFor.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for faces-config. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Please see section
+ 11.3.8 "Ordering of Artifacts" of the Jakarta Faces Specification Document
+ for the specification of this element.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This element contains a sequence of "id" elements, each of which
+ refers to an application configuration resource by the "id"
+ declared on its faces-config element. This element can also contain
+ a single "others" element which specifies that this document comes
+ before or after other documents within the application.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This element indicates that the ordering sub-element in which
+ it was placed should take special action regarding the ordering
+ of this application resource relative to other
+ application configuration resources.
+ See section 11.3.8 "Ordering of Artifacts" of the Jakarta Faces Specification Document
+ for the complete specification.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ Only relevant if this is placed within the /WEB-INF/faces-config.xml.
+ Please see
+ section 11.3.8 "Ordering of Artifacts" of the Jakarta Faces Specification Document
+ for the specification for details.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "application" element provides a mechanism to define the
+ various per-application-singleton implementation artifacts for
+ a particular web application that is utilizing
+ Jakarta Faces. For nested elements that are not specified,
+ the Jakarta Faces implementation must provide a suitable
+ default.
+
+ ]]>
+
+
+
+
+
+
+ The "action-listener" element contains the fully
+ qualified class name of the concrete
+ ActionListener implementation class that will be
+ called during the Invoke Application phase of the
+ request processing lifecycle.
+
+ ]]>
+
+
+
+
+
+
+ The "default-render-kit-id" element allows the
+ application to define a renderkit to be used other
+ than the standard one.
+
+ ]]>
+
+
+
+
+
+
+ The base name of a resource bundle representing
+ the message resources for this application. See
+ the JavaDocs for the "java.util.ResourceBundle"
+ class for more information on the syntax of
+ resource bundle names.
+
+ ]]>
+
+
+
+
+
+
+ The "navigation-handler" element contains the
+ fully qualified class name of the concrete
+ NavigationHandler implementation class that will
+ be called during the Invoke Application phase
+ of the request processing lifecycle, if the
+ default ActionListener (provided by the Jakarta Faces
+ implementation) is used.
+
+ ]]>
+
+
+
+
+
+
+ The "view-handler" element contains the fully
+ qualified class name of the concrete ViewHandler
+ implementation class that will be called during
+ the Restore View and Render Response phases of the
+ request processing lifecycle. The faces
+ implementation must provide a default
+ implementation of this class.
+
+ ]]>
+
+
+
+
+
+
+ The "state-manager" element contains the fully
+ qualified class name of the concrete StateManager
+ implementation class that will be called during
+ the Restore View and Render Response phases of the
+ request processing lifecycle. The faces
+ implementation must provide a default
+ implementation of this class.
+
+ ]]>
+
+
+
+
+
+
+ The "el-resolver" element contains the fully
+ qualified class name of the concrete
+ jakarta.el.ELResolver implementation class
+ that will be used during the processing of
+ EL expressions.
+
+ ]]>
+
+
+
+
+
+
+ The "resource-handler" element contains the
+ fully qualified class name of the concrete
+ ResourceHandler implementation class that
+ will be used during rendering and decoding
+ of resource requests The standard
+ constructor based decorator pattern used for
+ other application singletons will be
+ honored.
+
+ ]]>
+
+
+
+
+
+
+ The "resource-library-contracts" element
+ specifies the mappings between views in the application and resource
+ library contracts that, if present in the application, must be made
+ available for use as templates of the specified views.
+
+
+ ]]>
+
+
+
+
+
+
+ The "search-expression-handler"
+ element contains the fully qualified class name of the
+ concrete jakarta.faces.component.search.SearchExpressionHandler
+ implementation class that will be used for processing of a
+ search expression.
+
+ ]]>
+
+
+
+
+
+
+ The "search-keyword-resolver"
+ element contains the fully qualified class name of the
+ concrete jakarta.faces.component.search.SearchKeywordResolver
+ implementation class that will be used during the processing
+ of a search expression keyword.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The resource-bundle element inside the application element
+ references a java.util.ResourceBundle instance by name
+ using the var element. ResourceBundles referenced in this
+ manner may be returned by a call to
+ Application.getResourceBundle() passing the current
+ FacesContext for this request and the value of the var
+ element below.
+
+ ]]>
+
+
+
+
+
+
+
+ The fully qualified class name of the
+ java.util.ResourceBundle instance.
+
+ ]]>
+
+
+
+
+
+
+ The name by which this ResourceBundle instance
+ is retrieved by a call to
+ Application.getResourceBundle().
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "resource-library-contracts" element
+ specifies the mappings between views in the application and resource
+ library contracts that, if present in the application, must be made
+ available for use as templates of the specified views.
+
+
+ ]]>
+
+
+
+
+
+
+
+ Declare a mapping between a collection
+ of views in the application and the list of contracts (if present in the application)
+ that may be used as a source for templates and resources for those views.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "contract-mapping" element
+ specifies the mappings between a collection of views in the application and resource
+ library contracts that, if present in the application, must be made
+ available for use as templates of the specified views.
+
+
+ ]]>
+
+
+
+
+
+
+
+ The "url-pattern" element
+ specifies the collection of views in this application that
+ are allowed to use the corresponding contracts.
+
+
+ ]]>
+
+
+
+
+
+
+ The "contracts" element
+ is a comma separated list of resource library contracts that,
+ if available to the application, may be used by the views
+ matched by the corresponding "url-pattern"
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for application. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "factory" element provides a mechanism to define the
+ various Factories that comprise parts of the implementation
+ of Jakarta Faces. For nested elements that are not
+ specified, the Jakarta Faces implementation must provide a
+ suitable default.
+
+ ]]>
+
+
+
+
+
+
+ The "application-factory" element contains the
+ fully qualified class name of the concrete
+ ApplicationFactory implementation class that will
+ be called when
+ FactoryFinder.getFactory(APPLICATION_FACTORY) is
+ called.
+
+ ]]>
+
+
+
+
+
+
+ The "exception-handler-factory" element contains the
+ fully qualified class name of the concrete
+ ExceptionHandlerFactory implementation class that will
+ be called when
+ FactoryFinder.getFactory(EXCEPTION_HANDLER_FACTORY)
+ is called.
+
+ ]]>
+
+
+
+
+
+
+ The "external-context-factory" element contains the
+ fully qualified class name of the concrete
+ ExternalContextFactory implementation class that will
+ be called when
+ FactoryFinder.getFactory(EXTERNAL_CONTEXT_FACTORY)
+ is called.
+
+ ]]>
+
+
+
+
+
+
+ The "faces-context-factory" element contains the
+ fully qualified class name of the concrete
+ FacesContextFactory implementation class that will
+ be called when
+ FactoryFinder.getFactory(FACES_CONTEXT_FACTORY)
+ is called.
+
+ ]]>
+
+
+
+
+
+
+ The "facelet-cache-factory" element contains the
+ fully qualified class name of the concrete
+ FaceletCacheFactory implementation class that will
+ be called when
+ FactoryFinder.getFactory(FACELET_CACHE_FACTORY)
+ is called.
+
+ ]]>
+
+
+
+
+
+
+ The "partial-view-context-factory" element contains the
+ fully qualified class name of the concrete
+ PartialViewContextFactory implementation class that will
+ be called when FactoryFinder.getFactory
+ (FactoryFinder.PARTIAL_VIEW_CONTEXT_FACTORY) is called.
+
+ ]]>
+
+
+
+
+
+
+ The "lifecycle-factory" element contains the fully
+ qualified class name of the concrete LifecycleFactory
+ implementation class that will be called when
+ FactoryFinder.getFactory(LIFECYCLE_FACTORY) is called.
+
+ ]]>
+
+
+
+
+
+
+ The "view-declaration-language-factory" element contains
+ the fully qualified class name of the concrete
+ ViewDeclarationLanguageFactory
+ implementation class that will be called when
+ FactoryFinder.getFactory(VIEW_DECLARATION_FACTORY) is called.
+
+ ]]>
+
+
+
+
+
+
+ The "tag-handler-delegate-factory" element contains
+ the fully qualified class name of the concrete
+ ViewDeclarationLanguageFactory
+ implementation class that will be called when
+ FactoryFinder.getFactory(TAG_HANDLER_DELEGATE_FACTORY) is called.
+
+ ]]>
+
+
+
+
+
+
+ The "render-kit-factory" element contains the fully
+ qualified class name of the concrete RenderKitFactory
+ implementation class that will be called when
+ FactoryFinder.getFactory(RENDER_KIT_FACTORY) is
+ called.
+
+ ]]>
+
+
+
+
+
+
+ The "visit-context-factory" element contains the fully
+ qualified class name of the concrete VisitContextFactory
+ implementation class that will be called when
+ FactoryFinder.getFactory(VISIT_CONTEXT_FACTORY) is
+ called.
+
+ ]]>
+
+
+
+
+
+
+ The "flash-factory" element contains the
+ fully qualified class name of the concrete
+ FaceletFactory implementation class that will
+ be called when
+ FactoryFinder.getFactory(FLASH_FACTORY) is
+ called.
+
+ ]]>
+
+
+
+
+
+
+ The "flow-handler-factory" element contains the
+ fully qualified class name of the concrete
+ FlowHandlerFactory implementation class that will
+ be called when
+ FactoryFinder.getFactory(FLOW_HANDLER_FACTORY) is
+ called.
+
+ ]]>
+
+
+
+
+
+
+ The "client-window-factory" element contains the fully
+ qualified class name of the concrete ClientWindowFactory implementation class that
+ will be called when FactoryFinder.getFactory(CLIENT_WINDOW_FACTORY) is called.
+
+ ]]>
+
+
+
+
+
+
+ The
+ "search-expression-context-factory" element contains the
+ fully qualified class name of the concrete
+ SearchExpressionContextFactory implementation class that will
+ be called when
+ FactoryFinder.getFactory(SEARCH_EXPRESSION_CONTEXT_FACTORY)
+ is called.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for factory. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "attribute" element represents a named, typed, value
+ associated with the parent UIComponent via the generic
+ attributes mechanism.
+
+
Attribute names must be unique within the scope of the parent
+ (or related) component.
+
+ ]]>
+
+
+
+
+
+
+
+ The "attribute-name" element represents the name under
+ which the corresponding value will be stored, in the
+ generic attributes of the UIComponent we are related
+ to.
+
+ ]]>
+
+
+
+
+
+
+ The "attribute-class" element represents the Java type
+ of the value associated with this attribute name.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for attribute. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "component" element represents a concrete UIComponent
+ implementation class that should be registered under the
+ specified type identifier, along with its associated
+ properties and attributes. Component types must be unique
+ within the entire web application.
+
+
Nested "attribute" elements identify generic attributes that
+ are recognized by the implementation logic of this component.
+ Nested "property" elements identify JavaBeans properties of
+ the component class that may be exposed for manipulation
+ via tools.
+
+ ]]>
+
+
+
+
+
+
+
+ The "component-type" element represents the name under
+ which the corresponding UIComponent class should be
+ registered.
+
+ ]]>
+
+
+
+
+
+
+ The "component-class" element represents the fully
+ qualified class name of a concrete UIComponent
+ implementation class.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for component. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "default-locale" element declares the default locale
+ for this application instance.
+
+
+ To facilitate BCP 47 this element first needs to be parsed by the
+ Locale.forLanguageTag method. If it does not return a Locale with
+ a language the old specification below needs to take effect.
+
+
+
It must be specified as :language:[_:country:[_:variant:]]
+ without the colons, for example "ja_JP_SJIS". The
+ separators between the segments may be '-' or '_'.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "default-value" contains the value for the property or
+ attribute in which this element resides. This value differs
+ from the "suggested-value" in that the property or attribute
+ must take the value, whereas in "suggested-value" taking the
+ value is optional.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+ EL expressions present within a faces config file
+ must start with the character sequence of '#{' and
+ end with '}'.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Define the name and other design-time information for a facet
+ that is associated with a renderer or a component.
+
+ ]]>
+
+
+
+
+
+
+
+ The "facet-name" element represents the facet name
+ under which a UIComponent will be added to its parent.
+ It must be of type "Identifier".
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for facet. It may contain implementation
+ specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The
+ value of from-view-id must contain one of the following
+ values:
+
+
+
+
The exact match for a view identifier that is recognized
+ by the the ViewHandler implementation being used (such as
+ "/index.jsp" if you are using the default ViewHandler).
+
+
The exact match of a flow node id
+ in the current flow, or a flow id of another flow.
+
+
A proper prefix of a view identifier, plus a trailing
+ "*" character. This pattern indicates that all view
+ identifiers that match the portion of the pattern up to the
+ asterisk will match the surrounding rule. When more than one
+ match exists, the match with the longest pattern is selected.
+
+
+
An "*" character, which means that this pattern applies
+ to all view identifiers.
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "from-action" element contains an action reference
+ expression that must have been executed (by the default
+ ActionListener for handling application level events)
+ in order to select the navigation rule. If not specified,
+ this rule will be relevant no matter which action reference
+ was executed (or if no action reference was executed).
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "if" element defines a condition that must resolve
+ to true in order for the navigation case on which it is
+ defined to be matched, with the existing match criteria
+ (action method and outcome) as a prerequiste, if present.
+ The condition is defined declaratively using a value
+ expression in the body of this element. The expression is
+ evaluated at the time the navigation case is being matched.
+ If the "from-outcome" is omitted and this element is
+ present, the navigation handler will match a null outcome
+ and use the condition return value to determine if the
+ case should be considered a match.
+
+
+
+
When used in a <switch> within a flow, if the
+ expresion returns true, the
+ <from-outcome> sibling element's outcome is used as
+ the id of the node in the flow graph to which control must be
+ passed.
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "converter" element represents a concrete Converter
+ implementation class that should be registered under the
+ specified converter identifier. Converter identifiers must
+ be unique within the entire web application.
+
+
Nested "attribute" elements identify generic attributes that
+ may be configured on the corresponding UIComponent in order
+ to affect the operation of the Converter. Nested "property"
+ elements identify JavaBeans properties of the Converter
+ implementation class that may be configured to affect the
+ operation of the Converter. "attribute" and "property"
+ elements are intended to allow component developers to
+ more completely describe their components to tools and users.
+ These elements have no required runtime semantics.
+
+ ]]>
+
+
+
+
+
+
+
+
+ The "converter-id" element represents the
+ identifier under which the corresponding
+ Converter class should be registered.
+
+ ]]>
+
+
+
+
+
+
+ The "converter-for-class" element represents the
+ fully qualified class name for which a Converter
+ class will be registered.
+
+ ]]>
+
+
+
+
+
+
+
+ The "converter-class" element represents the fully
+ qualified class name of a concrete Converter
+ implementation class.
+
+ ]]>
+
+
+
+
+
+
+ Nested "attribute" elements identify generic
+ attributes that may be configured on the
+ corresponding UIComponent in order to affect the
+ operation of the Converter. This attribute is
+ primarily for design-time tools and is not
+ specified to have any meaning at runtime.
+
+ ]]>
+
+
+
+
+
+
+ Nested "property" elements identify JavaBeans
+ properties of the Converter implementation class
+ that may be configured to affect the operation of
+ the Converter. This attribute is primarily for
+ design-time tools and is not specified to have
+ any meaning at runtime.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for converter. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "lifecycle" element provides a mechanism to specify
+ modifications to the behaviour of the default Lifecycle
+ implementation for this web application.
+
+ ]]>
+
+
+
+
+
+
+ The "phase-listener" element contains the fully
+ qualified class name of the concrete PhaseListener
+ implementation class that will be registered on
+ the Lifecycle.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for lifecycle. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ The localeType defines valid locale defined by ISO-639-1
+ and ISO-3166.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "locale-config" element allows the app developer to
+ declare the supported locales for this application.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "default-validators" element allows the app developer to
+ register a set of validators, referenced by identifier, that
+ are automatically assigned to any EditableValueHolder component
+ in the application, unless overridden or disabled locally.
+
+ ]]>
+
+
+
+
+
+
+ The "validator-id" element represents the identifier
+ of a registered validator.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Top level element for a flow
+ definition.
+
+
+
+
If there is no <start-node> element declared, it
+ is assumed to be <flowName>.xhtml.
+
+
+
+ ]]>
+
+
+
+
+
+
+
+ Declare the id of the starting node in the
+ flow graph. The start node may be any of the node types mentioned in
+ the class javadocs for FlowHandler.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The id of this flow. The id
+ must be unique within the Application configuration Resource
+ file in which this flow is defined. The value of this attribute,
+ combined with the value of the <faces-config><name> element
+ must globally identify the flow within the application.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ Invoke a method, passing parameters if necessary.
+ The return from the method is used as the outcome for where to go next in the
+ flow. If the method is a void method, the default outcome is used.
+
+ ]]>
+
+
+
+
+
+
+
+
+ A parameter to pass when calling the method
+ identified in the "method" element that is a sibling of this element.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A parameter to pass when calling the method
+ identified in the "method" element that is a sibling of this element.
+
+ ]]>
+
+
+
+
+
+
+ The optional "class" element within a "parameter" element
+ will be interpreted as the fully qualified class name for the type
+ of the "value" element.
+
+ ]]>
+
+
+
+
+
+
+ The "value" element within an "parameter"
+ must be a literal string or an EL Expression whose "get" will be called when the "method"
+ associated with this element is invoked.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+ Define a view node in a flow graph.
+
+
This element must contain exactly one
+ <vdl-document> element.
+
+ ]]>
+
+
+
+
+
+
+
+ Define the path to the vdl-document for the enclosing view.
+
+
+ ]]>
+
+
+
+
+
+
+
+ The id of this view. It must be
+ unique within the flow.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ Define a switch node in a flow graph.
+
+
+
+
This element must contain one or more
+ <case> elements. When control passes to the
+ <switch> node, each of the cases must be considered
+ in order and control must past to the <from-outcome>
+ of the first one whose <if> expression evaluates to
+ true.
+
+
+
+ ]]>
+
+
+
+
+
+
+ Defines a case that must be
+ considered in the list of cases in the
+ <switch>.
+
+ ]]>
+
+
+
+
+
+
+ Defines the default case that will
+ be taken if none of the other cases in the
+ <switch> are taken.
+
+ ]]>
+
+
+
+
+
+
+
+ The id of this switch. It must be
+ unique within the flow.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ Defines a case that will
+ be considered in the <switch>.
+
+ ]]>
+
+
+
+
+
+
+
+ If this EL expression evaluates to
+ true, the corresponding from-outcome will
+ be the outcome taken by the enclosing <switch>
+
+ ]]>
+
+
+
+
+
+
+ The "from-outcome" element contains a logical outcome
+ string returned by the execution of an application
+ action method selected via an "actionRef" property
+ (or a literal value specified by an "action" property)
+ of a UICommand component. If specified, this rule
+ will be relevant only if the outcome value matches
+ this element's value. If not specified, this rule
+ will be relevant if the outcome value is non-null
+ or, if the "if" element is present, will be relevant
+ for any outcome value, with the assumption that the
+ condition specified in the "if" element ultimately
+ determines if this rule is a match.
+
+
If used in a faces flow, this element
+ represents the node id to which control will be passed.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Define a return node in a flow graph.
+
+
+
+
This element must contain exactly one <from-outcome> element.
+
+
+ ]]>
+
+
+
+
+
+
+ This element
+ represents the node id to which control will be passed.
+
+ ]]>
+
+
+
+
+
+
+
+ The id of this flow-return.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ Define a call node in a flow graph.
+
+
+
+
This element must contain exactly one <flow-reference> element,
+ which must contain exactly one <flow-id> element.
+
+
+ ]]>
+
+
+
+
+
+
+ The flow id of the called flow.
+
+ ]]>
+
+
+
+
+
+
+ A parameter to pass when calling the flow
+ identified in the "flow-reference" element that is a sibling of this element.
+
+ ]]>
+
+
+
+
+
+
+
+ The id of this flow-return.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ Identifiy the called flow.
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+ The document id of the called flow.
+
+ ]]>
+
+
+
+
+
+
+ The id of the called flow.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+ A MethodExpression that will be invoked when the flow is entered.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A MethodExpression that will be invoked when the flow is exited.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A named parameter whose value will be populated
+ with a correspondingly named parameter within an "outbound-parameter" element.
+
+ ]]>
+
+
+
+
+
+
+ The "name" element within an "inbound-parameter"
+ element declares the name of this parameter
+ to be passed into a flow. There must be
+ a sibling "value" element in the same parent as this element.
+
+ ]]>
+
+
+
+
+
+
+ The "value" element within an "inbound-parameter"
+ must be an EL Expression whose value will be set with the correspondingly
+ named "outbound-parameter" when this flow is entered, if such a
+ parameter exists.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+ A named parameter whose value will be
+ passed to a correspondingly named parameter within an "inbound-parameter" element
+ on the target flow.
+
+ ]]>
+
+
+
+
+
+
+ The "name" element within an "outbound-parameter" element
+ declares the name of this parameter to be passed out of a flow. There must be
+ a sibling "value" element in the same parent as this element.
+
+ ]]>
+
+
+
+
+
+
+ The "value" element within an "outbound-parameter"
+ must be a literal string or an EL Expression whose "get" will be called when the "flow-call"
+ containing this element is traversed to go to a new flow.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The
+ "navigation-case" element describes a particular
+ combination of conditions that must match for this case to
+ be executed, and the view id of the component tree that
+ should be selected next.
+
+ ]]>
+
+
+
+
+
+
+
+
+ The "from-outcome" element contains a logical outcome
+ string returned by the execution of an application
+ action method selected via an "actionRef" property
+ (or a literal value specified by an "action" property)
+ of a UICommand component. If specified, this rule
+ will be relevant only if the outcome value matches
+ this element's value. If not specified, this rule
+ will be relevant if the outcome value is non-null
+ or, if the "if" element is present, will be relevant
+ for any outcome value, with the assumption that the
+ condition specified in the "if" element ultimately
+ determines if this rule is a match.
+
+ ]]>
+
+
+
+
+
+
+ Please see section 7.4.2 "Default NavigationHandler Algorithm" of the Jakarta Faces Specification Document
+ for the specification of this element.
+
+ ]]>
+
+
+
+
+
+
+ The "to-view-id" element
+ contains the view identifier (or
+ flow node id, or flow id)
+ of the next view (or flow node or
+ flow) that should be displayed if this
+ navigation rule is matched. If the contents is a
+ value expression, it should be resolved by the
+ navigation handler to obtain the view (
+ or flow node or flow)
+ identifier.
+
+ ]]>
+
+
+
+
+
+
+ The document id of the called flow.
+ If this element appears in a <navigation-case> nested within
+ a <flow-definition>, it must be ignored because navigation
+ cases within flows may only navigate among the view nodes of that
+ flow.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "navigation-rule" element represents an individual
+ decision rule that will be utilized by the default
+ NavigationHandler implementation to make decisions on
+ what view should be displayed next, based on the
+ view id being processed.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for navigation-rule. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "null-value" element indicates that the managed
+ property in which we are nested will be explicitly
+ set to null if our managed bean is automatically
+ created. This is different from omitting the managed
+ property element entirely, which will cause no
+ property setter to be called for this property.
+
+
The "null-value" element can only be used when the
+ associated "property-class" identifies a Java class,
+ not a Java primitive.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ The "property" element represents a JavaBean property of the
+ Java class represented by our parent element.
+
+
Property names must be unique within the scope of the Java
+ class that is represented by the parent element, and must
+ correspond to property names that will be recognized when
+ performing introspection against that class via
+ java.beans.Introspector.
+
+ ]]>
+
+
+
+
+
+
+
+ The "property-name" element represents the JavaBeans
+ property name under which the corresponding value
+ may be stored.
+
+ ]]>
+
+
+
+
+
+
+ The "property-class" element represents the Java type
+ of the value associated with this property name.
+ If not specified, it can be inferred from existing
+ classes; however, this element should be specified if
+ the configuration file is going to be the source for
+ generating the corresponding classes.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Any view that matches any of the
+ url-patterns in this element may only be reached from another Jakarta Faces
+ view in the same web application. Because the runtime is aware of
+ which views are protected, any navigation from an unprotected
+ view to a protected view is automatically subject to
+ protection.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for property. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "redirect" element indicates that navigation to the
+ specified "to-view-id" should be accomplished by
+ performing an HTTP redirect rather than the usual
+ ViewHandler mechanisms.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This element was introduced due to a specification
+ error, and is now deprecated. The correct name for
+ this element is "redirect-param" and its meaning is
+ documented therein. The "view-param" element is
+ maintained to preserve backwards compatibility.
+ Implementations must treat this element the same as
+ "redirect-param".
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "redirect-param" element, only valid within
+ a "redirect" element, contains child "name"
+ and "value" elements that must be included in the
+ redirect url when the redirect is performed.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "referenced-bean" element represents at design time the
+ promise that a Java object of the specified type will exist at
+ runtime in some scope, under the specified key. This can be
+ used by design time tools to construct user interface dialogs
+ based on the properties of the specified class. The presence
+ or absence of a referenced bean element has no impact on the
+ Jakarta Faces runtime environment inside a web application.
+
+ ]]>
+
+
+
+
+
+
+
+ The "referenced-bean-name" element represents the
+ attribute name under which the corresponding
+ referenced bean may be assumed to be stored, in one
+ of 'request', 'session', 'view', 'application'
+ or a custom scope.
+
+ ]]>
+
+
+
+
+
+
+ The "referenced-bean-class" element represents the
+ fully qualified class name of the Java class
+ (either abstract or concrete) or Java interface
+ implemented by the corresponding referenced bean.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "render-kit" element represents a concrete RenderKit
+ implementation that should be registered under the specified
+ render-kit-id. If no render-kit-id is specified, the
+ identifier of the default RenderKit
+ (RenderKitFactory.DEFAULT_RENDER_KIT) is assumed.
+
+ ]]>
+
+
+
+
+
+
+
+ The "render-kit-id" element represents an identifier
+ for the RenderKit represented by the parent
+ "render-kit" element.
+
+ ]]>
+
+
+
+
+
+
+ The "render-kit-class" element represents the fully
+ qualified class name of a concrete RenderKit
+ implementation class.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "client-behavior-renderer" element represents a concrete
+ ClientBehaviorRenderer implementation class that should be
+ registered under the specified behavior renderer type identifier,
+ in the RenderKit associated with the parent "render-kit"
+ element. Client Behavior renderer type must be unique within the RenderKit
+ associated with the parent "render-kit" element.
+
+
Nested "attribute" elements identify generic component
+ attributes that are recognized by this renderer.
+
+ ]]>
+
+
+
+
+
+
+ The "client-behavior-renderer-type" element represents a renderer type
+ identifier for the Client Behavior Renderer represented by the parent
+ "client-behavior-renderer" element.
+
+ ]]>
+
+
+
+
+
+
+ The "client-behavior-renderer-class" element represents the fully
+ qualified class name of a concrete Client Behavior Renderer
+ implementation class.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "renderer" element represents a concrete Renderer
+ implementation class that should be registered under the
+ specified component family and renderer type identifiers,
+ in the RenderKit associated with the parent "render-kit"
+ element. Combinations of component family and
+ renderer type must be unique within the RenderKit
+ associated with the parent "render-kit" element.
+
+
Nested "attribute" elements identify generic component
+ attributes that are recognized by this renderer.
+
+ ]]>
+
+
+
+
+
+
+
+ The "component-family" element represents the
+ component family for which the Renderer represented
+ by the parent "renderer" element will be used.
+
+ ]]>
+
+
+
+
+
+
+ The "renderer-type" element represents a renderer type
+ identifier for the Renderer represented by the parent
+ "renderer" element.
+
+ ]]>
+
+
+
+
+
+
+ The "renderer-class" element represents the fully
+ qualified class name of a concrete Renderer
+ implementation class.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for renderer. It may contain implementation
+ specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for render-kit. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "suggested-value" contains the value for the property or
+ attribute in which this element resides. This value is
+ advisory only and is intended for tools to use when
+ populating pallettes.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "supported-locale" element allows authors to declare
+ which locales are supported in this application instance.
+
+
+ To facilitate BCP 47 this element first needs to be parsed by the
+ Locale.forLanguageTag method. If it does not return a Locale with
+ a language the old specification below needs to take effect.
+
+
+
It must be specified as :language:[_:country:[_:variant:]]
+ without the colons, for example "ja_JP_SJIS". The
+ separators between the segments may be '-' or '_'.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "behavior" element represents a concrete Behavior
+ implementation class that should be registered under the
+ specified behavior identifier. Behavior identifiers must
+ be unique within the entire web application.
+
+
Nested "attribute" elements identify generic attributes that
+ may be configured on the corresponding UIComponent in order
+ to affect the operation of the Behavior. Nested "property"
+ elements identify JavaBeans properties of the Behavior
+ implementation class that may be configured to affect the
+ operation of the Behavior. "attribute" and "property"
+ elements are intended to allow component developers to
+ more completely describe their components to tools and users.
+ These elements have no required runtime semantics.
+
+ ]]>
+
+
+
+
+
+
+
+ The "behavior-id" element represents the identifier
+ under which the corresponding Behavior class should
+ be registered.
+
+ ]]>
+
+
+
+
+
+
+ The "behavior-class" element represents the fully
+ qualified class name of a concrete Behavior
+ implementation class.
+
+ ]]>
+
+
+
+
+
+
+ Nested "attribute" elements identify generic
+ attributes that may be configured on the
+ corresponding UIComponent in order to affect the
+ operation of the Behavior. This attribute is
+ primarily for design-time tools and is not
+ specified to have any meaning at runtime.
+
+ ]]>
+
+
+
+
+
+
+ Nested "property" elements identify JavaBeans
+ properties of the Behavior implementation class
+ that may be configured to affect the operation of
+ the Behavior. This attribute is primarily for
+ design-time tools and is not specified to have
+ any meaning at runtime.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for behavior. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "validator" element represents a concrete Validator
+ implementation class that should be registered under the
+ specified validator identifier. Validator identifiers must
+ be unique within the entire web application.
+
+
Nested "attribute" elements identify generic attributes that
+ may be configured on the corresponding UIComponent in order
+ to affect the operation of the Validator. Nested "property"
+ elements identify JavaBeans properties of the Validator
+ implementation class that may be configured to affect the
+ operation of the Validator. "attribute" and "property"
+ elements are intended to allow component developers to
+ more completely describe their components to tools and users.
+ These elements have no required runtime semantics.
+
+ ]]>
+
+
+
+
+
+
+
+ The "validator-id" element represents the identifier
+ under which the corresponding Validator class should
+ be registered.
+
+ ]]>
+
+
+
+
+
+
+ The "validator-class" element represents the fully
+ qualified class name of a concrete Validator
+ implementation class.
+
+ ]]>
+
+
+
+
+
+
+ Nested "attribute" elements identify generic
+ attributes that may be configured on the
+ corresponding UIComponent in order to affect the
+ operation of the Validator. This attribute is
+ primarily for design-time tools and is not
+ specified to have any meaning at runtime.
+
+ ]]>
+
+
+
+
+
+
+ Nested "property" elements identify JavaBeans
+ properties of the Validator implementation class
+ that may be configured to affect the operation of
+ the Validator. This attribute is primarily for
+ design-time tools and is not specified to have
+ any meaning at runtime.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for validator. It may contain
+ implementation specific content.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ The "value" element is the String representation of
+ a literal value to which a scalar managed property
+ will be set, or a value binding expression ("#{...}")
+ that will be used to calculate the required value.
+ It will be converted as specified for the actual
+ property type.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ The presence of this element within the "application" element in
+ an application configuration resource file indicates the
+ developer wants to add an SystemEventListener to this
+ application instance. Elements nested within this element allow
+ selecting the kinds of events that will be delivered to the
+ listener instance, and allow selecting the kinds of classes that
+ can be the source of events that are delivered to the listener
+ instance.
+
+ ]]>
+
+
+
+
+
+
+ The "system-event-listener-class" element contains
+ the fully qualified class name of the concrete
+ SystemEventListener implementation class that will be
+ called when events of the type specified by the
+ "system-event-class" are sent by the runtime.
+
+ ]]>
+
+
+
+
+
+
+ The "system-event-class" element contains the fully
+ qualified class name of the SystemEvent subclass for
+ which events will be delivered to the class whose fully
+ qualified class name is given by the
+ "system-event-listener-class" element.
+
+ ]]>
+
+
+
+
+
+
+ The "source-class" element, if present, contains the
+ fully qualified class name of the class that will be the
+ source for the event to be delivered to the class whose
+ fully qualified class name is given by the
+ "system-event-listener-class" element.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+ This type contains the recognized versions of
+ faces-config supported.
+
+ ]]>
+
+
+
+
+
+
+
+
diff --git a/impl/src/main/resources/com/sun/faces/web-partialresponse_4_1.xsd b/impl/src/main/resources/com/sun/faces/web-partialresponse_4_1.xsd
new file mode 100644
index 0000000000..35064f1383
--- /dev/null
+++ b/impl/src/main/resources/com/sun/faces/web-partialresponse_4_1.xsd
@@ -0,0 +1,403 @@
+
+
+
+
+
+
+
+ Copyright (c) 2024 Contributors to Eclipse Foundation.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v. 2.0, which is available at
+ http://www.eclipse.org/legal/epl-2.0.
+
+ This Source Code may also be made available under the following Secondary
+ Licenses when the conditions for such availability set forth in the
+ Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ version 2 with the GNU Classpath Exception, which is available at
+ https://www.gnu.org/software/classpath/license.html.
+
+ SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+
+
+
+
+
+
+
+
+ The XML Schema for the Jakarta Faces (Version 4.1)
+ Partial Response used in Jakarta Faces Ajax frameworks.
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+ The "partial-response" element is the root of the
+ partial response information hierarchy, and contains
+ nested elements for all possible elements that can exist
+ in the response.
+
+
This element must have an "id" attribute whose value
+ is the return from calling getContainerClientId() on the
+ UIViewRoot to which this response pertains.
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+ The "partial-response" element is the root of the
+ partial response information hierarchy, and contains
+ nested elements for all possible elements that can exist
+ in the response.
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+ This element must have an "id" attribute whose value
+ is the return from calling getContainerClientId() on the
+ UIViewRoot to which this response pertains.
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "changes" element contains a collection of child elements,
+ each of which describes a different change to be applied to the
+ view in the user agent.
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+ The "eval" element enables this element's
+ contents to be executed as JavaScript.
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "update" element enables DOM elements matching the "id"
+ attribute to be updated with the contents of this element.
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "insert" element enables content to be inserted into the DOM
+ before or after an existing DOM element as specified by the
+ nested "before" or "after" elements. The elements "before" and
+ "after" are mutually exclusive - one of them must be specified.
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "delete" element enables DOM elements matching the "id"
+ attribute to be removed.
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "attributes" element enables attributes of DOM elements matching the "id"
+ attribute to be updated. If this element is used, then it must contain at
+ least one "attribute" element.
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "redirect" element enables a redirect to the location as specified by the
+ "url" attribute.
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The "error" element contains error information from the server.
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extension element for partial response. It may contain
+ implementation specific content.
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
From 6eaaec4e4ee69a1374c31f5b64c6dbf499a51035 Mon Sep 17 00:00:00 2001
From: Bauke Scholtz
Date: Sun, 3 Mar 2024 14:07:44 -0400
Subject: [PATCH 7/9] discovered while writing TCK: the UUIDConverter wasn't
properly registered on converterId; while at it took opportunity to refactor
hardcoded converter IDs
---
.../applicationimpl/InstanceFactory.java | 47 ++++++++++++-------
1 file changed, 29 insertions(+), 18 deletions(-)
diff --git a/impl/src/main/java/com/sun/faces/application/applicationimpl/InstanceFactory.java b/impl/src/main/java/com/sun/faces/application/applicationimpl/InstanceFactory.java
index 2c6e702683..e328c494ad 100644
--- a/impl/src/main/java/com/sun/faces/application/applicationimpl/InstanceFactory.java
+++ b/impl/src/main/java/com/sun/faces/application/applicationimpl/InstanceFactory.java
@@ -53,20 +53,11 @@
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;
+import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
-import com.sun.faces.application.ApplicationAssociate;
-import com.sun.faces.application.ConverterPropertyEditorFactory;
-import com.sun.faces.application.ViewMemberInstanceFactoryMetadataMap;
-import com.sun.faces.cdi.CdiUtils;
-import com.sun.faces.config.WebConfiguration;
-import com.sun.faces.util.FacesLogger;
-import com.sun.faces.util.MessageUtils;
-import com.sun.faces.util.ReflectionUtils;
-import com.sun.faces.util.Util;
-
import jakarta.el.ExpressionFactory;
import jakarta.el.ValueExpression;
import jakarta.enterprise.inject.spi.BeanManager;
@@ -76,13 +67,32 @@
import jakarta.faces.component.UIComponent;
import jakarta.faces.component.behavior.Behavior;
import jakarta.faces.context.FacesContext;
+import jakarta.faces.convert.BooleanConverter;
+import jakarta.faces.convert.ByteConverter;
+import jakarta.faces.convert.CharacterConverter;
import jakarta.faces.convert.Converter;
import jakarta.faces.convert.DateTimeConverter;
+import jakarta.faces.convert.DoubleConverter;
+import jakarta.faces.convert.FloatConverter;
+import jakarta.faces.convert.IntegerConverter;
+import jakarta.faces.convert.LongConverter;
+import jakarta.faces.convert.ShortConverter;
+import jakarta.faces.convert.UUIDConverter;
import jakarta.faces.render.RenderKit;
import jakarta.faces.render.Renderer;
import jakarta.faces.validator.Validator;
import jakarta.faces.view.ViewDeclarationLanguage;
+import com.sun.faces.application.ApplicationAssociate;
+import com.sun.faces.application.ConverterPropertyEditorFactory;
+import com.sun.faces.application.ViewMemberInstanceFactoryMetadataMap;
+import com.sun.faces.cdi.CdiUtils;
+import com.sun.faces.config.WebConfiguration;
+import com.sun.faces.util.FacesLogger;
+import com.sun.faces.util.MessageUtils;
+import com.sun.faces.util.ReflectionUtils;
+import com.sun.faces.util.Util;
+
public class InstanceFactory {
// Log instance for this class
@@ -97,14 +107,15 @@ public class InstanceFactory {
private static final Map, String> STANDARD_TYPE_TO_CONV_ID_MAP = new HashMap<>(16, 1.0f);
static {
- STANDARD_CONV_ID_TO_TYPE_MAP.put("jakarta.faces.Byte", new Class>[] { Byte.TYPE, Byte.class });
- STANDARD_CONV_ID_TO_TYPE_MAP.put("jakarta.faces.Boolean", new Class>[] { Boolean.TYPE, Boolean.class });
- STANDARD_CONV_ID_TO_TYPE_MAP.put("jakarta.faces.Character", new Class>[] { Character.TYPE, Character.class });
- STANDARD_CONV_ID_TO_TYPE_MAP.put("jakarta.faces.Short", new Class>[] { Short.TYPE, Short.class });
- STANDARD_CONV_ID_TO_TYPE_MAP.put("jakarta.faces.Integer", new Class>[] { Integer.TYPE, Integer.class });
- STANDARD_CONV_ID_TO_TYPE_MAP.put("jakarta.faces.Long", new Class>[] { Long.TYPE, Long.class });
- STANDARD_CONV_ID_TO_TYPE_MAP.put("jakarta.faces.Float", new Class>[] { Float.TYPE, Float.class });
- STANDARD_CONV_ID_TO_TYPE_MAP.put("jakarta.faces.Double", new Class>[] { Double.TYPE, Double.class });
+ STANDARD_CONV_ID_TO_TYPE_MAP.put(ByteConverter.CONVERTER_ID, new Class>[] { Byte.TYPE, Byte.class });
+ STANDARD_CONV_ID_TO_TYPE_MAP.put(BooleanConverter.CONVERTER_ID, new Class>[] { Boolean.TYPE, Boolean.class });
+ STANDARD_CONV_ID_TO_TYPE_MAP.put(CharacterConverter.CONVERTER_ID, new Class>[] { Character.TYPE, Character.class });
+ STANDARD_CONV_ID_TO_TYPE_MAP.put(ShortConverter.CONVERTER_ID, new Class>[] { Short.TYPE, Short.class });
+ STANDARD_CONV_ID_TO_TYPE_MAP.put(IntegerConverter.CONVERTER_ID, new Class>[] { Integer.TYPE, Integer.class });
+ STANDARD_CONV_ID_TO_TYPE_MAP.put(LongConverter.CONVERTER_ID, new Class>[] { Long.TYPE, Long.class });
+ STANDARD_CONV_ID_TO_TYPE_MAP.put(FloatConverter.CONVERTER_ID, new Class>[] { Float.TYPE, Float.class });
+ STANDARD_CONV_ID_TO_TYPE_MAP.put(DoubleConverter.CONVERTER_ID, new Class>[] { Double.TYPE, Double.class });
+ STANDARD_CONV_ID_TO_TYPE_MAP.put(UUIDConverter.CONVERTER_ID, new Class>[] { UUID.class });
for (Map.Entry[]> entry : STANDARD_CONV_ID_TO_TYPE_MAP.entrySet()) {
Class>[] types = entry.getValue();
String key = entry.getKey();
From 11d05f523b1e1a8d9f00256e21ab13970320bed4 Mon Sep 17 00:00:00 2001
From: Arjan Tijms
Date: Tue, 5 Mar 2024 15:42:45 +0100
Subject: [PATCH 8/9] Update dependencies
Specifically, update to those of the Jakarta 11 wave 1-4 release
Signed-off-by: Arjan Tijms
---
action/pom.xml | 6 +++---
cdi/pom.xml | 4 ++--
impl/pom.xml | 18 +++++++++---------
.../faces/util/ELAwareBeanManagerWrapper.java | 12 +++++++++++-
.../com/sun/faces/mock/MockBeanManager.java | 10 ++++++++++
pom.xml | 4 ++--
rest/pom.xml | 6 +++---
7 files changed, 40 insertions(+), 20 deletions(-)
diff --git a/action/pom.xml b/action/pom.xml
index 3db281341c..5acbfe2bb6 100644
--- a/action/pom.xml
+++ b/action/pom.xml
@@ -1,7 +1,7 @@
maven-compiler-plugin
- 3.11.0
+ 3.12.117-Xlint:unchecked
diff --git a/rest/pom.xml b/rest/pom.xml
index ce36007ff7..e4d1f4b49f 100644
--- a/rest/pom.xml
+++ b/rest/pom.xml
@@ -1,7 +1,7 @@