Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit c7196df

Browse files
Merge pull request #7 from Trivadis/bugfix/issue_5_overriding
Bugfix/issue 5 overriding
2 parents 97c3ca4 + bb40b9e commit c7196df

File tree

2 files changed

+87
-1
lines changed

2 files changed

+87
-1
lines changed

settings/sql_developer/trivadis_custom_format.arbori

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ simpleIndentConditions:
184184
([node^) aggregate_function | [node^) analytic_function | [node^) analytic_clause | [node^^) analytic_clause) --<-- not to ident order by in the main query block
185185
| :breaksAfterSelectFromWhere & [node) "ord_by_1desc" & [node^) order_by_clause
186186
| :breaksAfterSelectFromWhere & [node) order_by_clause[31,38) & [node^) order_by_clause
187-
| [node) original_method_body_specification
187+
--| [node) original_method_body_specification -- salvisberg, disabled, issue #5
188+
| [node) body_adt_field -- salvisberg, added, issue #5
188189
| [node) parallel_clause
189190
| [node) password_parameters
190191
| [node) pdb_storage_clause
@@ -498,6 +499,7 @@ _extraBrkBefore:
498499
| [node) case_stmt_alt
499500
| [node) simple_case_expression[4,27)#
500501
| :breakAfterConditions & [node) 'THEN'
502+
| [node) method_specification & [node-1) ',' -- salvisberg, added, issue #5
501503
;
502504

503505
_extraBrkAfter:
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
package com.trivadis.plsql.formatter.settings.tests
2+
3+
import com.trivadis.plsql.formatter.settings.ConfiguredTestFormatter
4+
import oracle.dbtools.app.Format
5+
import org.junit.Before
6+
import org.junit.Test
7+
8+
class Issue_5 extends ConfiguredTestFormatter {
9+
10+
@Before
11+
def void setup() {
12+
formatter.options.put(formatter.kwCase, Format.Case.lower)
13+
}
14+
15+
@Test
16+
def object_type_spec_overriding_member_function() {
17+
'''
18+
create or replace type ut_xunit_reporter under ut_junit_reporter (
19+
constructor function ut_xunit_reporter (
20+
self in out nocopy ut_xunit_reporter
21+
) return self as result,
22+
overriding member function get_description return varchar2
23+
) not final
24+
/
25+
'''.formatAndAssert
26+
}
27+
28+
@Test
29+
def object_type_spec_overriding_final_member_function() {
30+
'''
31+
create or replace type ut_xunit_reporter under ut_junit_reporter (
32+
constructor function ut_xunit_reporter (
33+
self in out nocopy ut_xunit_reporter
34+
) return self as result,
35+
final member function get_description return varchar2
36+
) not final
37+
/
38+
'''.formatAndAssert
39+
}
40+
41+
@Test
42+
def object_type_body_overriding_member_function() {
43+
'''
44+
create or replace type body ut_xunit_reporter is
45+
constructor function ut_xunit_reporter (
46+
self in out nocopy ut_xunit_reporter
47+
) return self as result is
48+
begin
49+
self.init($$plsql_unit);
50+
return;
51+
end;
52+
overriding member function get_description return varchar2 as
53+
begin
54+
return 'Depracated reporter. Please use Junit.
55+
Provides outcomes in a format conforming with JUnit 4 and above as defined in: https://gist.github.com/kuzuha/232902acab1344d6b578';
56+
end;
57+
end;
58+
/
59+
'''.formatAndAssert
60+
}
61+
62+
@Test
63+
def object_type_body_final_member_function() {
64+
'''
65+
create or replace type body ut_xunit_reporter is
66+
constructor function ut_xunit_reporter (
67+
self in out nocopy ut_xunit_reporter
68+
) return self as result is
69+
begin
70+
self.init($$plsql_unit);
71+
return;
72+
end;
73+
final member function get_description return varchar2 as
74+
begin
75+
return 'Depracated reporter. Please use Junit.
76+
Provides outcomes in a format conforming with JUnit 4 and above as defined in: https://gist.github.com/kuzuha/232902acab1344d6b578';
77+
end;
78+
end;
79+
/
80+
'''.formatAndAssert
81+
}
82+
83+
84+
}

0 commit comments

Comments
 (0)