Skip to content

Commit b0fc546

Browse files
Fixes #56 - "Run utPLSQL test" is disabled for suites without test
1 parent 8ad5e78 commit b0fc546

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class UtplsqlDao {
179179
val sql = '''
180180
SELECT count(*)
181181
FROM TABLE(ut_runner.get_suites_info(upper(?), upper(?)))
182-
WHERE item_type = 'UT_TEST'
182+
WHERE item_type IN ('UT_TEST', 'UT_SUITE')
183183
AND (item_name = upper(?) or ? IS NULL)
184184
'''
185185
found = jdbcTemplate.queryForObject(sql, Integer, #[owner, objectName, subobjectName, subobjectName])

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

+13
Original file line numberDiff line numberDiff line change
@@ -471,5 +471,18 @@ class DalTest extends AbstractJdbcTest {
471471
Assert.assertEquals(expected, actual)
472472

473473
}
474+
475+
@Test
476+
def void issue56SuiteWithoutTests() {
477+
jdbcTemplate.execute('''
478+
CREATE OR REPLACE PACKAGE junit_utplsql_test_pkg IS
479+
-- %suite
480+
481+
END junit_utplsql_test_pkg;
482+
''')
483+
val dao = new UtplsqlDao(dataSource.connection)
484+
Assert.assertTrue(dao.containsUtplsqlTest("scott", "junit_utplsql_test_pkg"))
485+
jdbcTemplate.execute("DROP PACKAGE junit_utplsql_test_pkg")
486+
}
474487

475488
}

0 commit comments

Comments
 (0)