Examples of FileReader


Examples of java.io.FileReader

        if (resultsFile != null) {
            resultsOutputStream = new FileOutputStream(resultsFile);
        }
        BufferedReader expectedResultsReader = null;
        if (expectedResultsFile != null && expectedResultsFile.exists() && expectedResultsFile.canRead()) {
            expectedResultsReader = new BufferedReader(new FileReader(expectedResultsFile));
        }
        return writeAndCompareResultSet(rs, maxColWidth, printMetadata, resultsOutputStream, expectedResultsReader, printToConsole ? System.out : null);
    }
View Full Code Here

Examples of net.sf.laja.FileReader

    return null;
  }

  private void importTextFile(String filename) {
    try {
      String result = new FileReader().readFile(filename);
      templateTextWriter.write(result);
    } catch (IOException e) {
      throw new InterpretationException(source, indexInSource, "Could not import file: " + filename + ". Error: " + e.getMessage());
    }
  }
View Full Code Here

Examples of org.apache.avro.file.FileReader

 
  public static void assertOutput(String output, Configuration conf)
      throws NumberFormatException, IOException, InterruptedException {

    DatumReader datumReader = new SpecificDatumReader(AvroTweetsJoin.getAvroOutputSchema());
    FileReader reader = DataFileReader.openReader(new File(output),datumReader);
   
    Record record=null;
    record = (Record)reader.next(record);
   
    Assert.assertEquals("eric",record.get("username").toString());
    Array<Utf8> hashtags = (Array<Utf8>)record.get("hashtags");
    assertEquals(hashtags,"ivan","datasalt","pere");
   
    reader.next(record);
    Assert.assertEquals("eric",record.get("username").toString());
    assertEquals(hashtags,"ivan2","datasalt2","pere2");
    reader.next(record);
    Assert.assertEquals("marianico",record.get("username").toString());
    assertEquals(hashtags,"ivan2","datasalt2","pere2");
   
    Assert.assertFalse(reader.hasNext());
   
  }
View Full Code Here

Examples of org.cfeclipse.frameworks.fusebox.util.FileReader

            version3 = true;
          }
         
        }
       
        FileReader fb4reader = new FileReader(rootpath, project);
        IFile fuseboxFile = fb4reader.getFilePath(this.fbx4circuitroot, this.fbx4altcirciutroot);
       
        if(!version3){
            if((fuseboxFile !=null) && fuseboxFile.exists()){
            /* if we dont find it (lowercase) */
              version4 = true;
View Full Code Here

Examples of org.fnlp.data.reader.FileReader

    SeriesPipes pp = new SeriesPipes(new Pipe[]{ngrampp,targetpp,indexpp});
   
    InstanceSet instset = new InstanceSet(pp,af);
   
    //用不同的Reader读取相应格式的文件
    Reader reader = new FileReader(trainDataPath,"UTF-8",".data");
   
    //读入数据,并进行数据处理
    instset.loadThruStagePipes(reader);
       
    float percent = 0.8f;
View Full Code Here

Examples of org.geotools.data.shapefile.files.FileReader

        }

        ReadableByteChannel in = null;
        try {
            ByteBuffer buffer = ByteBuffer.allocate(100);
            FileReader reader = new FileReader() {
                public String id() {
                    return "Shapefile Datastore's getBounds Method";
                }
            };
View Full Code Here

Examples of org.junithelper.core.file.FileReader

    // confirm input from stdin
    if (confirmToExecute() > 0) {
      return;
    }
    TestCaseGenerator testCaseGenerator = new DefaultTestCaseGenerator(config);
    FileReader fileReader = new CommonsIOFileReader();
    for (File javaFile : javaFiles) {
      File testFile = null;
      String currentTestCaseSourceCode = null;
      try {
        testFile = new File(javaFile.getAbsolutePath().replaceAll("\\\\", "/")
            .replaceFirst(getDirectoryPathOfProductSourceCode(config),
                getDirectoryPathOfTestSourceCode(config))
            .replaceFirst("\\.java", "Test.java"));
        currentTestCaseSourceCode = fileReader.readAsString(testFile);
      } catch (Exception e) {
      }
      testCaseGenerator.initialize(fileReader.readAsString(javaFile));
      String testCodeString = null;
      if (currentTestCaseSourceCode != null) {
        testCodeString = testCaseGenerator.getUnifiedVersionTestCaseSourceCode(
            testCaseGenerator.getTestCaseSourceCodeWithLackingTestMethod(currentTestCaseSourceCode),
            JUnitVersion.version4);
View Full Code Here

Examples of org.mule.module.db.internal.util.FileReader

    public void createsQueryFromFile() throws Exception
    {
        String fileName = "file";
        String fileContent = "select * from test";

        FileReader fileReader = mock(FileReader.class);
        when(fileReader.getResourceAsString(fileName)).thenReturn(fileContent);

        QueryFileFactoryBean factoryBean = new QueryFileFactoryBean(fileName, fileReader);

        String query = factoryBean.getObject();

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.