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