Package br.com.objectos.comuns.io

Examples of br.com.objectos.comuns.io.ParsedFixedLines$Builder


@Test
public class TesteDeHeaderParser {

  public void excecao_de_header() {
    File file = CnabsFalso.HEADER_01.getFile();
    ParsedFixedLines lines = new Parser(FixedFile.parse(file)).get();
    try {
      new HeaderParser(lines).get();
      fail();
    } catch (ExcecaoCnab e) {
      e.printStackTrace();
View Full Code Here


    }
  }

  public void banco_correto() {
    File file = CnabsFalso.RETORNO_237_01.getFile();
    ParsedFixedLines lines = new Parser(FixedFile.parse(file)).get();

    Header res = new HeaderParser(lines).get();
    assertThat(res.getBanco(), equalTo(Banco.BRADESCO));
  }
View Full Code Here

  }

  private FixedLine firstLineOf(String ocorrencia, String motivos) {
    String line = toLine(ocorrencia, motivos);
    FixedFile file = FixedFile.parseString(line);
    ParsedFixedLines _lines = file.getLines();
    List<FixedLine> lines = ImmutableList.copyOf(_lines);
    return lines.get(0);
  }
View Full Code Here

  private List<Entity> entities;

  @BeforeClass
  public void setUp() throws URISyntaxException {
    String line = "true   true    1.23  SP    123    2012-09-09123 abc   ";
    ParsedFixedLines lines = FixedFile.parseString(line)
        .getLines();

    Iterable<Entity> entities = Iterables.transform(lines, new ToEntity());
    this.entities = ImmutableList.copyOf(entities);
  }
View Full Code Here

  @BeforeClass
  public void setUp() throws URISyntaxException {
    URL url = Resources.getResource(getClass(), "/csv/FIXED.TXT");
    File file = new File(url.toURI());
    ParsedFixedLines lines = FixedFile.parse(file)
        .skipFirstLines(1)
        .getLines();

    Iterable<Entity> entities = Iterables.transform(lines, new ToEntity());
    this.entities = ImmutableList.copyOf(entities);
View Full Code Here

@Test
public class TesteDeHeaderParser {

  public void excecao_de_header() {
    File file = CnabsFalso.HEADER_01.getFile();
    ParsedFixedLines lines = new Parser(FixedFile.parse(file)).get();
    try {
      new HeaderParser(lines).get();
      fail();
    } catch (ExcecaoCnab e) {
      e.printStackTrace();
View Full Code Here

    }
  }

  public void banco_correto() {
    File file = CnabsFalso.RETORNO_237_01.getFile();
    ParsedFixedLines lines = new Parser(FixedFile.parse(file)).get();

    Header res = new HeaderParser(lines).get();
    assertThat(res.getBanco(), equalTo(Banco.BRADESCO));
  }
View Full Code Here

  }

  private FixedLine firstLineOf(String ocorrencia, String motivos) {
    String line = toLine(ocorrencia, motivos);
    FixedFile file = FixedFile.parseString(line);
    ParsedFixedLines _lines = file.getLines();
    List<FixedLine> lines = ImmutableList.copyOf(_lines);
    return lines.get(0);
  }
View Full Code Here

  public RemessaSpec getTrailerRemessaSpec() {
    throw new UnsupportedOperationException("IMPLEMENT ME!");
  }

  private static ArquivoRetorno retornoDe(FixedFile file) {
    ParsedFixedLines lines = new Parser(file).get();

    Header header = new HeaderParser(lines).get();
    Banco banco = header.getBanco();

    Iterable<Registro> registros;
View Full Code Here

  public RemessaSpec getTrailerRemessaSpec() {
    throw new UnsupportedOperationException("IMPLEMENT ME!");
  }

  private static Retorno retornoDe(FixedFile file) {
    ParsedFixedLines lines = new Parser(file).get();

    Header header = new HeaderParser(lines).get();
    Banco banco = header.getBanco();

    Iterable<Registro> registros;
View Full Code Here

TOP

Related Classes of br.com.objectos.comuns.io.ParsedFixedLines$Builder

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.