Package org.jboss.dashboard.provider

Examples of org.jboss.dashboard.provider.DefaultDataSetFilter.addProperty()


    }

    @Test
    public void testFilterBySingleNumber() throws Exception {
        DefaultDataSetFilter filter = new DefaultDataSetFilter(dataSet);
        filter.addProperty("id", null, false, null, false, Arrays.asList(25), DataFilter.ALLOW_ANY);
        DataSet result = dataSet.filter(filter);
        assertDataSetValue(result, 0, 0, "25");
    }

    @Test
View Full Code Here


    }

    @Test
    public void testFilterBySingleString() throws Exception {
        DefaultDataSetFilter filter = new DefaultDataSetFilter(dataSet);
        filter.addProperty("employee", null, false, null, false, Arrays.asList("Jerri Preble"), DataFilter.ALLOW_ANY);
        DataSet result = dataSet.filter(filter);
        assertDataSetValue(result, 0, 0, "27");
        assertDataSetValue(result, 1, 0, "28");
    }
View Full Code Here

    @Test
    public void testFilterBySingleDate() throws Exception {
        SimpleDateFormat df = new SimpleDateFormat("MM/dd/yy HH:mm");
        Date date = df.parse("07/23/11 12:00");
        DefaultDataSetFilter filter = new DefaultDataSetFilter(dataSet);
        filter.addProperty("date", null, false, null, false, Arrays.asList(date), DataFilter.ALLOW_ANY);
        DataSet result = dataSet.filter(filter);
        assertDataSetValue(result, 0, 0, "19");
    }

    @Test
View Full Code Here

    public void testFilterByDateInterval() throws Exception {
        SimpleDateFormat df = new SimpleDateFormat("MM/dd/yy HH:mm");
        Date from = df.parse("01/01/11 00:00");
        Date to = df.parse("12/31/11 23:59");
        DefaultDataSetFilter filter = new DefaultDataSetFilter(dataSet);
        filter.addProperty("date", from, true, to, true, null, DataFilter.ALLOW_ANY);
        DataSet result = dataSet.filter(filter);
        assertThat(result.getRowCount()).isEqualTo(11);
        assertDataSetValue(result, 0, 0, "16");
    }
View Full Code Here

    @Test
    public void testFilterByDateInterval2() throws Exception {
        SimpleDateFormat df = new SimpleDateFormat("MM/dd/yy HH:mm");
        DefaultDataSetFilter filter = new DefaultDataSetFilter(dataSet);
        filter.addProperty("date", "*/11 *");
        DataSet result = dataSet.filter(filter);
        assertThat(result.getRowCount()).isEqualTo(11);
        assertDataSetValue(result, 0, 0, "16");
    }

View Full Code Here


    @Test
    public void testFilterByWildcard() throws Exception {
        DefaultDataSetFilter filter = new DefaultDataSetFilter(dataSet);
        filter.addProperty("city", "B*");
        filter.addProperty("department", "*Services*");
        DataSet result = dataSet.filter(filter);
        assertThat(result.getRowCount()).isEqualTo(3);
        assertDataSetValue(result, 0, 0, "4");
    }
View Full Code Here

    @Test
    public void testFilterByWildcard() throws Exception {
        DefaultDataSetFilter filter = new DefaultDataSetFilter(dataSet);
        filter.addProperty("city", "B*");
        filter.addProperty("department", "*Services*");
        DataSet result = dataSet.filter(filter);
        assertThat(result.getRowCount()).isEqualTo(3);
        assertDataSetValue(result, 0, 0, "4");
    }

View Full Code Here

    }

    @Test
    public void testFilterByNumberInterval() throws Exception {
        DefaultDataSetFilter filter = new DefaultDataSetFilter(dataSet);
        filter.addProperty("amount", 1000, false, null, false, null, DataFilter.ALLOW_ANY);
        DataSet result = dataSet.filter(filter);
        assertThat(result.getRowCount()).isEqualTo(2);
        assertDataSetValue(result, 0, 0, "2");
    }
View Full Code Here

    }

    @Test
    public void testFilterMultiple() throws Exception {
        DefaultDataSetFilter filter = new DefaultDataSetFilter(dataSet);
        filter.addProperty("amount", null, false, 500, false, null, DataFilter.ALLOW_ANY);
        filter.addProperty("date", "*/11 *");
        filter.addProperty("department", "Engineering");
        DataSet result = dataSet.filter(filter);
        assertThat(result.getRowCount()).isEqualTo(7);
    }
View Full Code Here

    @Test
    public void testFilterMultiple() throws Exception {
        DefaultDataSetFilter filter = new DefaultDataSetFilter(dataSet);
        filter.addProperty("amount", null, false, 500, false, null, DataFilter.ALLOW_ANY);
        filter.addProperty("date", "*/11 *");
        filter.addProperty("department", "Engineering");
        DataSet result = dataSet.filter(filter);
        assertThat(result.getRowCount()).isEqualTo(7);
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.