use of jakarta.el.ELProcessor in project tomcat by apache.
the class TestCollectionOperations method testNoneMatch03.
@Test
public void testNoneMatch03() {
ELProcessor processor = new ELProcessor();
Optional result = (Optional) processor.getValue("[1,2,3,4,5].stream().noneMatch(x->x>10)", Object.class);
Assert.assertEquals(Boolean.TRUE, result.get());
}
use of jakarta.el.ELProcessor in project tomcat by apache.
the class TestCollectionOperations method testAverage06.
@Test(expected = ELException.class)
public void testAverage06() {
ELProcessor processor = new ELProcessor();
processor.getValue("[].stream().average().orElseGet(10)", Object.class);
}
use of jakarta.el.ELProcessor in project tomcat by apache.
the class TestCollectionOperations method testAnyMatch02.
@Test
public void testAnyMatch02() {
ELProcessor processor = new ELProcessor();
Optional result = (Optional) processor.getValue("[1,2,3,4,5].stream().anyMatch(x->x==3)", Object.class);
Assert.assertEquals(Boolean.TRUE, result.get());
}
use of jakarta.el.ELProcessor in project tomcat by apache.
the class TestCollectionOperations method testAverage05.
@Test
public void testAverage05() {
ELProcessor processor = new ELProcessor();
Object result = processor.getValue("[].stream().average().orElseGet(()->()->10)", Object.class);
Assert.assertEquals(Long.valueOf(10), result);
}
use of jakarta.el.ELProcessor in project tomcat by apache.
the class TestCollectionOperations method testToList01.
@Test
public void testToList01() {
ELProcessor processor = new ELProcessor();
Object result = processor.getValue("['a','b','c'].stream().toList()", List.class);
List<String> expected = new ArrayList<>(3);
expected.add("a");
expected.add("b");
expected.add("c");
Assert.assertEquals(expected, result);
}
Aggregations