@Test
public void testNullItem() throws Exception {

    String itemKey = "item";
    final String expr = itemKey + ".other.name";
    try {
        final TestObj item = new TestObj();
        final Map<String, Object> model = Collections.<String, Object>singletonMap(itemKey, item);
        final TRenderContext context = new TRenderContext(new ByteArrayOutputStream(), model);
        context.getModelValue(expr);
        fail("Expected an exception");
    } catch (TemplateException e) {
        assertTrue(e.getMessage(), e.getMessage().contains(expr));
        assertTrue(e.getMessage(), e.getMessage().contains("value of the property"));
        assertTrue(e.getMessage(), e.getMessage().contains("is null"));
    }
}