/** * Returns an instance of Expressions that doesn't require * any functions or perform any caching. Use only for testing. */ public static Expressions forTesting() { return new Expressions(null, null, new JuelTypeConverter(), new JuelProvider()); }
@Override protected void configure() { bind(ExpressionProvider.class).to(JuelProvider.class).in(Scopes.SINGLETON); } }
@Test public void booleanCoercionOfNumbersFails() throws Exception { addVariable("bool", 0); assertTrue(evaluate("${!bool}", Boolean.class)); addVariable("bool", 1); assertFalse(evaluate("${!bool}", Boolean.class)); evaluate("${true && 5}", String.class); }
/** * Returns an instance of Expressions that doesn't require * any functions or perform any caching. Use only for testing. */ public static Expressions forTesting() { return new Expressions(null, null, new JuelTypeConverter(), new JuelProvider()); }
@Test public void booleanCoercionOfNumbersFails() throws Exception { addVariable("bool", 0); assertTrue(evaluate("${!bool}", Boolean.class)); addVariable("bool", 1); assertFalse(evaluate("${!bool}", Boolean.class)); evaluate("${true && 5}", String.class); }
@Override protected void configure() { bind(ExpressionProvider.class).to(JuelProvider.class).in(Scopes.SINGLETON); } }
/** * Returns an instance of Expressions that doesn't require * any functions or perform any caching. Use only for testing. */ public static Expressions forTesting(Functions functions) { return new Expressions(functions, null, new JuelTypeConverter(), new JuelProvider()); }
@Test public void booleanCoercionOfNumbersFails() throws Exception { addVariable("bool", 0); assertTrue(evaluate("${!bool}", Boolean.class)); addVariable("bool", 1); assertFalse(evaluate("${!bool}", Boolean.class)); evaluate("${true && 5}", String.class); }
/** * Returns an instance of Expressions that doesn't require * any functions or perform any caching. Use only for testing. */ public static Expressions forTesting(Functions functions) { return new Expressions(functions, null, new JuelTypeConverter(), new JuelProvider()); }
@Test public void booleanCoercionOfNumbersFails() throws Exception { addVariable("bool", 0); assertTrue(evaluate("${!bool}", Boolean.class)); addVariable("bool", 1); assertFalse(evaluate("${!bool}", Boolean.class)); evaluate("${true && 5}", String.class); }
/** * Returns an instance of Expressions that doesn't require * any functions or perform any caching. Use only for testing. */ @VisibleForTesting public static Expressions forTesting() { return new Expressions(null, null, new JuelTypeConverter(), new JuelProvider()); }
@Test public void booleanCoercionOfStringsFails() throws Exception { addVariable("bool", "FALSE"); assertFalse(evaluate("${!bool}", Boolean.class)); addVariable("bool", "booga"); assertFalse(evaluate("${!bool}", Boolean.class)); }
/** * Returns an instance of Expressions that doesn't require * any functions or perform any caching. Use only for testing. */ @VisibleForTesting public static Expressions forTesting(Functions functions) { return new Expressions(functions, null, new JuelTypeConverter(), new JuelProvider()); }
@Test public void booleanCoercionOfStringsFails() throws Exception { addVariable("bool", "FALSE"); assertFalse(evaluate("${!bool}", Boolean.class)); addVariable("bool", "booga"); assertFalse(evaluate("${!bool}", Boolean.class)); }
/** * Returns an instance of Expressions that doesn't require * any functions or perform any caching. Use only for testing. */ @VisibleForTesting public static Expressions forTesting(Functions functions) { return new Expressions(functions, null, new JuelTypeConverter(), new JuelProvider()); }
@Test public void booleanCoercionOfStringsFails() throws Exception { addVariable("bool", "FALSE"); assertFalse(evaluate("${!bool}", Boolean.class)); addVariable("bool", "booga"); assertFalse(evaluate("${!bool}", Boolean.class)); }
/** * Returns an instance of Expressions that doesn't require * any functions or perform any caching. Use only for testing. */ @VisibleForTesting public static Expressions forTesting() { return new Expressions(null, null, new JuelTypeConverter(), new JuelProvider()); }
@Test public void booleanCoercionOfStringsFails() throws Exception { addVariable("bool", "FALSE"); assertFalse(evaluate("${!bool}", Boolean.class)); addVariable("bool", "booga"); assertFalse(evaluate("${!bool}", Boolean.class)); }
/** * Returns an instance of Expressions that doesn't require * any functions or perform any caching. Use only for testing. */ @VisibleForTesting public static Expressions forTesting() { return new Expressions(null, null, new JuelTypeConverter(), new JuelProvider()); }
/** * Returns an instance of Expressions that doesn't require * any functions or perform any caching. Use only for testing. */ @VisibleForTesting public static Expressions forTesting(Functions functions) { return new Expressions(functions, null, new JuelTypeConverter(), new JuelProvider()); }