use of jakarta.el.ELProcessor in project tomcat by apache.
the class TestCollectionOperations method testCount02.
@Test
public void testCount02() {
ELProcessor processor = new ELProcessor();
Object result = processor.getValue("[].stream().count()", Object.class);
Assert.assertTrue("Result: " + result.toString(), ELSupport.equals(null, Long.valueOf(0), result));
}
use of jakarta.el.ELProcessor in project tomcat by apache.
the class TestCollectionOperations method testFindFirst02.
@Test(expected = ELException.class)
public void testFindFirst02() {
ELProcessor processor = new ELProcessor();
Optional result = (Optional) processor.getValue("[].stream().findFirst()", Object.class);
result.get();
}
use of jakarta.el.ELProcessor in project tomcat by apache.
the class TestCollectionOperations method testMin03.
@Test(expected = ELException.class)
public void testMin03() {
ELProcessor processor = new ELProcessor();
Object result = processor.getValue("[].stream().min()", Object.class);
((Optional) result).get();
}
use of jakarta.el.ELProcessor in project tomcat by apache.
the class TestCollectionOperations method testSubstreamStartEnd01.
@Test
public void testSubstreamStartEnd01() {
ELProcessor processor = new ELProcessor();
processor.defineBean("beans", beans);
Object result = processor.getValue("beans.stream().substream(1,2).toList()", Object.class);
List<TesterBeanA> expected = new ArrayList<>(2);
expected.add(bean02);
Assert.assertEquals(expected, result);
}
use of jakarta.el.ELProcessor in project tomcat by apache.
the class TestCollectionOperations method testMinLambda01.
@Test
public void testMinLambda01() {
ELProcessor processor = new ELProcessor();
processor.defineBean("beans", beans);
Object result = processor.getValue("beans.stream().min((x,y)->x.name.compareTo(y.name))", Object.class);
Assert.assertEquals(bean01, ((Optional) result).get());
}
Aggregations