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