Skip to content

Commit 12e57f9

Browse files
committed
Updated dependencies. Restructured test artifacts
1 parent 240b233 commit 12e57f9

32 files changed

Lines changed: 49 additions & 71 deletions

File tree

‎pom.xml‎

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,11 @@
6464
<artifactId>jaxb-core</artifactId>
6565
<version>3.0.1</version>
6666
</dependency>
67-
6867
<dependency>
6968
<groupId>javax.xml.bind</groupId>
7069
<artifactId>jaxb-api</artifactId>
7170
<version>${jaxb.version}</version>
7271
</dependency>
73-
7472
<dependency>
7573
<groupId>com.sun.xml.bind</groupId>
7674
<artifactId>jaxb-impl</artifactId>
@@ -94,19 +92,16 @@
9492
<artifactId>maven-core</artifactId>
9593
<version>${maven.version}</version>
9694
</dependency>
97-
9895
<dependency>
9996
<groupId>org.apache.maven</groupId>
10097
<artifactId>maven-model</artifactId>
10198
<version>${maven.version}</version>
10299
</dependency>
103-
104100
<dependency>
105101
<groupId>org.apache.maven</groupId>
106102
<artifactId>maven-plugin-api</artifactId>
107103
<version>${maven.version}</version>
108104
</dependency>
109-
110105
<dependency>
111106
<groupId>org.apache.maven.plugin-tools</groupId>
112107
<artifactId>maven-plugin-annotations</artifactId>
@@ -127,54 +122,44 @@
127122
<version>${maven.version}</version>
128123
<scope>test</scope>
129124
</dependency>
130-
131-
<dependency>
132-
<groupId>org.powermock</groupId>
133-
<artifactId>powermock-module-junit4</artifactId>
134-
<version>${powermock.version}</version>
135-
<scope>test</scope>
136-
</dependency>
137-
138-
<dependency>
139-
<groupId>org.powermock</groupId>
140-
<artifactId>powermock-api-mockito2</artifactId>
141-
<version>${powermock.version}</version>
142-
<scope>test</scope>
143-
</dependency>
144-
145125
<dependency>
146126
<groupId>org.apache.maven.plugin-testing</groupId>
147127
<artifactId>maven-plugin-testing-harness</artifactId>
148128
<version>3.3.0</version>
149129
<scope>test</scope>
150130
</dependency>
151-
152131
<dependency>
153-
<groupId>org.assertj</groupId>
154-
<artifactId>assertj-core</artifactId>
155-
<version>3.21.0</version>
132+
<groupId>org.apache.maven.shared</groupId>
133+
<artifactId>maven-verifier</artifactId>
134+
<version>1.7.2</version>
156135
<scope>test</scope>
157136
</dependency>
158137

159138
<dependency>
160-
<groupId>junit</groupId>
161-
<artifactId>junit</artifactId>
162-
<version>4.13.2</version>
139+
<groupId>org.powermock</groupId>
140+
<artifactId>powermock-module-junit4</artifactId>
141+
<version>${powermock.version}</version>
163142
<scope>test</scope>
164143
</dependency>
165-
166144
<dependency>
167-
<groupId>org.apache.maven.shared</groupId>
168-
<artifactId>maven-verifier</artifactId>
169-
<version>1.6</version>
145+
<groupId>org.powermock</groupId>
146+
<artifactId>powermock-api-mockito2</artifactId>
147+
<version>${powermock.version}</version>
170148
<scope>test</scope>
171149
</dependency>
150+
172151
<dependency>
173152
<groupId>commons-io</groupId>
174153
<artifactId>commons-io</artifactId>
175154
<version>2.6</version>
176155
<scope>test</scope>
177156
</dependency>
157+
<dependency>
158+
<groupId>org.slf4j</groupId>
159+
<artifactId>slf4j-simple</artifactId>
160+
<version>1.7.32</version>
161+
<scope>test</scope>
162+
</dependency>
178163
</dependencies>
179164

180165
<build>

src/test/java/org/utplsql/maven/plugin/test/UtPLSQLMojoIT.java renamed to src/test/java/org/utplsql/maven/plugin/UtPLSQLMojoIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.utplsql.maven.plugin.test;
1+
package org.utplsql.maven.plugin;
22

33
import org.apache.commons.io.FileUtils;
44
import org.apache.maven.it.VerificationException;

src/test/java/org/utplsql/maven/plugin/test/UtPLSQLMojoTest.java renamed to src/test/java/org/utplsql/maven/plugin/UtPLSQLMojoTest.java

Lines changed: 32 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.utplsql.maven.plugin.test;
1+
package org.utplsql.maven.plugin;
22

33
import org.apache.commons.lang3.tuple.Pair;
44
import org.apache.maven.plugin.MojoExecutionException;
@@ -47,9 +47,6 @@ public class UtPLSQLMojoTest {
4747
@Rule
4848
public MojoRule rule = new MojoRule();
4949

50-
@Rule
51-
public ExpectedException thrown = ExpectedException.none();
52-
5350
@Mock
5451
public Connection mockConnection;
5552

@@ -71,54 +68,50 @@ public void setUp() throws Exception {
7168
/**
7269
* testInvalidSourcesDirectory.
7370
* <p>
74-
* Given : a pom.xml with invalid sources' directory When : pom is read and
75-
* buildSourcesOptions is run Then : it should throw a MojoExecutionException
71+
* Given : a pom.xml with invalid sources' directory
72+
* When : pom is read andbuildSourcesOptions is run
73+
* Then : it should throw a MojoExecutionException
7674
*/
7775
@Test
7876
public void testInvalidSourcesDirectory() throws Exception {
7977
UtPLSQLMojo utplsqlMojo = (UtPLSQLMojo) rule
80-
.lookupConfiguredMojo(new File("src/test/resources/invalidTestsSourcesDirectories/"), "test");
78+
.lookupConfiguredMojo(new File("src/test/resources/unit-tests/invalidTestsSourcesDirectories/"), "test");
8179
Assert.assertNotNull(utplsqlMojo);
8280

83-
// Expected exception
84-
thrown.expect(MojoExecutionException.class);
85-
// Excepted message
86-
thrown.expectMessage("Invalid <SOURCES> in your pom.xml");
81+
MojoExecutionException exception = Assert.assertThrows(MojoExecutionException.class, () -> Whitebox.invokeMethod(utplsqlMojo, "buildSourcesOptions"));
8782

88-
Whitebox.invokeMethod(utplsqlMojo, "buildSourcesOptions");
83+
Assert.assertEquals("Invalid <SOURCES> in your pom.xml", exception.getMessage());
8984
}
9085

9186
/**
9287
* testInvalidTestsDirectory.
9388
* <p>
94-
* Given : a pom.xml with invalid tests' directory When : pom is read and
95-
* buildTestsOptions is run Then : it should throw a MojoExecutionException
89+
* Given : a pom.xml with invalid tests' directory
90+
* When : pom is read and buildTestsOptions is run
91+
* Then : it should throw a MojoExecutionException
9692
*/
9793
@Test
9894
public void testInvalidTestsDirectory() throws Exception {
9995
UtPLSQLMojo utplsqlMojo = (UtPLSQLMojo) rule
100-
.lookupConfiguredMojo(new File("src/test/resources/invalidTestsSourcesDirectories/"), "test");
96+
.lookupConfiguredMojo(new File("src/test/resources/unit-tests/invalidTestsSourcesDirectories/"), "test");
10197
Assert.assertNotNull(utplsqlMojo);
10298

103-
// Expected exception
104-
thrown.expect(MojoExecutionException.class);
105-
// Excepted message
106-
thrown.expectMessage("Invalid <TESTS> in your pom.xml");
99+
MojoExecutionException exception = Assert.assertThrows(MojoExecutionException.class, () -> Whitebox.invokeMethod(utplsqlMojo, "buildTestsOptions"));
107100

108-
Whitebox.invokeMethod(utplsqlMojo, "buildTestsOptions");
101+
Assert.assertEquals("Invalid <TESTS> in your pom.xml: Invalid <directory> bar in resource. Check your pom.xml", exception.getMessage());
109102
}
110103

111104
/**
112105
* testSourcesTestsParameters.
113106
* <p>
114-
* Given : a pom.xml with sources and tests with a lot of parameters When : pom
115-
* is read and buildSourcesOptions / buildTestsOptions are run Then : it should
116-
* fill all parameters correctly
107+
* Given : a pom.xml with sources and tests with a lot of parameters
108+
* When : pom is read and buildSourcesOptions / buildTestsOptions are run
109+
* Then : it should fill all parameters correctly
117110
*/
118111
@Test
119112
public void testSourcesTestsParameters() throws Exception {
120113
UtPLSQLMojo utplsqlMojo = (UtPLSQLMojo) rule
121-
.lookupConfiguredMojo(new File("src/test/resources/testSourcesTestsParams/"), "test");
114+
.lookupConfiguredMojo(new File("src/test/resources/unit-tests/testSourcesTestsParams/"), "test");
122115
Assert.assertNotNull(utplsqlMojo);
123116

124117
// TODO : move to another test about reporters
@@ -156,14 +149,14 @@ public void testSourcesTestsParameters() throws Exception {
156149
/**
157150
* testSourcesAndTestsParameterDoesNotExist.
158151
* <p>
159-
* Given : a pom.xml with no sources / tests tags and default directory does not
160-
* exist. When : pom is read and buildSourcesOptions / buildTestsOptions are run
152+
* Given : a pom.xml with no sources / tests tags and default directory does not exist.
153+
* When : pom is read and buildSourcesOptions / buildTestsOptions are run
161154
* Then : it should not find any source files
162155
*/
163156
@Test
164157
public void testSourcesAndTestsParameterDoesNotExist() throws Exception {
165158
UtPLSQLMojo utplsqlMojo = (UtPLSQLMojo) rule.lookupConfiguredMojo(
166-
new File("src/test/resources/testNoSourcesTestsParams/directoryDoesNotExist/"), "test");
159+
new File("src/test/resources/unit-tests/testNoSourcesTestsParams/directoryDoesNotExist/"), "test");
167160
Assert.assertNotNull(utplsqlMojo);
168161

169162
// check sources
@@ -179,13 +172,13 @@ public void testSourcesAndTestsParameterDoesNotExist() throws Exception {
179172
* testSourcesAndTestsParameterDoesNotExistButDefaultDirectoryExists.
180173
* <p>
181174
* Given : a pom.xml with no sources / tests tags but default directory exists.
182-
* When : pom is read and buildSourcesOptions / buildTestsOptions are run Then :
183-
* it should find all sources/tests files in default directories
175+
* When : pom is read and buildSourcesOptions / buildTestsOptions are run
176+
* Then : it should find all sources/tests files in default directories
184177
*/
185178
@Test
186179
public void testSourcesAndTestsParameterDoesNotExistButDefaultDirectoryExists() throws Exception {
187180
UtPLSQLMojo utplsqlMojo = (UtPLSQLMojo) rule
188-
.lookupConfiguredMojo(new File("src/test/resources/testNoSourcesTestsParams/directoryExists/"), "test");
181+
.lookupConfiguredMojo(new File("src/test/resources/unit-tests/testNoSourcesTestsParams/directoryExists/"), "test");
189182
Assert.assertNotNull(utplsqlMojo);
190183

191184
// check sources
@@ -205,13 +198,13 @@ public void testSourcesAndTestsParameterDoesNotExistButDefaultDirectoryExists()
205198
* testSourcesAndTestsParameterHaveNotDirectoryTag.
206199
* <p>
207200
* Given : a pom.xml with source and test tag not containing a directory tag.
208-
* When : pom is read and buildSourcesOptions / buildTestsOptions are run Then :
209-
* it should find all sources/tests files in default directories
201+
* When : pom is read and buildSourcesOptions / buildTestsOptions are run
202+
* Then : it should find all sources/tests files in default directories
210203
*/
211204
@Test
212205
public void testSourcesAndTestsParameterHaveNotDirectoryTag() throws Exception {
213206
UtPLSQLMojo utplsqlMojo = (UtPLSQLMojo) rule
214-
.lookupConfiguredMojo(new File("src/test/resources/partialSourceAndTestTag/missingDirectory/"), "test");
207+
.lookupConfiguredMojo(new File("src/test/resources/unit-tests/partialSourceAndTestTag/missingDirectory/"), "test");
215208
Assert.assertNotNull(utplsqlMojo);
216209

217210
// check sources
@@ -232,13 +225,13 @@ public void testSourcesAndTestsParameterHaveNotDirectoryTag() throws Exception {
232225
* testSourcesAndTestsParameterHaveNotDirectoryTag.
233226
* <p>
234227
* Given : a pom.xml with source and test tag not containing a directory tag.
235-
* When : pom is read and buildSourcesOptions / buildTestsOptions are run Then :
236-
* it should find all sources/tests files in default directories
228+
* When : pom is read and buildSourcesOptions / buildTestsOptions are run
229+
* Then : it should find all sources/tests files in default directories
237230
*/
238231
@Test
239232
public void testSourcesAndTestsParameterHaveNotIncludesTag() throws Exception {
240233
UtPLSQLMojo utplsqlMojo = (UtPLSQLMojo) rule
241-
.lookupConfiguredMojo(new File("src/test/resources/partialSourceAndTestTag/missingIncludes/"), "test");
234+
.lookupConfiguredMojo(new File("src/test/resources/unit-tests/partialSourceAndTestTag/missingIncludes/"), "test");
242235
Assert.assertNotNull(utplsqlMojo);
243236

244237
// check sources
@@ -257,7 +250,7 @@ public void testSourcesAndTestsParameterHaveNotIncludesTag() throws Exception {
257250
@Test
258251
public void testDefaultConsoleBehaviour() throws Exception {
259252
UtPLSQLMojo utplsqlMojo = (UtPLSQLMojo) rule
260-
.lookupConfiguredMojo(new File("src/test/resources/defaultConsoleOutputBehaviour/"), "test");
253+
.lookupConfiguredMojo(new File("src/test/resources/unit-tests/defaultConsoleOutputBehaviour/"), "test");
261254
Assert.assertNotNull(utplsqlMojo);
262255

263256
List<Reporter> reporterList = new ArrayList<>();
@@ -302,7 +295,7 @@ public void testDefaultConsoleBehaviour() throws Exception {
302295
@Test
303296
public void testAddDefaultReporter() throws Exception {
304297
UtPLSQLMojo utplsqlMojo = (UtPLSQLMojo) rule
305-
.lookupConfiguredMojo(new File("src/test/resources/defaultConsoleOutputBehaviour/"), "test");
298+
.lookupConfiguredMojo(new File("src/test/resources/unit-tests/defaultConsoleOutputBehaviour/"), "test");
306299
Assert.assertNotNull(utplsqlMojo);
307300

308301
List<Reporter> reporterList = new ArrayList<>();
@@ -326,7 +319,7 @@ public void testAddDefaultReporter() throws Exception {
326319
@Test
327320
public void testSkipUtplsqlTests() throws Exception {
328321
UtPLSQLMojo utplsqlMojo = (UtPLSQLMojo) rule
329-
.lookupConfiguredMojo(new File("src/test/resources/skipUtplsqlTests/"), "test");
322+
.lookupConfiguredMojo(new File("src/test/resources/unit-tests/skipUtplsqlTests/"), "test");
330323
Assert.assertNotNull(utplsqlMojo);
331324

332325
final ByteArrayOutputStream console = new ByteArrayOutputStream();

src/test/resources/defaultConsoleOutputBehaviour/pom.xml renamed to src/test/resources/unit-tests/defaultConsoleOutputBehaviour/pom.xml

File renamed without changes.

src/test/resources/invalidTestsSourcesDirectories/pom.xml renamed to src/test/resources/unit-tests/invalidTestsSourcesDirectories/pom.xml

File renamed without changes.

src/test/resources/partialSourceAndTestTag/missingDirectory/pom.xml renamed to src/test/resources/unit-tests/partialSourceAndTestTag/missingDirectory/pom.xml

File renamed without changes.

src/test/resources/partialSourceAndTestTag/missingDirectory/src/main/plsql/f1.sql renamed to src/test/resources/unit-tests/partialSourceAndTestTag/missingDirectory/src/main/plsql/f1.sql

File renamed without changes.

src/test/resources/partialSourceAndTestTag/missingDirectory/src/main/plsql/foo/f2.sql renamed to src/test/resources/unit-tests/partialSourceAndTestTag/missingDirectory/src/main/plsql/foo/f2.sql

File renamed without changes.

src/test/resources/partialSourceAndTestTag/missingDirectory/src/test/plsql/f2.pkg renamed to src/test/resources/unit-tests/partialSourceAndTestTag/missingDirectory/src/test/plsql/f2.pkg

File renamed without changes.

src/test/resources/partialSourceAndTestTag/missingDirectory/src/test/plsql/foo/f1.pkg renamed to src/test/resources/unit-tests/partialSourceAndTestTag/missingDirectory/src/test/plsql/foo/f1.pkg

File renamed without changes.

0 commit comments

Comments
 (0)