Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit33b0248

Browse files
Fixes#54 - oddgen "Run test" view under "All Suitepaths": show package icon only for parents of test procedures bug
1 parentd7cbfc7 commit33b0248

File tree

2 files changed

+48
-3
lines changed

2 files changed

+48
-3
lines changed

‎sqldev/src/main/java/org/utplsql/sqldev/dal/UtplsqlDao.xtend

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff 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+
WHENitem_type ='UT_SUITE' AND test_count > 0 THEN
456464
'PACKAGE_ICON'
457-
WHEN'UT_TEST' THEN
465+
WHENitem_type ='UT_TEST' THEN
458466
'PROCEDURE_ICON'
459467
ELSE
460468
'FOLDER_ICON'

‎sqldev/src/test/java/org/utplsql/sqldev/tests/DalTest.xtend

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,43 @@ class DalTest extends AbstractJdbcTest {
472472

473473
}
474474

475+
@Test
476+
defvoidissue54FolderIconForSuitesWithoutTests() {
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=newUtplsqlDao(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+
defvoidissue54PackageIconForSuitesWithTests() {
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=newUtplsqlDao(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
defvoidissue55SuiteWithoutTests() {
477514
setupAndTeardown

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp