Package ch.epfl.lbd.io.readers

Examples of ch.epfl.lbd.io.readers.Reader


public class TestFileReader extends Tester{

  @Test
  public void run() throws Exception {
    super.run();
    Reader reader = new FileReader(new File("src/assets/test.txt"));
    String value;
    reader.open();
    value = (String)reader.read()[0];
    while(value != null){
      logger.info(value);
      Assert.assertTrue(value.contains("this is the "));
      value = (String)reader.read()[0];
    }
  }
View Full Code Here


public class TestOV2Reader extends Tester {
 
  @Test
  public void run() throws Exception {
    super.run();
    Reader reader = new OV2Reader(new File("src/assets/test.ov2"));
    String name = "";
    String lat = "";
    String lng = "";
    reader.open();
    String[] record = (String[])reader.read();
    if(record != null){
      name   = record[0];
      lat   = record[1];
      lng   = record[2];
    }
   
    while(name != null && lat != null && lng != null){
      if(record != null)logger.info(name+" "+lat+" "+lng);
      //Assert.assertTrue(value.contains("this is the "));
      record = (String[])reader.read();
      if(record != null){
        name   = record[0];
        lat   = record[1];
        lng   = record[2];
      }
      if(reader.isEndOfFile())break;
    }
  }
View Full Code Here

TOP

Related Classes of ch.epfl.lbd.io.readers.Reader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.