diff --git a/settings/sql_developer/trivadis_custom_format.arbori b/settings/sql_developer/trivadis_custom_format.arbori index 44d5cc4a..ad8c5e0b 100644 --- a/settings/sql_developer/trivadis_custom_format.arbori +++ b/settings/sql_developer/trivadis_custom_format.arbori @@ -184,7 +184,8 @@ simpleIndentConditions: ([node^) aggregate_function | [node^) analytic_function | [node^) analytic_clause | [node^^) analytic_clause) --<-- not to ident order by in the main query block | :breaksAfterSelectFromWhere & [node) "ord_by_1desc" & [node^) order_by_clause | :breaksAfterSelectFromWhere & [node) order_by_clause[31,38) & [node^) order_by_clause -| [node) original_method_body_specification +--| [node) original_method_body_specification -- salvisberg, disabled, issue #5 +| [node) body_adt_field -- salvisberg, added, issue #5 | [node) parallel_clause | [node) password_parameters | [node) pdb_storage_clause @@ -498,6 +499,7 @@ _extraBrkBefore: | [node) case_stmt_alt | [node) simple_case_expression[4,27)# | :breakAfterConditions & [node) 'THEN' +| [node) method_specification & [node-1) ',' -- salvisberg, added, issue #5 ; _extraBrkAfter: diff --git a/sqldev/src/test/java/com/trivadis/plsql/formatter/settings/tests/Issue_5.xtend b/sqldev/src/test/java/com/trivadis/plsql/formatter/settings/tests/Issue_5.xtend new file mode 100644 index 00000000..ceba0e7a --- /dev/null +++ b/sqldev/src/test/java/com/trivadis/plsql/formatter/settings/tests/Issue_5.xtend @@ -0,0 +1,84 @@ +package com.trivadis.plsql.formatter.settings.tests + +import com.trivadis.plsql.formatter.settings.ConfiguredTestFormatter +import oracle.dbtools.app.Format +import org.junit.Before +import org.junit.Test + +class Issue_5 extends ConfiguredTestFormatter { + + @Before + def void setup() { + formatter.options.put(formatter.kwCase, Format.Case.lower) + } + + @Test + def object_type_spec_overriding_member_function() { + ''' + create or replace type ut_xunit_reporter under ut_junit_reporter ( + constructor function ut_xunit_reporter ( + self in out nocopy ut_xunit_reporter + ) return self as result, + overriding member function get_description return varchar2 + ) not final + / + '''.formatAndAssert + } + + @Test + def object_type_spec_overriding_final_member_function() { + ''' + create or replace type ut_xunit_reporter under ut_junit_reporter ( + constructor function ut_xunit_reporter ( + self in out nocopy ut_xunit_reporter + ) return self as result, + final member function get_description return varchar2 + ) not final + / + '''.formatAndAssert + } + + @Test + def object_type_body_overriding_member_function() { + ''' + create or replace type body ut_xunit_reporter is + constructor function ut_xunit_reporter ( + self in out nocopy ut_xunit_reporter + ) return self as result is + begin + self.init($$plsql_unit); + return; + end; + overriding member function get_description return varchar2 as + begin + return 'Depracated reporter. Please use Junit. + Provides outcomes in a format conforming with JUnit 4 and above as defined in: https://gist.github.com/kuzuha/232902acab1344d6b578'; + end; + end; + / + '''.formatAndAssert + } + + @Test + def object_type_body_final_member_function() { + ''' + create or replace type body ut_xunit_reporter is + constructor function ut_xunit_reporter ( + self in out nocopy ut_xunit_reporter + ) return self as result is + begin + self.init($$plsql_unit); + return; + end; + final member function get_description return varchar2 as + begin + return 'Depracated reporter. Please use Junit. + Provides outcomes in a format conforming with JUnit 4 and above as defined in: https://gist.github.com/kuzuha/232902acab1344d6b578'; + end; + end; + / + '''.formatAndAssert + } + + +} \ No newline at end of file