Skip to content

Bugfix/issue 113 code templates #114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 18, 2020
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: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ Please file your bug reports, enhancement requests, questions and other support

## How to Build

1. [Download](http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html) and install SQL Developer 19.4.0
1. [Download](http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html) and install SQL Developer 20.2.0
2. [Download](https://maven.apache.org/download.cgi) and install Apache Maven 3.6.3
3. [Download](https://git-scm.com/downloads) and install a git command line client
4. Clone the utPLSQL-SQLDeveloper repository
Expand All @@ -154,7 +154,7 @@ Please file your bug reports, enhancement requests, questions and other support

6. Run maven build by the following command

mvn -Dsqldev.basedir=/Applications/SQLDeveloper19.4.0.app/Contents/Resources/sqldeveloper -DskipTests=true clean package
mvn -Dsqldev.basedir=/Applications/SQLDeveloper20.2.0.app/Contents/Resources/sqldeveloper -DskipTests=true clean package

Amend the parameter sqldev.basedir to match the path of your SQL Developer installation. This folder is used to reference Oracle jar files which are not available in public Maven repositories
7. The resulting file ```utplsql_for_SQLDev_x.x.x-SNAPSHOT.zip``` in the ```target``` directory can be installed within SQL Developer
Expand Down
2 changes: 1 addition & 1 deletion sqldev/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<jdk.version>1.8</jdk.version>
<jdk.version.test>1.8</jdk.version.test>
<!-- requires SQL Developer 4.1.0 or higher (first version based on JDK 1.8) -->
<sqldev.basedir>/Applications/SQLDeveloper19.4.0.app/Contents/Resources/sqldeveloper</sqldev.basedir>
<sqldev.basedir>/Applications/SQLDeveloper20.2.0.app/Contents/Resources/sqldeveloper</sqldev.basedir>
<final.name>utplsql_for_SQLDev_${project.version}</final.name>
<!-- arguments to by added by jacoco plugin for test runs with coverage -->
<!-- -noverify is required in some environments to avoid java.lang.VerifyError -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ private CharSequence utSpecTemplate() {
sb.append(suitePathTextField.getText());
sb.append(")\n");
}
sb.append('\n');
sb.append('\t');
sb.append(utSpecProcTemplate());
sb.append("\n\t");
sb.append(utSpecProcTemplate().toString().trim().replace("\n", "\n\t"));
sb.append("\n\n");
sb.append("END ");
sb.append(testPackagePrefixTextField.getText());
sb.append("[package_name]");
Expand All @@ -271,7 +271,7 @@ private CharSequence utSpecProcTemplate() {
if (withContext) {
sb.append("--%context([procedure_name])\n\n");
}
for (int i = 0; i < numberOfTestsPerUnit; i ++) {
for (int i = 1; i <= numberOfTestsPerUnit; i ++) {
sb.append("--%test\n");
if (disableTestsCheckBox.isSelected()) {
sb.append("--%disabled\n");
Expand All @@ -297,10 +297,9 @@ private CharSequence utBodyTemplate() {
sb.append(testPackagePrefixTextField.getText());
sb.append("[package_name]");
sb.append(testPackageSuffixTextField.getText());
sb.append(" IS\n\n");
sb.append('\t');
sb.append(utBodyProcTemplate());
sb.append('\n');
sb.append(" IS\n\n\t");
sb.append(utBodyProcTemplate().toString().trim().replace("\n", "\n\t"));
sb.append("\n\n");
sb.append("END ");
sb.append(testPackagePrefixTextField.getText());
sb.append("[package_name]");
Expand All @@ -314,7 +313,7 @@ private CharSequence utBodyProcTemplate() {
StringBuilder sb = new StringBuilder();
final Integer numberOfTestsPerUnit = (Integer) numberOfTestsPerUnitModel.getValue();
final boolean withContext = numberOfTestsPerUnit > 1;
for (int i = 0; i < numberOfTestsPerUnit; i++) {
for (int i = 1; i <= numberOfTestsPerUnit; i++) {
if (generateCommentsCheckBox.isSelected()) {
sb.append("--\n");
sb.append("-- test");
Expand Down Expand Up @@ -344,7 +343,7 @@ private CharSequence utBodyProcTemplate() {
sb.append("\t-- ...\n\n");
sb.append("\t-- assert\n");
}
sb.append("\tut.expect(l_actual).to_equal(l_expected);");
sb.append("\tut.expect(l_actual).to_equal(l_expected);\n");
sb.append("END ");
sb.append(testUnitPrefixTextField.getText());
sb.append("[procedure_name]");
Expand Down