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

Method testIsReadOnly03

test/jakarta/el/TestMapELResolver.java:185–201  ·  view source on GitHub ↗

Tests that if the MapELResolver is constructed with readOnly the method will return always true, otherwise false.

()

Source from the content-addressed store, hash-verified

183 * Tests that if the MapELResolver is constructed with readOnly the method will return always true, otherwise false.
184 */
185 @Test
186 public void testIsReadOnly03() {
187 MapELResolver mapELResolver = new MapELResolver();
188 ELContext context = new StandardELContext(ELManager.getExpressionFactory());
189
190 boolean result = mapELResolver.isReadOnly(context, new HashMap<>(), new Object());
191
192 Assert.assertFalse(result);
193 Assert.assertTrue(context.isPropertyResolved());
194
195 mapELResolver = new MapELResolver(true);
196
197 result = mapELResolver.isReadOnly(context, new HashMap<>(), new Object());
198
199 Assert.assertTrue(result);
200 Assert.assertTrue(context.isPropertyResolved());
201 }
202
203 /**
204 * Tests that the readOnly is true always when the map is not modifiable.

Callers

nothing calls this directly

Calls 3

getExpressionFactoryMethod · 0.95
isReadOnlyMethod · 0.95
isPropertyResolvedMethod · 0.45

Tested by

no test coverage detected