@Test @Ignore public void testBuildPieChartURL() { List<Integer> chartData = new ArrayList<Integer>(); chartData.add(5); chartData.add(6); chartData.add(7); chartData.add(8); List<String> chartLabels = new ArrayList<String>(); chartLabels.add("GO:0003824 catalytic activity (190)"); chartLabels.add("GO:0006412 translation (187)"); chartLabels.add("GO:0008152 metabolic process (176)"); chartLabels.add("GO:0003735 structural constituent of (173)"); Properties props = new Properties(); props.put(GoogleChartFactory.CHART_COLOUR, "FFCC33|7637A2"); props.put(GoogleChartFactory.CHART_MARGIN, "270,270"); props.put(GoogleChartFactory.CHART_SIZE, "740x180"); String actual = GoogleChartFactory.buildPieChartURL(props, chartData, chartLabels); String expected = "http: Assert.assertEquals(expected, actual); }
public static String buildPieChartURL(Properties props, List<Integer> chartData, List<String> chartLabels) { if (chartData != null && chartData.size() > 0 && chartLabels != null && chartLabels.size() > 0) { StringBuffer result = new StringBuffer(BASE_GOOGLE_CHART_URL); addParameter(result, CHART_TYPE, "p3"); addGoogleChartParams(result, props); addChartData(result, chartData); addChartLabels(result, chartLabels); return result.toString(); } else { return null; } }
GoogleChartFactory { public static String buildPieChartURL(Properties props, List<Integer> chartData, List<String> chartLabels) { if (chartData != null && chartData.size() > 0 && chartLabels != null && chartLabels.size() > 0) { StringBuffer result = new StringBuffer(BASE_GOOGLE_CHART_URL); addParameter(result, CHART_TYPE, "p3"); addGoogleChartParams(result, props); addChartData(result, chartData); addChartLabels(result, chartLabels); return result.toString(); } else { return null; } } }
GoogleChartFactory { public static String buildPieChartURL(Properties props, List<Integer> chartData, List<String> chartLabels) { if (chartData != null && chartData.size() > 0 && chartLabels != null && chartLabels.size() > 0) { StringBuffer result = new StringBuffer(BASE_GOOGLE_CHART_URL); addParameter(result, CHART_TYPE, "p3"); addGoogleChartParams(result, props); addChartData(result, chartData); addChartLabels(result, chartLabels); return result.toString(); } else { return null; } } private  GoogleChartFactory(); }
GoogleChartFactory { public static String buildPieChartURL(Properties props, List<Integer> chartData, List<String> chartLabels) { if (chartData != null && chartData.size() > 0 && chartLabels != null && chartLabels.size() > 0) { StringBuffer result = new StringBuffer(BASE_GOOGLE_CHART_URL); addParameter(result, CHART_TYPE, "p3"); addGoogleChartParams(result, props); addChartData(result, chartData); addChartLabels(result, chartLabels); return result.toString(); } else { return null; } } private  GoogleChartFactory(); static String buildPieChartURL(Properties props, List<Integer> chartData, List<String> chartLabels); static String buildHorizontalBarChartURL(Properties props, List<Integer> chartData, List<String> chartLabels); static String buildVerticalBarChartURL(Properties props, List<Integer> chartData); static String buildChartURL(Properties props, List<Integer> chartData); }
GoogleChartFactory { public static String buildPieChartURL(Properties props, List<Integer> chartData, List<String> chartLabels) { if (chartData != null && chartData.size() > 0 && chartLabels != null && chartLabels.size() > 0) { StringBuffer result = new StringBuffer(BASE_GOOGLE_CHART_URL); addParameter(result, CHART_TYPE, "p3"); addGoogleChartParams(result, props); addChartData(result, chartData); addChartLabels(result, chartLabels); return result.toString(); } else { return null; } } private  GoogleChartFactory(); static String buildPieChartURL(Properties props, List<Integer> chartData, List<String> chartLabels); static String buildHorizontalBarChartURL(Properties props, List<Integer> chartData, List<String> chartLabels); static String buildVerticalBarChartURL(Properties props, List<Integer> chartData); static String buildChartURL(Properties props, List<Integer> chartData); static final String CHART_SIZE; static final String CHART_COLOUR; static final String CHART_TYPE; static final String CHART_DATA; static final String CHART_LABEL; static final String CHART_LEGEND_TEXT; static final String CHART_MARGIN; static final String CHART_AXES; static final String CHART_AXES_LABELS; static final String CHART_MARKER; static final String CHART_DATA_SCALE; }