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.apache.maven.plugin.MojoExecutionException;
22 import org.junit.jupiter.api.AfterAll;
23 import org.junit.jupiter.api.BeforeAll;
24 import org.junit.jupiter.api.BeforeEach;
25 import org.junit.jupiter.api.Test;
26 import org.slf4j.Logger;
27 import org.slf4j.LoggerFactory;
28
29
30
31
32 class XmlCompressorMojoTest {
33
34
35 private static final Logger LOG = LoggerFactory.getLogger(XmlCompressorMojoTest.class);
36
37
38
39
40 @BeforeAll
41 static void setUpClass() {
42 LOG.info("Setting up class...");
43 }
44
45
46
47
48 @AfterAll
49 static void tearDownClass() {
50 LOG.info("Mojo test finished.");
51 }
52
53
54
55
56 @BeforeEach
57 void setUp() {
58 LOG.info("Setting up data for testing...");
59 }
60
61
62
63
64
65
66
67 @Test
68 void testExecute() throws MojoExecutionException {
69 LOG.info("Testing mojo execution...");
70
71 XmlCompressorMojo xmlCompressorMojo = new XmlCompressorMojo();
72 xmlCompressorMojo.setSrcFolder("src/test/resources/xml");
73 xmlCompressorMojo.setTargetFolder("target/htmlcompressor/xml");
74 xmlCompressorMojo.execute();
75
76
77
78 LOG.info("Passed");
79 }
80 }