1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package com.tunyk.mvn.plugins.htmlcompressor;
17
18 import org.junit.jupiter.api.AfterAll;
19 import org.junit.jupiter.api.BeforeAll;
20 import org.junit.jupiter.api.BeforeEach;
21 import org.junit.jupiter.api.Test;
22 import org.slf4j.Logger;
23 import org.slf4j.LoggerFactory;
24
25
26
27
28 class XmlCompressorTest {
29
30
31 private static final Logger LOG = LoggerFactory.getLogger(XmlCompressorTest.class);
32
33
34
35
36 @BeforeAll
37 static void setUpClass() {
38 LOG.info("Setting up class...");
39 }
40
41
42
43
44 @AfterAll
45 static void tearDownClass() {
46 LOG.info("Test finished.");
47 }
48
49
50
51
52 @BeforeEach
53 void setUp() {
54 LOG.info("Setting up data for testing...");
55 }
56
57
58
59
60
61
62
63 @Test
64 void testCompress() throws Exception {
65 LOG.info("Testing compress method...");
66
67 XmlCompressor xmlCompressor = new XmlCompressor("src/test/resources/xml", "target/test/xmlcompressor/0");
68 xmlCompressor.compress();
69
70
71 xmlCompressor = new XmlCompressor("src/test/resources/xml", "target/test/xmlcompressor/1");
72 com.googlecode.htmlcompressor.compressor.XmlCompressor xmlCompressorHandler = new com.googlecode.htmlcompressor.compressor.XmlCompressor();
73 xmlCompressorHandler.setEnabled(false);
74 xmlCompressor.setXmlCompressor(xmlCompressorHandler);
75 xmlCompressor.compress();
76
77
78 LOG.info("Passed");
79 }
80 }