MCPcopy Create free account
hub / github.com/apache/tomcat / testIsReadOnly04

Method testIsReadOnly04

test/jakarta/el/TestMapELResolver.java:206–216  ·  view source on GitHub ↗

Tests that the readOnly is true always when the map is not modifiable.

()

Source from the content-addressed store, hash-verified

204 * Tests that the readOnly is true always when the map is not modifiable.
205 */
206 @Test
207 public void testIsReadOnly04() {
208 MapELResolver mapELResolver = new MapELResolver();
209 ELContext context = new StandardELContext(ELManager.getExpressionFactory());
210
211 Map<Object,Object> map = Collections.unmodifiableMap(new HashMap<>());
212 boolean result = mapELResolver.isReadOnly(context, map, new Object());
213
214 Assert.assertTrue(result);
215 Assert.assertTrue(context.isPropertyResolved());
216 }
217
218 private void doNegativeTest(Object base, Object trigger, MethodUnderTest method, boolean checkResult) {
219 MapELResolver resolver = new MapELResolver();

Callers

nothing calls this directly

Calls 3

getExpressionFactoryMethod · 0.95
isReadOnlyMethod · 0.95
isPropertyResolvedMethod · 0.45

Tested by

no test coverage detected