@@ -231,7 +231,7 @@ class RunnerPanel implements ActionListener, MouseListener, HyperlinkListener {
231
231
</style>
232
232
</head>
233
233
<body>
234
- «getLinkedText (text)»
234
+ «getLinkedAndFormattedText (text)»
235
235
</body>
236
236
</html>
237
237
' ' '
@@ -245,14 +245,16 @@ class RunnerPanel implements ActionListener, MouseListener, HyperlinkListener {
245
245
var line = Integer . parseInt(parts. get(2 ))
246
246
val dao = new UtplsqlDao (Connections . instance. getConnection(currentRun. connectionName))
247
247
val objectType = dao. getObjectType(ownerName, objectName)
248
+ // links to package specification will open the body, there is no way to identify the type without context knowledge
249
+ // but the jump to the specification from the body is simple from SQL Developer, so it is a minor issue
248
250
val fixedObjectType = ' ' ' «objectType»«IF objectType == "PACKAGE" || objectType == "TYPE"» BODY«ENDIF»' ' '
249
251
if (parts. size == 4 ) {
250
252
val procedureName = parts. get(3 )
251
253
val source = dao. getSource(ownerName, fixedObjectType, objectName). trim
252
254
val parser = new UtplsqlParser (source)
253
255
line = parser. getLineOf(procedureName)
254
256
}
255
- openEditor(ownerName, ' ' ' «objectType»«IF objectType == "PACKAGE" || objectType == "TYPE"» BODY«ENDIF» ' ' ' , objectName. toUpperCase, line, 1 )
257
+ openEditor(ownerName, fixedObjectType , objectName. toUpperCase, line, 1 )
256
258
}
257
259
258
260
private def openEditor (String owner , String type , String name , int line , int col ) {
@@ -543,13 +545,14 @@ class RunnerPanel implements ActionListener, MouseListener, HyperlinkListener {
543
545
}
544
546
}
545
547
546
- private def getLinkedText (String text ) {
548
+ private def getLinkedAndFormattedText (String text ) {
547
549
if (text == = null ) {
548
550
return " "
549
551
}
550
552
// Patterns (primarily Asserts, Errors, ServerOutput):
551
553
// at "OWNER.PACKAGE.PROCEDURE", line 42
552
554
// at "OWNER.PROCEDURE", line 42
555
+ // at "OWNER.PACKAGE", line 42
553
556
val p1 = Pattern . compile(' ' ' \s +("(\S +?)\. (\S +?)(?:\. (\S +?))?",\s +line\s +([0-9]+))' ' ' )
554
557
var localText = HtmlUtils . htmlEscape(text)
555
558
var m = p1. matcher(localText)
@@ -569,6 +572,17 @@ class RunnerPanel implements ActionListener, MouseListener, HyperlinkListener {
569
572
localText = ' ' ' «localText.substring(0, start)»«link»«localText.substring(end)»' ' '
570
573
m = p2. matcher(localText)
571
574
}
575
+ // Patterns (Title for warning/info on suite level)
576
+ // from suite a.junit_utplsql_test1_pkg:
577
+ val p3 = Pattern . compile(' ' ' ^For suite ([^:]+):$' ' ' , Pattern . MULTILINE )
578
+ m = p3. matcher(localText)
579
+ while (m. find) {
580
+ val title = ' ' ' <font size="4"><b>For suite "«m.group(1)»"</b></font>' ' '
581
+ val start = m. start(0 )
582
+ val end = m. end(0 )
583
+ localText = ' ' ' «localText.substring(0, start)»«title»«localText.substring(end)»' ' '
584
+ m = p3. matcher(localText)
585
+ }
572
586
val result = ' ' '
573
587
«FOR p : localText.split("\n ")»
574
588
<p>«p»</p>
0 commit comments