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

wmixvideo / nfe / #6290

19 Apr 2016 08:37PM UTC coverage: 80.934% (+2.4%) from 78.549%
#6290

push

travis-ci

fincatto
Corrigido testes.

4470 of 5523 relevant lines covered (80.93%)

52.06 hits per line

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

87.5
/src/main/java/com/fincatto/nfe310/validadores/xsd/XMLValidador.java
1
package com.fincatto.nfe310.validadores.xsd;
2

3
import java.io.StringReader;
4
import java.net.URL;
5

6
import javax.xml.transform.stream.StreamSource;
7
import javax.xml.validation.Schema;
8
import javax.xml.validation.SchemaFactory;
9

10
public final class XMLValidador {
×
11

12
    private static boolean validaXml(final String xml, final String xsd) throws Exception {
13
        final URL xsdPath = XMLValidador.class.getResource(String.format("schemas/%s", xsd));
2✔
14
        final SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
2✔
15
        final Schema schema = schemaFactory.newSchema(new StreamSource(xsdPath.toURI().toString()));
2✔
16
        schema.newValidator().validate(new StreamSource(new StringReader(xml)));
2✔
17
        return true;
2✔
18
    }
19

20
    public static boolean validaLote(final String arquivoXML) throws Exception {
21
        return XMLValidador.validaXml(arquivoXML, "enviNFe_v3.10.xsd");
1✔
22
    }
23

24
    public static boolean validaNota(final String arquivoXML) throws Exception {
25
        return XMLValidador.validaXml(arquivoXML, "nfe_v3.10.xsd");
1✔
26
    }
27
}
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

© 2026 Coveralls, Inc