Package org.eurekaj.manager.datatypes

Examples of org.eurekaj.manager.datatypes.ManagerStatistics


    }

    @Test
    public void test_that_one_node_element_returns_correct_json_object() throws JSONException {
        List<Statistics> nodeList = new ArrayList<Statistics>();
        nodeList.add(new ManagerStatistics("A", "ACCOUNT", "Y"));

        JSONArray jsonObject = BuildJsonObjectsUtil.buildTreeTypeMenuJsonObject("treeMenuID", nodeList, new ArrayList<Alert>(), new ArrayList<GroupedStatistics>(), 0, 20, false, "chart");
        assertEquals("[{\"id\":\"A\",\"name\":\"A\",\"children\":[],\"nodeType\":\"chart\",\"chart\":\"A\",\"_id\":null}]", jsonObject.toString());
       
       
View Full Code Here


    }

    @Test
    public void test_that_two_node_element_returns_correct_json_object() throws JSONException {
        List<Statistics> nodeList = new ArrayList<Statistics>();
        nodeList.add(new ManagerStatistics("A", "ACCOUNT", "Y"));
        nodeList.add(new ManagerStatistics("B", "ACCOUNT", "Y"));
           
        JSONArray jsonObject = BuildJsonObjectsUtil.buildTreeTypeMenuJsonObject("treeMenuID", nodeList, new ArrayList<Alert>(), new ArrayList<GroupedStatistics>(), 0, 20, false, "chart");
        assertEquals("[{\"id\":\"A\",\"name\":\"A\",\"children\":[],\"nodeType\":\"chart\",\"chart\":\"A\",\"_id\":null},{\"id\":\"B\",\"name\":\"B\",\"children\":[],\"nodeType\":\"chart\",\"chart\":\"B\",\"_id\":null}]", jsonObject.toString());
    }
View Full Code Here

    }

    @Test
    public void test_that_second_level_nodes_generated_correct_json() throws JSONException {
        List<Statistics> nodeList = new ArrayList<Statistics>();
        nodeList.add(new ManagerStatistics("A", "ACCOUNT", "Y"));
        nodeList.add(new ManagerStatistics("B", "ACCOUNT", "Y"));
        nodeList.add(new ManagerStatistics("A:C", "ACCOUNT", "Y"));

        JSONArray jsonObject = BuildJsonObjectsUtil.buildTreeTypeMenuJsonObject("treeMenuID", nodeList, new ArrayList<Alert>(), new ArrayList<GroupedStatistics>()0, 20, false, "chart");
        assertEquals("[{\"id\":\"A\",\"name\":\"A\",\"children\":[],\"nodeType\":\"chart\",\"chart\":\"A\",\"_id\":null},{\"id\":\"B\",\"name\":\"B\",\"children\":[],\"nodeType\":\"chart\",\"chart\":\"B\",\"_id\":null}]", jsonObject.toString());
    }
View Full Code Here

    }

    @Test
    public void test_that_third_level_nodes_generated_correct_json() throws JSONException {
        List<Statistics> nodeList = new ArrayList<Statistics>();
        nodeList.add(new ManagerStatistics("A", "ACCOUNT", "Y"));
        nodeList.add(new ManagerStatistics("B", "ACCOUNT", "Y"));
        nodeList.add(new ManagerStatistics("A:C", "ACCOUNT", "Y"));
        nodeList.add(new ManagerStatistics("A:C:D", "ACCOUNT", "Y"));
           
        StringBuilder expected = new StringBuilder();
        expected.append("[");
        expected.append("{\"id\":\"A\",\"name\":\"A\",\"children\":[\"A:C\"],\"nodeType\":\"chart\",\"chart\":\"A\",\"_id\":null}");
        expected.append(",");
View Full Code Here

    }

    @Test
    public void test_that_third_level_nodes_without_s_are_generated_correct_json() throws JSONException {
        List<Statistics> nodeList = new ArrayList<Statistics>();
        nodeList.add(new ManagerStatistics("A:B:C", "ACCOUNT", "Y"));
       
        StringBuilder expected = new StringBuilder();
        expected.append("[");
        expected.append("{\"id\":\"A\",\"name\":\"A\",\"children\":[\"A:B\"],\"nodeType\":\"chart\",\"chart\":\"A\",\"_id\":null}");
        expected.append(",");
View Full Code Here

    }

    @Test
    public void test_that_deep_nodes_without_s_generates_correct_json() throws JSONException {
        List<Statistics> nodeList = new ArrayList<Statistics>();
        nodeList.add(new ManagerStatistics("JSFlotJAgent:Custom:org.jsflot.components.BubbleDataPointComponent:<init>:Max Selftime", "ACCOUNT", "Y"));
       
        StringBuilder expected = new StringBuilder();
        expected.append("[");
        expected.append("{\"id\":\"JSFlotJAgent\",\"name\":\"JSFlotJAgent\",\"children\":[\"JSFlotJAgent:Custom\"],\"nodeType\":\"chart\",\"chart\":\"JSFlotJAgent\",\"_id\":null}");
        expected.append(",");
View Full Code Here

TOP

Related Classes of org.eurekaj.manager.datatypes.ManagerStatistics

Copyright © 2018 www.massapicom. 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.