1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
package org.qedeq.kernel.xml.dao; |
19 |
|
|
20 |
|
import java.io.File; |
21 |
|
import java.io.IOException; |
22 |
|
|
23 |
|
import org.qedeq.base.io.IoUtility; |
24 |
|
import org.qedeq.base.test.QedeqTestCase; |
25 |
|
import org.qedeq.kernel.bo.test.KernelFacade; |
26 |
|
import org.qedeq.kernel.common.SourceFileExceptionList; |
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
@version |
32 |
|
@author |
33 |
|
|
|
|
| 88,5% |
Uncovered Elements: 3 (26) |
Complexity: 6 |
Complexity Density: 0,33 |
|
34 |
|
public final class GenerateXmlTest extends QedeqTestCase { |
35 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0,5 |
|
36 |
1
|
public void setUp() throws Exception {... |
37 |
1
|
super.setUp(); |
38 |
1
|
KernelFacade.startup(); |
39 |
|
} |
40 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0,5 |
|
41 |
1
|
public void tearDown() throws Exception {... |
42 |
1
|
KernelFacade.shutdown(); |
43 |
1
|
super.tearDown(); |
44 |
|
} |
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
@throws |
50 |
|
|
|
|
| 78,6% |
Uncovered Elements: 3 (14) |
Complexity: 3 |
Complexity Density: 0,3 |
1
PASS
|
|
51 |
1
|
public void testGeneration() throws Exception {... |
52 |
1
|
File docDir = new File("../QedeqDoc"); |
53 |
1
|
File genDir = new File("../../../qedeq_gen"); |
54 |
|
|
55 |
|
|
56 |
1
|
if (!docDir.exists()) { |
57 |
1
|
docDir = new File(getIndir(), "doc"); |
58 |
1
|
genDir = new File(getOutdir(), "doc"); |
59 |
1
|
if (!docDir.exists()) { |
60 |
0
|
throw new IOException("unknown source directory for QEDEQ modules"); |
61 |
|
} |
62 |
|
} |
63 |
1
|
generate(docDir, "math/qedeq_sample1.xml", genDir); |
64 |
|
|
65 |
1
|
generate(getIndir(), "qedeq_set_theory_compare.xml", genDir); |
66 |
1
|
generate(getIndir(), "qedeq_basic_concept_compare.xml", genDir); |
67 |
|
} |
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
@param |
73 |
|
@param |
74 |
|
@param |
75 |
|
@throws |
76 |
|
@throws |
77 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0,25 |
|
78 |
3
|
private static void generate(final File dir, final String xml,... |
79 |
|
final File destinationDirectory) throws IOException, SourceFileExceptionList { |
80 |
3
|
final File xmlFile = new File(dir, xml); |
81 |
3
|
final File destination = new File(destinationDirectory, xml + "_").getAbsoluteFile(); |
82 |
3
|
Xml2Xml.generate(xmlFile, destination); |
83 |
3
|
assertEquals(true, IoUtility.compareFilesBinary(xmlFile, destination)); |
84 |
|
} |
85 |
|
|
86 |
|
} |