Update of /cvsroot/tail/Tail/src/test/net/sf/tail/reader
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv2571/src/test/net/sf/tail/reader
Modified Files:
CedroTimeSeriesLoaderTest.java
Log Message:
extraindo novos Indicadores
Index: CedroTimeSeriesLoaderTest.java
===================================================================
RCS file: /cvsroot/tail/Tail/src/test/net/sf/tail/reader/CedroTimeSeriesLoaderTest.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** CedroTimeSeriesLoaderTest.java 17 May 2007 20:16:11 -0000 1.8
--- CedroTimeSeriesLoaderTest.java 17 May 2007 23:04:57 -0000 1.9
***************
*** 18,34 ****
public class CedroTimeSeriesLoaderTest {
private CedroTimeSeriesLoader ctsl;
private TimeSeries ts;
!
@Before
! public void setUp() throws Exception {
! ctsl = new CedroTimeSeriesLoader();
ts = ctsl.load(new FileInputStream("BaseBovespa/tests/Cedro-ReaderTest.csv"));
}
!
! private Timestamp getTimeStamp(int year,int month,int day){
Date date = null;
SimpleDateFormat simpleDate = new SimpleDateFormat("dd/M/yyyy");
try {
! date = simpleDate.parse(day+"/"+month+"/"+year);
} catch (ParseException e) {
e.printStackTrace();
--- 18,35 ----
public class CedroTimeSeriesLoaderTest {
private CedroTimeSeriesLoader ctsl;
+
private TimeSeries ts;
!
@Before
! public void setUp() throws Exception {
! ctsl = new CedroTimeSeriesLoader();
ts = ctsl.load(new FileInputStream("BaseBovespa/tests/Cedro-ReaderTest.csv"));
}
!
! private Timestamp getTimeStamp(int year, int month, int day) {
Date date = null;
SimpleDateFormat simpleDate = new SimpleDateFormat("dd/M/yyyy");
try {
! date = simpleDate.parse(day + "/" + month + "/" + year);
} catch (ParseException e) {
e.printStackTrace();
***************
*** 36,68 ****
return new Timestamp(date.getTime());
}
!
@Test
public void testLine3() throws Exception {
! Timestamp timestamp = getTimeStamp(2007,5,2);
! Tick tick = new Tick(timestamp,71.70,72.06,72.75,71.70,0.99,72.81,108200.00,7854215.00,152);
assertEquals(tick, ts.getTick(2));
}
@Test
public void testeLine2() throws Exception {
Timestamp timestamp = getTimeStamp(2007, 4, 30);
! Tick tick = new Tick(timestamp,73.09,72.81,73.10,72.20,1.00,73.09,83200.00,6045660.00,103);
! assertEquals(tick, ts.getTick(1));
}
!
@Test
public void testLine1() throws Exception {
Timestamp timestamp = getTimeStamp(2007, 4, 27);
! Tick tick = new Tick(timestamp,71.00,73.09,73.29,68.76,1.02,71.40,59100.00,4180018.00,141);
assertEquals(tick, ts.getTick(0));
!
}
! //Método adicionado por causa da compatibilidade do Eclipse 3.1.2(Rede Linux)
! //e o JUnit4
public static junit.framework.Test suite() {
! return new JUnit4TestAdapter(CedroTimeSeriesLoaderTest.class);
}
}
--- 37,71 ----
return new Timestamp(date.getTime());
}
!
@Test
public void testLine3() throws Exception {
! Timestamp timestamp = getTimeStamp(2007, 5, 2);
! Tick tick = new Tick(timestamp, 71.70, 72.06, 72.75, 71.70, 0.99, 72.81, 108200.00, 7854215.00, 152);
assertEquals(tick, ts.getTick(2));
}
+
@Test
public void testeLine2() throws Exception {
Timestamp timestamp = getTimeStamp(2007, 4, 30);
! Tick tick = new Tick(timestamp, 73.09, 72.81, 73.10, 72.20, 1.00, 73.09, 83200.00, 6045660.00, 103);
! assertEquals(tick, ts.getTick(1));
}
!
@Test
public void testLine1() throws Exception {
Timestamp timestamp = getTimeStamp(2007, 4, 27);
! Tick tick = new Tick(timestamp, 71.00, 73.09, 73.29, 68.76, 1.02, 71.40, 59100.00, 4180018.00, 141);
assertEquals(tick, ts.getTick(0));
!
}
! // Método adicionado por causa da compatibilidade do Eclipse 3.1.2(Rede
! // Linux)
! // e o JUnit4
public static junit.framework.Test suite() {
! return new JUnit4TestAdapter(CedroTimeSeriesLoaderTest.class);
}
}
|