Skip to content

Commit 9c74b27

Browse files
Merge pull request #34 from PhilippSalvisberg/develop
Fixes #33 - Missing indent in generated package specs and bodies
2 parents 5736d11 + 7d8563f commit 9c74b27

File tree

2 files changed

+49
-50
lines changed

2 files changed

+49
-50
lines changed

sqldev/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<!-- The Basics -->
66
<groupId>org.utplsql</groupId>
77
<artifactId>org.utplsql.sqldev</artifactId>
8-
<version>0.4.0</version>
8+
<version>0.4.1-SNAPSHOT</version>
99
<packaging>bundle</packaging>
1010
<properties>
1111
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

sqldev/src/main/java/org/utplsql/sqldev/oddgen/TestTemplate.xtend

+48-49
Original file line numberDiff line numberDiff line change
@@ -45,34 +45,34 @@ class TestTemplate {
4545
«val packageName = '''«context.testPackagePrefix»«objectName»«context.testPackageSuffix»'''»
4646
CREATE OR REPLACE PACKAGE «packageName» IS
4747
48-
«IF context.generateComments»
49-
/* generated by utPLSQL for SQL Developer on «today» */
50-
51-
«ENDIF»
52-
--%suite(«packageName»)
53-
«IF !context.suitePath.empty»
54-
--%suitepath(«context.suitePath»)
55-
«ENDIF»
56-
57-
«FOR u : units»
58-
«val unit = u.toLowerCase»
59-
«IF context.numberOfTestsPerUnit > 1 && (context.objectType == "PACKAGE" || context.objectType == "TYPE")»
60-
--%context(«unit»)
48+
«IF context.generateComments»
49+
/* generated by utPLSQL for SQL Developer on «today» */
6150
6251
«ENDIF»
63-
«FOR i : 1 .. context.numberOfTestsPerUnit»
64-
--%test
65-
«IF context.disableTests»
66-
--%disabled
52+
--%suite(«packageName»)
53+
«IF !context.suitePath.empty»
54+
--%suitepath(«context.suitePath»)
55+
«ENDIF»
56+
57+
«FOR u : units»
58+
«val unit = u.toLowerCase»
59+
«IF context.numberOfTestsPerUnit > 1 && (context.objectType == "PACKAGE" || context.objectType == "TYPE")»
60+
--%context(«unit»)
61+
6762
«ENDIF»
68-
PROCEDURE «context.testUnitPrefix»«unit»«context.testUnitSuffix»«IF context.numberOfTestsPerUnit > 1»«i»«ENDIF»;
63+
«FOR i : 1 .. context.numberOfTestsPerUnit»
64+
--%test
65+
«IF context.disableTests»
66+
--%disabled
67+
«ENDIF»
68+
PROCEDURE «context.testUnitPrefix»«unit»«context.testUnitSuffix»«IF context.numberOfTestsPerUnit > 1»«i»«ENDIF»;
6969
70-
«ENDFOR»
71-
«IF context.numberOfTestsPerUnit > 1 && (context.objectType == "PACKAGE" || context.objectType == "TYPE")»
72-
--%endcontext
70+
«ENDFOR»
71+
«IF context.numberOfTestsPerUnit > 1 && (context.objectType == "PACKAGE" || context.objectType == "TYPE")»
72+
--%endcontext
7373
74-
«ENDIF»
75-
«ENDFOR»
74+
«ENDIF»
75+
«ENDFOR»
7676
END «packageName»;
7777
/
7878
'''
@@ -84,38 +84,37 @@ class TestTemplate {
8484
«val objectName = context.objectName.toLowerCase»
8585
CREATE OR REPLACE PACKAGE BODY «context.testPackagePrefix»«objectName»«context.testPackageSuffix» IS
8686
87-
«IF context.generateComments»
88-
/* generated by utPLSQL for SQL Developer on «today» */
87+
«IF context.generateComments»
88+
/* generated by utPLSQL for SQL Developer on «today» */
8989
90-
«ENDIF»
91-
«FOR u : units»
92-
«val unit = u.toLowerCase»
93-
«FOR i : 1 .. context.numberOfTestsPerUnit»
94-
«val procedureName = '''«context.testUnitPrefix»«unit»«context.testUnitSuffix»«IF context.numberOfTestsPerUnit > 1»«i»«ENDIF»'''»
95-
«IF context.generateComments»
96-
--
97-
-- test «unit»«IF context.numberOfTestsPerUnit > 0» case «i»: ...«ENDIF»
98-
--
99-
«ENDIF»
100-
PROCEDURE «procedureName» IS
101-
l_actual INTEGER := 0;
102-
l_expected INTEGER := 1;
103-
BEGIN
90+
«ENDIF»
91+
«FOR u : units»
92+
«val unit = u.toLowerCase»
93+
«FOR i : 1 .. context.numberOfTestsPerUnit»
94+
«val procedureName = '''«context.testUnitPrefix»«unit»«context.testUnitSuffix»«IF context.numberOfTestsPerUnit > 1»«i»«ENDIF»'''»
10495
«IF context.generateComments»
105-
-- populate actual
106-
-- «objectName».«unit»;
96+
--
97+
-- test «unit»«IF context.numberOfTestsPerUnit > 0» case «i»: ...«ENDIF»
98+
--
99+
«ENDIF»
100+
PROCEDURE «procedureName» IS
101+
l_actual INTEGER := 0;
102+
l_expected INTEGER := 1;
103+
BEGIN
104+
«IF context.generateComments»
105+
-- populate actual
106+
-- «objectName».«unit»;
107107
108-
-- populate expected
109-
-- ...
108+
-- populate expected
109+
-- ...
110110
111-
-- assert
112-
«ENDIF»
113-
ut.expect(l_actual).to_equal(l_expected);
114-
END «procedureName»;
111+
-- assert
112+
«ENDIF»
113+
ut.expect(l_actual).to_equal(l_expected);
114+
END «procedureName»;
115115
116+
«ENDFOR»
116117
«ENDFOR»
117-
«ENDFOR»
118-
119118
END «context.testPackagePrefix»«objectName»«context.testPackageSuffix»;
120119
/
121120
'''

0 commit comments

Comments
 (0)