File tree Expand file tree Collapse file tree 2 files changed +48
-3
lines changed
main/java/org/utplsql/sqldev/dal
test/java/org/utplsql/sqldev/tests Expand file tree Collapse file tree 2 files changed +48
-3
lines changed Original file line number Diff line number Diff line change @@ -388,6 +388,14 @@ class UtplsqlDao {
388388 SELECT object_owner,
389389 object_name,
390390 path AS suitepath,
391+ count(
392+ CASE
393+ WHEN item_type = ' UT_TEST ' THEN
394+ 1
395+ ELSE
396+ NULL
397+ END
398+ ) over (partition by object_owner, object_name) AS test_count,
391399 item_type,
392400 item_name,
393401 item_description
@@ -451,10 +459,10 @@ class UtplsqlDao {
451459 object_owner || ' : ' || suitepath AS id,
452460 item_name AS name,
453461 item_description AS description,
454- CASE item_type
455- WHEN ' UT_SUITE ' THEN
462+ CASE
463+ WHEN item_type = ' UT_SUITE ' AND test_count > 0 THEN
456464 ' PACKAGE_ICON '
457- WHEN ' UT_TEST ' THEN
465+ WHEN item_type = ' UT_TEST ' THEN
458466 ' PROCEDURE_ICON '
459467 ELSE
460468 ' FOLDER_ICON '
Original file line number Diff line number Diff line change @@ -472,6 +472,43 @@ class DalTest extends AbstractJdbcTest {
472472
473473 }
474474
475+ @Test
476+ def void issue54FolderIconForSuitesWithoutTests () {
477+ setupAndTeardown
478+ jdbcTemplate. execute(' ' '
479+ CREATE OR REPLACE PACKAGE junit_utplsql_test_pkg IS
480+ -- %suite
481+
482+ END junit_utplsql_test_pkg;
483+ ' ' ' )
484+ val dao = new UtplsqlDao (dataSource. connection)
485+ val actualNodes = dao. runnables()
486+ Assert . assertEquals(4 , actualNodes. size)
487+ val pkg = actualNodes. findFirst[it . id == " SCOTT:junit_utplsql_test_pkg" ]
488+ Assert . assertEquals(" FOLDER_ICON" , pkg. iconName)
489+ jdbcTemplate. execute(" DROP PACKAGE junit_utplsql_test_pkg" )
490+ }
491+
492+ @Test
493+ def void issue54PackageIconForSuitesWithTests () {
494+ setupAndTeardown
495+ jdbcTemplate. execute(' ' '
496+ CREATE OR REPLACE PACKAGE junit_utplsql_test_pkg IS
497+ -- %suite
498+
499+ -- %test
500+ PROCEDURE t1;
501+
502+ END junit_utplsql_test_pkg;
503+ ' ' ' )
504+ val dao = new UtplsqlDao (dataSource. connection)
505+ val actualNodes = dao. runnables()
506+ Assert . assertEquals(6 , actualNodes. size)
507+ val pkg = actualNodes. findFirst[it . id == " SCOTT:junit_utplsql_test_pkg" ]
508+ Assert . assertEquals(" PACKAGE_ICON" , pkg. iconName)
509+ jdbcTemplate. execute(" DROP PACKAGE junit_utplsql_test_pkg" )
510+ }
511+
475512 @Test
476513 def void issue55SuiteWithoutTests () {
477514 setupAndTeardown
You can’t perform that action at this time.
0 commit comments