• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wmixvideo / nfe / #6656

20 Jun 2016 11:31AM UTC coverage: 79.109% (+2.5%) from 76.628%
#6656

push

travis-ci

fincatto
Gerador de chave gerando codigo randomico, quando nao informado.

3 of 3 new or added lines in 1 file covered. (100.0%)

352 existing lines in 69 files now uncovered.

4741 of 5993 relevant lines covered (79.11%)

50.57 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

71.43
/src/main/java/com/fincatto/nfe310/parsers/NotaParser.java
1
package com.fincatto.nfe310.parsers;
2

3
import java.io.File;
4

5
import org.simpleframework.xml.core.Persister;
6

7
import com.fincatto.nfe310.classes.lote.envio.NFLoteEnvio;
8
import com.fincatto.nfe310.classes.nota.NFNota;
9
import com.fincatto.nfe310.classes.nota.NFNotaProcessada;
10
import com.fincatto.nfe310.persister.NFPersister;
11

12
public class NotaParser {
13
    private final Persister persister;
14

15
    public NotaParser() {
8✔
16
        this.persister = new NFPersister();
8✔
17
    }
8✔
18

19
    public NFNota notaParaObjeto(final File xml) {
20
        try {
21
            return this.persister.read(NFNota.class, xml);
2✔
22
        } catch (final Exception e) {
1✔
23
            throw new IllegalArgumentException(String.format("Nao foi possivel parsear o xml: %s", e.getMessage()));
1✔
24
        }
25
    }
26

27
    public NFNota notaParaObjeto(final String xml) {
28
        try {
29
            return this.persister.read(NFNota.class, xml);
2✔
30
        } catch (final Exception e) {
1✔
31
            throw new IllegalArgumentException(String.format("Nao foi possivel parsear o xml: %s", e.getMessage()));
1✔
32
        }
33
    }
34

35
    public NFLoteEnvio loteParaObjeto(final File xml) {
36
        try {
37
            return this.persister.read(NFLoteEnvio.class, xml);
×
38
        } catch (final Exception e) {
×
UNCOV
39
            throw new IllegalArgumentException(String.format("Nao foi possivel parsear o xml: %s", e.getMessage()));
×
40
        }
41
    }
42

43
    public NFLoteEnvio loteParaObjeto(final String xml) {
44
        try {
45
            return this.persister.read(NFLoteEnvio.class, xml);
×
46
        } catch (final Exception e) {
×
UNCOV
47
            throw new IllegalArgumentException(String.format("Nao foi possivel parsear o xml: %s", e.getMessage()));
×
48
        }
49
    }
50

51
    public NFNotaProcessada notaProcessadaParaObjeto(final String xml) {
52
        try {
53
            return this.persister.read(NFNotaProcessada.class, xml);
2✔
54
        } catch (final Exception e) {
1✔
55
            throw new IllegalArgumentException(String.format("Nao foi possivel parsear o xml: %s", e.getMessage()));
1✔
56
        }
57
    }
58

59
    public NFNotaProcessada notaProcessadaParaObjeto(final File xml) {
60
        try {
61
            return this.persister.read(NFNotaProcessada.class, xml);
2✔
62
        } catch (final Exception e) {
1✔
63
            throw new IllegalArgumentException(String.format("Nao foi possivel parsear o xml: %s", e.getMessage()));
1✔
64
        }
65
    }
66
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc