1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.buildcache.xml;
20
21 import javax.xml.XMLConstants;
22 import javax.xml.parsers.DocumentBuilderFactory;
23 import javax.xml.validation.Schema;
24 import javax.xml.validation.SchemaFactory;
25
26 import org.junit.jupiter.api.Disabled;
27 import org.junit.jupiter.api.Test;
28
29 class XmlServiceTest {
30
31 @Test
32 @Disabled("cache-build-1.0.0.xsd not found")
33 void testConfig() throws Exception {
34 SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
35 Schema schema = sf.newSchema(getClass().getResource("/build-cache-config-1.0.0.xsd"));
36 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
37 dbf.setNamespaceAware(true);
38 dbf.setSchema(schema);
39 }
40
41 @Test
42 @Disabled("cache-build-1.0.0.xsd not found")
43 void testReport() throws Exception {
44 SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
45 Schema schema = sf.newSchema(getClass().getResource("/build-cache-report-1.0.0.xsd"));
46 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
47 dbf.setNamespaceAware(true);
48 dbf.setSchema(schema);
49 }
50
51 @Test
52 @Disabled("cache-build-1.0.0.xsd not found")
53 void testBuild() throws Exception {
54 SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
55 Schema schema = sf.newSchema(getClass().getResource("/build-cache-build-1.0.0.xsd"));
56 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
57 dbf.setNamespaceAware(true);
58 dbf.setSchema(schema);
59 }
60
61 @Test
62 @Disabled("cache-build-1.0.0.xsd not found")
63 void testDiff() throws Exception {
64 SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
65 Schema schema = sf.newSchema(getClass().getResource("/build-cache-diff-1.0.0.xsd"));
66 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
67 dbf.setNamespaceAware(true);
68 dbf.setSchema(schema);
69 }
70 }