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

Method testConvertToType03

test/jakarta/el/TestELContext.java:154–168  ·  view source on GitHub ↗

Tests that if there is ELResolver it will handle the conversion. If this resolver cannot return a result the standard coercions will be invoked.

()

Source from the content-addressed store, hash-verified

152 * standard coercions will be invoked.
153 */
154 @Test
155 public void testConvertToType03() {
156 ELContext elContext = new TesterELContext(new TesterELResolverOne());
157
158 boolean originalPropertyResolved = false;
159 elContext.setPropertyResolved(originalPropertyResolved);
160
161 Object result = elContext.convertToType("1", String.class);
162 Assert.assertEquals("ONE", result);
163 Assert.assertTrue(originalPropertyResolved == elContext.isPropertyResolved());
164
165 result = elContext.convertToType("test", String.class);
166 Assert.assertEquals("test", result);
167 Assert.assertTrue(originalPropertyResolved == elContext.isPropertyResolved());
168 }
169}

Callers

nothing calls this directly

Calls 3

setPropertyResolvedMethod · 0.45
convertToTypeMethod · 0.45
isPropertyResolvedMethod · 0.45

Tested by

no test coverage detected