@ -9,26 +9,26 @@ import org.junit.Test;
public class RecordsTest {
final String tesDir = "test/DATA/INDEX/QUEUE" ;
/ * *
* Test of cleanLast method , of class Records .
* /
@Test
public void testCleanLast_byteArr_int ( ) throws Exception {
File tablefile = new File ( tesDir , "test.stack" ) ;
File tablefile = new File ( System . getProperty ( "java.io.tmpdir" ) , "test1.stack" ) ;
byte [ ] b = ASCII . getBytes ( "testDataString" ) ;
Records rec = new Records ( tablefile , b . length ) ;
rec . add ( b , 0 ) ; // add some data
for ( int i = 0 ; i < 5 ; i + + ) { // multiple cleanlast
rec . cleanLast ( b , 0 ) ;
try {
rec . add ( b , 0 ) ; // add some data
for ( int i = 0 ; i < 5 ; i + + ) { // multiple cleanlast
rec . cleanLast ( b , 0 ) ;
}
assertEquals ( 0 , rec . size ( ) ) ;
} finally {
rec . close ( ) ;
}
assertEquals ( 0 , rec . size ( ) ) ;
rec . close ( ) ;
}
/ * *
@ -37,16 +37,19 @@ public class RecordsTest {
@Test
public void testCleanLast ( ) throws Exception {
File tablefile = new File ( tesDir, "test .stack") ;
File tablefile = new File ( System. getProperty ( "java.io.tmpdir" ) , "test2 .stack") ;
byte [ ] b = ASCII . getBytes ( "testdata" ) ;
Records rec = new Records ( tablefile , b . length ) ;
rec . add ( b , 0 ) ; // add data
for ( int i = 0 ; i < 5 ; i + + ) { // multiple cleanLast
rec . cleanLast ( ) ;
try {
rec . add ( b , 0 ) ; // add data
for ( int i = 0 ; i < 5 ; i + + ) { // multiple cleanLast
rec . cleanLast ( ) ;
}
assertEquals ( 0 , rec . size ( ) ) ;
} finally {
rec . close ( ) ;
}
assertEquals ( 0 , rec . size ( ) ) ;
rec . close ( ) ;
}
}