use of org.apache.el.TesterBeanA in project tomcat by apache.
the class TestCollectionOperations method testLimit01.
@Test
public void testLimit01() {
ELProcessor processor = new ELProcessor();
processor.defineBean("beans", beans);
Object result = processor.getValue("beans.stream().limit(2).toList()", Object.class);
List<TesterBeanA> expected = new ArrayList<>(2);
expected.add(bean01);
expected.add(bean02);
Assert.assertEquals(expected, result);
}
use of org.apache.el.TesterBeanA 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 org.apache.el.TesterBeanA in project tomcat by apache.
the class TestCollectionOperations method testFilter01.
@Test
public void testFilter01() {
ELProcessor processor = new ELProcessor();
processor.defineBean("beans", beans);
Object result = processor.getValue("beans.stream().filter(b->b.valLong > 2).toList()", List.class);
List<TesterBeanA> expected = new ArrayList<>(1);
expected.add(bean03);
Assert.assertEquals(expected, result);
}
use of org.apache.el.TesterBeanA in project tomcat by apache.
the class TestCollectionOperations method testSubstreamStart01.
@Test
public void testSubstreamStart01() {
ELProcessor processor = new ELProcessor();
processor.defineBean("beans", beans);
Object result = processor.getValue("beans.stream().substream(1).toList()", Object.class);
List<TesterBeanA> expected = new ArrayList<>(2);
expected.add(bean02);
expected.add(bean03);
Assert.assertEquals(expected, result);
}
use of org.apache.el.TesterBeanA in project tomcat by apache.
the class TestCollectionOperations method testPeek01.
@Test
public void testPeek01() {
ELProcessor processor = new ELProcessor();
List<TesterBeanA> debug = new ArrayList<>();
processor.defineBean("beans", beans);
processor.defineBean("debug", debug);
Object result = processor.getValue("beans.stream().peek(b->debug.add(b)).toList()", Object.class);
List<TesterBeanA> expected = new ArrayList<>(3);
expected.add(bean01);
expected.add(bean02);
expected.add(bean03);
Assert.assertEquals(expected, result);
Assert.assertEquals(expected, debug);
}
Aggregations