Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion settings/sql_developer/trivadis_custom_format.arbori
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}


}