MCPcopy Index your code
hub / github.com/apache/tomcat / testSetValue04

Method testSetValue04

test/jakarta/el/TestArrayELResolver.java:258–273  ·  view source on GitHub ↗

Tests that a valid property is set.

()

Source from the content-addressed store, hash-verified

256 * Tests that a valid property is set.
257 */
258 @Test
259 public void testSetValue04() {
260 ArrayELResolver resolver = new ArrayELResolver();
261 ELContext context = new StandardELContext(ELManager.getExpressionFactory());
262
263 String[] base = new String[] { "element" };
264 resolver.setValue(context, base, Integer.valueOf(0), "new-element");
265
266 Assert.assertEquals("new-element", resolver.getValue(context, base, Integer.valueOf(0)));
267 Assert.assertTrue(context.isPropertyResolved());
268
269 resolver.setValue(context, base, Integer.valueOf(0), null);
270
271 Assert.assertEquals(null, resolver.getValue(context, base, Integer.valueOf(0)));
272 Assert.assertTrue(context.isPropertyResolved());
273 }
274
275 /**
276 * Tests a coercion cannot be performed as the key is not integer.

Callers

nothing calls this directly

Calls 5

getExpressionFactoryMethod · 0.95
setValueMethod · 0.95
getValueMethod · 0.95
valueOfMethod · 0.45
isPropertyResolvedMethod · 0.45

Tested by

no test coverage detected