Skip to content

Commit b04f4be

Browse files
committed
Calling right function to run tests and typo fix
1 parent 8ca4248 commit b04f4be

File tree

5 files changed

+14
-16
lines changed

5 files changed

+14
-16
lines changed

src/main/java/io/github/utplsql/OutputBuffer.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ public static List<String> getAllLines(String reporterId) throws SQLException {
2020
ResultSet resultSet = null;
2121
try {
2222
callableStatement = UTPLSQL.getConnection()
23-
.prepareCall("BEGIN :lines := ut_output_buffer.get_lines_cursor(:reporter_id); END;");
23+
.prepareCall("BEGIN ? := ut_output_buffer.get_lines_cursor(?); END;");
2424

25-
callableStatement.registerOutParameter(":lines", OracleTypes.CURSOR);
26-
callableStatement.setString(":reporter_id", reporterId);
25+
callableStatement.registerOutParameter(1, OracleTypes.CURSOR);
26+
callableStatement.setString(2, reporterId);
2727
callableStatement.execute();
2828

29-
resultSet = (ResultSet) callableStatement.getObject(":lines");
29+
resultSet = (ResultSet) callableStatement.getObject(1);
3030

3131
List<String> outputLines = new ArrayList<>();
3232
while (resultSet.next()) {
33-
outputLines.add(resultSet.getString(0));
33+
outputLines.add(resultSet.getString("text"));
3434
}
3535
return outputLines;
3636
} finally {

src/main/java/io/github/utplsql/TestRunner.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static void run() throws SQLException {
1616
CallableStatement callableStatement = null;
1717
try {
1818
callableStatement = UTPLSQL.getConnection()
19-
.prepareCall("BEGIN ut.run(); END;");
19+
.prepareCall("BEGIN ut_runner.run(); END;");
2020
callableStatement.execute();
2121
} finally {
2222
if (callableStatement != null)
@@ -32,7 +32,7 @@ public static void run(String path, BaseReporter reporter) throws SQLException {
3232
CallableStatement callableStatement = null;
3333
try {
3434
callableStatement = UTPLSQL.getConnection()
35-
.prepareCall("BEGIN ut.run(:path, :reporter); END;");
35+
.prepareCall("BEGIN ut_runner.run(:path, :reporter); END;");
3636
callableStatement.setString(":path", path);
3737
callableStatement.setObject(":reporter", reporter);
3838
callableStatement.execute();

src/main/java/io/github/utplsql/types/CustomTypes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
public enum CustomTypes {
88
// Object names must be upper case.
99
UT_DOCUMENTATION_REPORTER("UT_DOCUMENTATION_REPORTER"),
10-
UT_VARCHAF2_LIST("UT_VARCHAF2_LIST");
10+
UT_VARCHAF2_LIST("UT_VARCHAR2_LIST");
1111

1212
private String typeName;
1313

src/test/java/io/github/utplsql/OutputBufferTest.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import org.junit.ClassRule;
88
import org.junit.Test;
99

10-
import java.sql.Connection;
1110
import java.sql.SQLException;
1211
import java.util.List;
1312

@@ -22,19 +21,17 @@ public class OutputBufferTest {
2221
@Test
2322
public void getLinesFromOutputBuffer() {
2423
try {
25-
Connection conn = UTPLSQL.getConnection();
26-
conn.setAutoCommit(false);
27-
2824
BaseReporter reporter = new DocumentationReporter();
2925
reporter.setReporterId(UTPLSQL.newSysGuid());
3026
TestRunner.run("", reporter);
3127

3228
List<String> outputLines = OutputBuffer.getAllLines(reporter.getReporterId());
29+
30+
// Debug
31+
System.out.println("Reporter ID: " + reporter.getReporterId());
3332
for (int i = 0; i < outputLines.size(); i++) {
34-
System.out.println(outputLines.get(0));
33+
System.out.println(outputLines.get(i));
3534
}
36-
37-
conn.commit();
3835
} catch (SQLException e) {
3936
Assert.fail(e.getMessage());
4037
}

src/test/java/io/github/utplsql/rules/DatabaseRule.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ public class DatabaseRule extends ExternalResource {
1010

1111
@Override
1212
protected void before() throws Throwable {
13-
UTPLSQL.init("jdbc:oracle:thin:@docker:1521:xe", "app", "app");
13+
// TODO: Options file.
14+
UTPLSQL.init("jdbc:oracle:thin:@127.0.0.1:1521:xe", "ut3", "ut3");
1415
}
1516

1617
@Override

0 commit comments

Comments
 (0)