Skip to content
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
2 changes: 1 addition & 1 deletion sqldev/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!-- The Basics -->
<groupId>org.utplsql</groupId>
<artifactId>org.utplsql.sqldev</artifactId>
<version>0.4.0</version>
<version>0.4.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
97 changes: 48 additions & 49 deletions sqldev/src/main/java/org/utplsql/sqldev/oddgen/TestTemplate.xtend
Original file line number Diff line number Diff line change
Expand Up @@ -45,34 +45,34 @@ class TestTemplate {
«val packageName = '''«context.testPackagePrefix»«objectName»«context.testPackageSuffix»'''»
CREATE OR REPLACE PACKAGE «packageName» IS

«IF context.generateComments»
/* generated by utPLSQL for SQL Developer on «today» */

«ENDIF»
--%suite(«packageName»)
«IF !context.suitePath.empty»
--%suitepath(«context.suitePath»)
«ENDIF»

«FOR u : units»
«val unit = u.toLowerCase»
«IF context.numberOfTestsPerUnit > 1 && (context.objectType == "PACKAGE" || context.objectType == "TYPE")»
--%context(«unit»)
«IF context.generateComments»
/* generated by utPLSQL for SQL Developer on «today» */

«ENDIF»
«FOR i : 1 .. context.numberOfTestsPerUnit»
--%test
«IF context.disableTests»
--%disabled
--%suite(«packageName»)
«IF !context.suitePath.empty»
--%suitepath(«context.suitePath»)
«ENDIF»

«FOR u : units»
«val unit = u.toLowerCase»
«IF context.numberOfTestsPerUnit > 1 && (context.objectType == "PACKAGE" || context.objectType == "TYPE")»
--%context(«unit»)

«ENDIF»
PROCEDURE «context.testUnitPrefix»«unit»«context.testUnitSuffix»«IF context.numberOfTestsPerUnit > 1»«i»«ENDIF»;
«FOR i : 1 .. context.numberOfTestsPerUnit»
--%test
«IF context.disableTests»
--%disabled
«ENDIF»
PROCEDURE «context.testUnitPrefix»«unit»«context.testUnitSuffix»«IF context.numberOfTestsPerUnit > 1»«i»«ENDIF»;

«ENDFOR»
«IF context.numberOfTestsPerUnit > 1 && (context.objectType == "PACKAGE" || context.objectType == "TYPE")»
--%endcontext
«ENDFOR»
«IF context.numberOfTestsPerUnit > 1 && (context.objectType == "PACKAGE" || context.objectType == "TYPE")»
--%endcontext

«ENDIF»
«ENDFOR»
«ENDIF»
«ENDFOR»
END «packageName»;
/
'''
Expand All @@ -84,38 +84,37 @@ class TestTemplate {
«val objectName = context.objectName.toLowerCase»
CREATE OR REPLACE PACKAGE BODY «context.testPackagePrefix»«objectName»«context.testPackageSuffix» IS

«IF context.generateComments»
/* generated by utPLSQL for SQL Developer on «today» */
«IF context.generateComments»
/* generated by utPLSQL for SQL Developer on «today» */

«ENDIF»
«FOR u : units»
«val unit = u.toLowerCase»
«FOR i : 1 .. context.numberOfTestsPerUnit»
«val procedureName = '''«context.testUnitPrefix»«unit»«context.testUnitSuffix»«IF context.numberOfTestsPerUnit > 1»«i»«ENDIF»'''»
«IF context.generateComments»
--
-- test «unit»«IF context.numberOfTestsPerUnit > 0» case «i»: ...«ENDIF»
--
«ENDIF»
PROCEDURE «procedureName» IS
l_actual INTEGER := 0;
l_expected INTEGER := 1;
BEGIN
«ENDIF»
«FOR u : units»
«val unit = u.toLowerCase»
«FOR i : 1 .. context.numberOfTestsPerUnit»
«val procedureName = '''«context.testUnitPrefix»«unit»«context.testUnitSuffix»«IF context.numberOfTestsPerUnit > 1»«i»«ENDIF»'''»
«IF context.generateComments»
-- populate actual
-- «objectName».«unit»;
--
-- test «unit»«IF context.numberOfTestsPerUnit > 0» case «i»: ...«ENDIF»
--
«ENDIF»
PROCEDURE «procedureName» IS
l_actual INTEGER := 0;
l_expected INTEGER := 1;
BEGIN
«IF context.generateComments»
-- populate actual
-- «objectName».«unit»;

-- populate expected
-- ...
-- populate expected
-- ...

-- assert
«ENDIF»
ut.expect(l_actual).to_equal(l_expected);
END «procedureName»;
-- assert
«ENDIF»
ut.expect(l_actual).to_equal(l_expected);
END «procedureName»;

«ENDFOR»
«ENDFOR»
«ENDFOR»

END «context.testPackagePrefix»«objectName»«context.testPackageSuffix»;
/
'''
Expand Down