@@ -247,6 +247,67 @@ void default_reporter(@InjectMojo(goal = "test", pom = "pom.xml") UtPlsqlMojo ut
247247 @ Test
248248 @ Basedir (UNIT_TESTS + "skip_utplsql_tests" )
249249 void skip_utplsql_tests (@ InjectMojo (goal = "test" , pom = "pom.xml" ) UtPlsqlMojo utPlsqlMojo ) throws Exception {
250+ assertTrue (executeAndGetInfoMessages (utPlsqlMojo ).contains ("utPLSQLTests are skipped." ));
251+ }
252+
253+ /**
254+ * Skip Tests
255+ * <p>
256+ * Given : a pom.xml without skipUtplsqlTests and -DskipTests
257+ * When : pom is read
258+ * Then : Tests are skipped
259+ */
260+ @ Test
261+ @ Basedir (UNIT_TESTS + "skip_tests" )
262+ @ MojoParameter (name = "skipTests" , value = "true" )
263+ void skip_tests (@ InjectMojo (goal = "test" , pom = "pom.xml" ) UtPlsqlMojo utPlsqlMojo ) throws Exception {
264+ assertTrue (executeAndGetInfoMessages (utPlsqlMojo ).contains ("utPLSQLTests are skipped." ));
265+ }
266+
267+ /**
268+ * Maven Test Skip
269+ * <p>
270+ * Given : a pom.xml without skipUtplsqlTests and -Dmaven.test.skip
271+ * When : pom is read
272+ * Then : Tests are skipped
273+ */
274+ @ Test
275+ @ Basedir (UNIT_TESTS + "skip_tests" )
276+ @ MojoParameter (name = "mavenTestSkip" , value = "true" )
277+ void maven_test_skip (@ InjectMojo (goal = "test" , pom = "pom.xml" ) UtPlsqlMojo utPlsqlMojo ) throws Exception {
278+ assertTrue (executeAndGetInfoMessages (utPlsqlMojo ).contains ("utPLSQLTests are skipped." ));
279+ }
280+
281+ /**
282+ * Skip Tests overridden by skipUtplsqlTests
283+ * <p>
284+ * Given : -DskipTests and -DskipUtplsqlTests=false
285+ * When : pom is read
286+ * Then : utPLSQL tests are not skipped
287+ */
288+ @ Test
289+ @ Basedir (UNIT_TESTS + "skip_tests" )
290+ @ MojoParameter (name = "skipTests" , value = "true" )
291+ @ MojoParameter (name = "mavenTestSkip" , value = "true" )
292+ @ MojoParameter (name = "skipUtplsqlTests" , value = "false" )
293+ void skip_tests_overridden_by_skip_utplsql_tests (@ InjectMojo (goal = "test" , pom = "pom.xml" ) UtPlsqlMojo utPlsqlMojo ) {
294+ assertFalse (utPlsqlMojo .isSkipped ());
295+ }
296+
297+ /**
298+ * Tests are not skipped by default
299+ * <p>
300+ * Given : a pom.xml without skipUtplsqlTests, skipTests and maven.test.skip
301+ * When : pom is read
302+ * Then : utPLSQL tests are not skipped
303+ */
304+ @ Test
305+ @ Basedir (UNIT_TESTS + "skip_tests" )
306+ void not_skipped_by_default (@ InjectMojo (goal = "test" , pom = "pom.xml" ) UtPlsqlMojo utPlsqlMojo ) {
307+ assertFalse (utPlsqlMojo .isSkipped ());
308+ }
309+
310+ private static List <String > executeAndGetInfoMessages (UtPlsqlMojo utPlsqlMojo ) throws Exception {
250311 List <String > infoMessages = new ArrayList <>();
251312 utPlsqlMojo .setLog (new SystemStreamLog () {
252313 @ Override
@@ -257,7 +318,7 @@ public void info(CharSequence content) {
257318
258319 utPlsqlMojo .execute ();
259320
260- assertTrue ( infoMessages . contains ( "utPLSQLTests are skipped." )) ;
321+ return infoMessages ;
261322 }
262323
263324 /**
0 commit comments