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