|
From: Márcio V. d. S. <mv...@us...> - 2007-08-23 12:51:36
|
Update of /cvsroot/tail/Tail/src/test/net/sf/tail/report In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv13475/src/test/net/sf/tail/report Modified Files: ReportTest.java ReportGeneratorTest.java Log Message: Index: ReportTest.java =================================================================== RCS file: /cvsroot/tail/Tail/src/test/net/sf/tail/report/ReportTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ReportTest.java 21 Aug 2007 20:58:34 -0000 1.1 --- ReportTest.java 23 Aug 2007 12:51:08 -0000 1.2 *************** *** 25,29 **** --- 25,31 ---- private List<Decision> decisions; + private SlicerByTimePeriod slicer; + private List<Trade> trades; *************** *** 39,58 **** new TotalProfitCriterion(), trades, new HistoryRunner(OperationType.BUY)); decisions.add(decision); ! slicer = new SlicerByTimePeriod(series,new Period().withYears(1), SlicerType.MEMORIZED); } ! ! @Test public void testGetAllTrades() throws IOException { ! Report report = new Report(new TotalProfitCriterion(),slicer , decisions); assertEquals(trades, report.getAllTrades()); ! } ! ! @Test public void testGetCriterionValue() throws IOException { ! Report report = new Report(new TotalProfitCriterion(),slicer , decisions); assertEquals(4.5, report.getCriterionValue()); } --- 41,58 ---- new TotalProfitCriterion(), trades, new HistoryRunner(OperationType.BUY)); decisions.add(decision); ! slicer = new SlicerByTimePeriod(series, new Period().withYears(1), SlicerType.MEMORIZED); } ! @Test public void testGetAllTrades() throws IOException { ! Report report = new Report(new TotalProfitCriterion(), slicer, decisions); assertEquals(trades, report.getAllTrades()); ! } ! @Test public void testGetCriterionValue() throws IOException { ! Report report = new Report(new TotalProfitCriterion(), slicer, decisions); assertEquals(4.5, report.getCriterionValue()); } Index: ReportGeneratorTest.java =================================================================== RCS file: /cvsroot/tail/Tail/src/test/net/sf/tail/report/ReportGeneratorTest.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ReportGeneratorTest.java 20 Aug 2007 18:15:29 -0000 1.17 --- ReportGeneratorTest.java 23 Aug 2007 12:51:08 -0000 1.18 *************** *** 25,28 **** --- 25,29 ---- private List<Decision> decisions; + private SlicerByTimePeriod slicer; *************** *** 38,54 **** new TotalProfitCriterion(), trades, new HistoryRunner(OperationType.BUY)); decisions.add(decision); ! slicer = new SlicerByTimePeriod(series,new Period().withYears(1), SlicerType.MEMORIZED); } ! ! @Test public void testSMAGenerate() throws IOException { ! Report report = new Report(new TotalProfitCriterion(),slicer , decisions); StringBuffer html = new ReportGenerator().generate(report); System.out.println(html); ! assertTrue(html.toString().contains("TotalProfitCriterion")); assertTrue(html.toString().contains("4,5")); ! } } --- 39,54 ---- new TotalProfitCriterion(), trades, new HistoryRunner(OperationType.BUY)); decisions.add(decision); ! slicer = new SlicerByTimePeriod(series, new Period().withYears(1), SlicerType.MEMORIZED); } ! @Test public void testSMAGenerate() throws IOException { ! Report report = new Report(new TotalProfitCriterion(), slicer, decisions); StringBuffer html = new ReportGenerator().generate(report); System.out.println(html); ! assertTrue(html.toString().contains("TotalProfitCriterion")); assertTrue(html.toString().contains("4,5")); ! } } |