@@ -268,9 +268,9 @@ public void skip_utplsql_tests() throws Exception {
268
268
}
269
269
270
270
/**
271
- * Enable DBMS_OUTPUT
271
+ * Set ORA Stuck Timeout
272
272
* <p>
273
- * Given : a pom.xml with dbmsOutput=true
273
+ * Given : a pom.xml with oraStuckTimeout=0
274
274
* When : pom is read
275
275
* Then : Property is set
276
276
*/
@@ -280,8 +280,9 @@ public void ora_stuck_timeout() throws Exception {
280
280
assertNotNull (utPlsqlMojo );
281
281
282
282
utPlsqlMojo .execute ();
283
- }
284
283
284
+ assertEquals (5 , (int ) utPlsqlMojo .oraStuckTimeout );
285
+ }
285
286
286
287
/**
287
288
* Ora Stuck Timeout
@@ -322,11 +323,11 @@ public void db_config_using_system_properties() throws Exception {
322
323
}
323
324
324
325
/**
325
- * DB configuration from System Properties
326
+ * Exclude a list of objects
326
327
* <p>
327
- * Given : a pom.xml without dbUrl, dbUser and dbPass configured
328
+ * Given : a pom.xml with a list of objects to exclude
328
329
* When : pom is read
329
- * Then : System Properties must be used to configure database
330
+ * Then : Objects are excluded
330
331
*/
331
332
@ Test
332
333
public void exclude_object () throws Exception {
@@ -338,6 +339,92 @@ public void exclude_object() throws Exception {
338
339
assertEquals ("app.pkg_test_me,app.test_pkg_test_me" , utPlsqlMojo .excludeObject );
339
340
}
340
341
342
+ /**
343
+ * Include a list of objects
344
+ * <p>
345
+ * Given : a pom.xml with a list of objects to include
346
+ * When : pom is read
347
+ * Then : Objects are included
348
+ */
349
+ @ Test
350
+ public void include_object () throws Exception {
351
+ UtPlsqlMojo utPlsqlMojo = createUtPlsqlMojo ("include_object" );
352
+ assertNotNull (utPlsqlMojo );
353
+
354
+ utPlsqlMojo .execute ();
355
+
356
+ assertEquals ("app.pkg_test_me,app.test_pkg_test_me" , utPlsqlMojo .includeObject );
357
+ }
358
+
359
+ /**
360
+ * Include an object by regex
361
+ * <p>
362
+ * Given : a pom.xml with a regex to include
363
+ * When : pom is read
364
+ * Then : Objects are included
365
+ */
366
+ @ Test
367
+ public void include_object_expr () throws Exception {
368
+ UtPlsqlMojo utPlsqlMojo = createUtPlsqlMojo ("include_object_expr" );
369
+ assertNotNull (utPlsqlMojo );
370
+
371
+ utPlsqlMojo .execute ();
372
+
373
+ assertEquals ("*" , utPlsqlMojo .includeObjectExpr );
374
+ }
375
+
376
+ /**
377
+ * Exclude an object by regex
378
+ * <p>
379
+ * Given : a pom.xml with a regex to exclude
380
+ * When : pom is read
381
+ * Then : Objects are included
382
+ */
383
+ @ Test
384
+ public void exclude_object_expr () throws Exception {
385
+ UtPlsqlMojo utPlsqlMojo = createUtPlsqlMojo ("exclude_object_expr" );
386
+ assertNotNull (utPlsqlMojo );
387
+
388
+ utPlsqlMojo .execute ();
389
+
390
+ assertEquals ("*" , utPlsqlMojo .excludeObjectExpr );
391
+ }
392
+
393
+
394
+ /**
395
+ * Include a schema by regex
396
+ * <p>
397
+ * Given : a pom.xml with a regex to include
398
+ * When : pom is read
399
+ * Then : Objects are included
400
+ */
401
+ @ Test
402
+ public void include_schema_expr () throws Exception {
403
+ UtPlsqlMojo utPlsqlMojo = createUtPlsqlMojo ("include_schema_expr" );
404
+ assertNotNull (utPlsqlMojo );
405
+
406
+ utPlsqlMojo .execute ();
407
+
408
+ assertEquals ("*" , utPlsqlMojo .includeSchemaExpr );
409
+ }
410
+
411
+ /**
412
+ * Exclude a schema by regex
413
+ * <p>
414
+ * Given : a pom.xml with a regex to exclude
415
+ * When : pom is read
416
+ * Then : Objects are included
417
+ */
418
+ @ Test
419
+ public void exclude_schema_expr () throws Exception {
420
+ UtPlsqlMojo utPlsqlMojo = createUtPlsqlMojo ("exclude_schema_expr" );
421
+ assertNotNull (utPlsqlMojo );
422
+
423
+ utPlsqlMojo .execute ();
424
+
425
+ assertEquals ("*" , utPlsqlMojo .excludeSchemaExpr );
426
+ }
427
+
341
428
private UtPlsqlMojo createUtPlsqlMojo (String directory ) throws Exception {
342
429
return (UtPlsqlMojo ) rule .lookupConfiguredMojo (new File ("src/test/resources/unit-tests/" + directory ), "test" );
343
430
}
0 commit comments