Skip to content

Bugfix/issue89 navigation failed #90

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 4 commits into from
Dec 15, 2019
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>1.1.0</version>
<version>1.1.1-SNAPSHOT</version>
<packaging>bundle</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Expectation extends AbstractModel {
def getFailureText() {
return '''
«message.trim»
«caller.trim»
«caller?.trim»
'''.toString.trim
}

Expand All @@ -38,10 +38,12 @@ class Expectation extends AbstractModel {

def getCallerLine() {
var Integer line = null
val p = Pattern.compile("(?i)\"[^\\\"]+\",\\s+line\\s*([0-9]+)")
val m = p.matcher(caller)
if (m.find) {
line = Integer.valueOf(m.group(1))
if (caller !== null) {
val p = Pattern.compile("(?i)\"[^\\\"]+\",\\s+line\\s*([0-9]+)")
val m = p.matcher(caller)
if (m.find) {
line = Integer.valueOf(m.group(1))
}
}
return line
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ import org.utplsql.sqldev.dal.UtplsqlDao
import org.utplsql.sqldev.model.LimitedLinkedHashMap
import org.utplsql.sqldev.model.preference.PreferenceModel
import org.utplsql.sqldev.model.runner.Run
import org.utplsql.sqldev.model.runner.Test
import org.utplsql.sqldev.parser.UtplsqlParser
import org.utplsql.sqldev.resources.UtplsqlResources
import org.utplsql.sqldev.runner.UtplsqlRunner
Expand Down Expand Up @@ -248,17 +249,21 @@ class RunnerPanel implements ActionListener, MouseListener, HyperlinkListener {
}
sorter.rowFilter = filter
}

private def openTest(Test test) {
val dao = new UtplsqlDao(Connections.instance.getConnection(currentRun.connectionName))
val source = dao.getSource(test.ownerName, "PACKAGE", test.objectName.toUpperCase).trim
val parser = new UtplsqlParser(source)
val line = parser.getLineOf(test.procedureName)
openEditor(test.ownerName, "PACKAGE", test.objectName.toUpperCase, line, 1)
}

private def openSelectedTest() {
val rowIndex = testOverviewTable.selectedRow
if (rowIndex != -1) {
val row = testOverviewTable.convertRowIndexToModel(rowIndex)
val test = testOverviewTableModel.getTest(row)
val dao = new UtplsqlDao(Connections.instance.getConnection(currentRun.connectionName))
val source = dao.getSource(test.ownerName, "PACKAGE", test.objectName.toUpperCase).trim
val parser = new UtplsqlParser(source)
val line = parser.getLineOf(test.procedureName)
openEditor(test.ownerName, "PACKAGE", test.objectName.toUpperCase, line, 1)
openTest(test)
}
}

Expand All @@ -268,7 +273,12 @@ class RunnerPanel implements ActionListener, MouseListener, HyperlinkListener {
val row = failuresTable.convertRowIndexToModel(rowIndex)
val expectation = failuresTableModel.getExpectation(row)
val test = testOverviewTableModel.getTest(testOverviewTable.convertRowIndexToModel(testOverviewTable.selectedRow))
openEditor(test.ownerName, "PACKAGE BODY", test.objectName.toUpperCase, expectation.callerLine, 1)
val callerLine = expectation.callerLine
if (callerLine !== null) {
openEditor(test.ownerName, "PACKAGE BODY", test.objectName.toUpperCase, expectation.callerLine, 1)
} else {
openTest(test)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,11 @@ class DalTest extends AbstractJdbcTest {
Assert.assertEquals("SCOTT:a", actual.get("SCOTT:a.b"))
Assert.assertEquals("SCOTT:a.b", actual.get("SCOTT:a.b.c"))
Assert.assertEquals("SCOTT:a.b.c", actual.get("SCOTT:a.b.c.junit_utplsql_test_pkg"))
Assert.assertEquals("SCOTT:a.b.c.junit_utplsql_test_pkg", actual.get("SCOTT:a.b.c.junit_utplsql_test_pkg.myContext"))
Assert.assertEquals("SCOTT:a.b.c.junit_utplsql_test_pkg.nested_context_#", actual.get("SCOTT:a.b.c.junit_utplsql_test_pkg.nested_context_#1"))
Assert.assertEquals("SCOTT:a.b.c.junit_utplsql_test_pkg", actual.get("SCOTT:a.b.c.junit_utplsql_test_pkg.t0"))
Assert.assertEquals("SCOTT:a.b.c.junit_utplsql_test_pkg", actual.get("SCOTT:a.b.c.junit_utplsql_test_pkg.t3"))
Assert.assertEquals("SCOTT:a.b.c.junit_utplsql_test_pkg.myContext", actual.get("SCOTT:a.b.c.junit_utplsql_test_pkg.myContext.t1"))
Assert.assertEquals("SCOTT:a.b.c.junit_utplsql_test_pkg.myContext", actual.get("SCOTT:a.b.c.junit_utplsql_test_pkg.myContext.t2"))
Assert.assertEquals("SCOTT:a.b.c.junit_utplsql_test_pkg.nested_context_#1", actual.get("SCOTT:a.b.c.junit_utplsql_test_pkg.nested_context_#1.t1"))
Assert.assertEquals("SCOTT:a.b.c.junit_utplsql_test_pkg.nested_context_#1", actual.get("SCOTT:a.b.c.junit_utplsql_test_pkg.nested_context_#1.t2"))
}

@Test
Expand Down Expand Up @@ -489,7 +489,7 @@ class DalTest extends AbstractJdbcTest {
val actualEmpty = dao.includes('SCOTT', 'TEST_F1')
Assert.assertEquals(#[], actualEmpty)
val actual = dao.includes('SCOTT', 'junit_utplsql_test_pkg')
Assert.assertEquals(#['SCOTT.JUNIT_UTPLSQL_TEST_PKG','SCOTT.JUNIT_F','UT3_LATEST_RELEASE.UT_EXPECTATION'].sort, actual.sort)
Assert.assertEquals(#['SCOTT.JUNIT_UTPLSQL_TEST_PKG','SCOTT.JUNIT_F','UT3_LATEST_RELEASE.UT_DATA_VALUE','UT3_LATEST_RELEASE.UT_EXPECTATION'].sort, actual.sort)
}

@Test
Expand Down