MvelSourcePropertyFactory implements SourcePropertyFactory { @Override public SourceProperty getSourceProperty( String expression ) { try { return compileAndReturnProperty( expression ); } catch( ArrayIndexOutOfBoundsException exception ) { log.warn( "Error while compiling expression {}", exception ); return null; } catch( CompileException exception ) { log.warn( "Error while compiling expression {}", exception ); return null; } }  @Override SourceProperty getSourceProperty( String expression ); @Override SourceProperty getSourceProperty( String expressionPrefix, String unprefixedExpression ); @Override boolean supportsPrefix( String prefix );  }
@Test public void testGetSourcePropertyForInvalidUnprefixedExpressionReturnsNull() { assertNull( factory.getSourceProperty( "this." ) ); }
@Test( expected=MissingSourcePropertyException.class ) public void testGetSourcePropertyForInvalidPrefixedExpression1ThrowsMissingSourcePropertyException() { factory.getSourceProperty( "mvel", "this." ); }
@Test( expected=MissingSourcePropertyException.class ) public void testGetSourcePropertyForInvalidPrefixedExpression2ThrowsMissingSourcePropertyException() { factory.getSourceProperty( "mvel", "testMethod(" ); }