@Test public void testGraphSerie() throws Exception { PowerMockito.mockStatic(Log.class); ArrayList<Datapoint> nullSerie = null; ArrayList<Datapoint> emptySerie = new ArrayList(); ArrayList<Datapoint> serie = new ArrayList(); for (int i = 0; i < 1000; i++) { serie.add(new Datapoint(i, 1000 - i)); } GraphSerie gs1 = new GraphSerie("gs1", nullSerie); GraphSerie gs2 = new GraphSerie("gs2", emptySerie); GraphSerie gs3 = new GraphSerie("gs3", serie); assertTrue(gs1.size() == 0); assertTrue(gs2.size() == 0); assertTrue(gs3.size() > 0); assertTrue(gs1.getTitle().equals("gs1")); assertTrue(gs2.getTitle().equals("gs2")); assertTrue(gs3.getTitle().equals("gs3")); assertFalse(gs1.getValues() == nullSerie); assertTrue(gs2.getValues() == emptySerie); assertTrue(gs3.getValues() == serie); }
public GraphSerie(String title, ArrayList<Datapoint> serie) { if (serie != null) { m_serie = serie; } else { m_serie = new ArrayList<Datapoint>(); } m_title = title; if (m_serie != null) { Log.i(TAG, "Added Serie " + m_title + " with " + m_serie.size() + " entries"); } else { Log.i(TAG, "Added Serie was null"); } }
GraphSerie { public GraphSerie(String title, ArrayList<Datapoint> serie) { if (serie != null) { m_serie = serie; } else { m_serie = new ArrayList<Datapoint>(); } m_title = title; if (m_serie != null) { Log.i(TAG, "Added Serie " + m_title + " with " + m_serie.size() + " entries"); } else { Log.i(TAG, "Added Serie was null"); } } }
GraphSerie { public GraphSerie(String title, ArrayList<Datapoint> serie) { if (serie != null) { m_serie = serie; } else { m_serie = new ArrayList<Datapoint>(); } m_title = title; if (m_serie != null) { Log.i(TAG, "Added Serie " + m_title + " with " + m_serie.size() + " entries"); } else { Log.i(TAG, "Added Serie was null"); } } GraphSerie(String title, ArrayList<Datapoint> serie); }
GraphSerie { public GraphSerie(String title, ArrayList<Datapoint> serie) { if (serie != null) { m_serie = serie; } else { m_serie = new ArrayList<Datapoint>(); } m_title = title; if (m_serie != null) { Log.i(TAG, "Added Serie " + m_title + " with " + m_serie.size() + " entries"); } else { Log.i(TAG, "Added Serie was null"); } } GraphSerie(String title, ArrayList<Datapoint> serie); String getTitle(); int size(); ArrayList<Datapoint> getValues(); }
GraphSerie { public GraphSerie(String title, ArrayList<Datapoint> serie) { if (serie != null) { m_serie = serie; } else { m_serie = new ArrayList<Datapoint>(); } m_title = title; if (m_serie != null) { Log.i(TAG, "Added Serie " + m_title + " with " + m_serie.size() + " entries"); } else { Log.i(TAG, "Added Serie was null"); } } GraphSerie(String title, ArrayList<Datapoint> serie); String getTitle(); int size(); ArrayList<Datapoint> getValues();  }