Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit25de681

Browse files
authored
Merge pull request#9 from viniciusam/output_ident
Documentation Reporter Identation and Small Fixes
2 parents3f244a1 +50a88e2 commit25de681

File tree

4 files changed

+54
-4
lines changed

4 files changed

+54
-4
lines changed

‎pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
<dependencies>
2020
<dependency>
2121
<groupId>com.oracle.jdbc</groupId>
22-
<artifactId>ojdbc7</artifactId>
23-
<version>12.1.0.2</version>
22+
<artifactId>ojdbc8</artifactId>
23+
<version>12.2.0.1</version>
2424
<scope>compile</scope>
2525
</dependency>
2626
<dependency>

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public class TestRunner {
1515

1616
privateList<String>pathList =newArrayList<>();
1717
privateList<Reporter>reporterList =newArrayList<>();
18+
privatebooleancolorConsole =false;
1819
privateList<String>coverageSchemes =newArrayList<>();
1920
privateList<String>sourceFiles =newArrayList<>();
2021
privateList<String>testFiles =newArrayList<>();
@@ -36,6 +37,11 @@ public TestRunner addReporter(Reporter reporter) {
3637
returnthis;
3738
}
3839

40+
publicTestRunnercolorConsole(booleancolorConsole) {
41+
this.colorConsole =colorConsole;
42+
returnthis;
43+
}
44+
3945
publicTestRunneraddReporterList(List<Reporter>reporterList) {
4046
this.reporterList.addAll(reporterList);
4147
returnthis;
@@ -87,13 +93,16 @@ public void run(Connection conn) throws SQLException {
8793
ArrayincludeObjectsArray =oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST,this.includeObjects.toArray());
8894
ArrayexcludeObjectsArray =oraConn.createARRAY(CustomTypes.UT_VARCHAR2_LIST,this.excludeObjects.toArray());
8995

96+
// Workaround because Oracle JDBC doesn't support passing boolean to stored procedures.
97+
StringcolorConsoleStr =Boolean.toString(this.colorConsole);
98+
9099
CallableStatementcallableStatement =null;
91100
try {
92101
callableStatement =conn.prepareCall(
93102
"BEGIN " +
94103
"ut_runner.run(" +
95-
"a_paths => ?, a_reporters => ?,a_coverage_schemes =>?," +
96-
"a_source_files => ?, a_test_files => ?, " +
104+
"a_paths => ?, a_reporters => ?,a_color_console =>" +colorConsoleStr +"," +
105+
"a_coverage_schemes => ?,a_source_files => ?, a_test_files => ?, " +
97106
"a_include_objects => ?, a_exclude_objects => ?); " +
98107
"END;");
99108
callableStatement.setArray(1,pathArray);

‎src/main/java/io/github/utplsql/api/reporter/DocumentationReporter.java

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,52 @@
33
importio.github.utplsql.api.CustomTypes;
44

55
importjava.sql.SQLException;
6+
importjava.sql.SQLInput;
7+
importjava.sql.SQLOutput;
68

79
publicclassDocumentationReporterextendsReporter {
810

11+
privateintlvl;
12+
privateintfailed;
13+
14+
publicDocumentationReporter() {
15+
this.lvl =0;
16+
this.failed =0;
17+
}
18+
19+
publicintgetLvl() {
20+
returnlvl;
21+
}
22+
23+
publicvoidsetLvl(intlvl) {
24+
this.lvl =lvl;
25+
}
26+
27+
publicintgetFailed() {
28+
returnfailed;
29+
}
30+
31+
publicvoidsetFailed(intfailed) {
32+
this.failed =failed;
33+
}
34+
935
@Override
1036
publicStringgetSQLTypeName()throwsSQLException {
1137
returnCustomTypes.UT_DOCUMENTATION_REPORTER;
1238
}
1339

40+
@Override
41+
publicvoidreadSQL(SQLInputstream,StringtypeName)throwsSQLException {
42+
super.readSQL(stream,typeName);
43+
setLvl(stream.readInt());
44+
setFailed(stream.readInt());
45+
}
46+
47+
@Override
48+
publicvoidwriteSQL(SQLOutputstream)throwsSQLException {
49+
super.writeSQL(stream);
50+
stream.writeInt(getLvl());
51+
stream.writeInt(getFailed());
52+
}
53+
1454
}

‎src/main/java/io/github/utplsql/api/reporter/Reporter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public abstract class Reporter implements SQLData {
1717
publicReporter() {}
1818

1919
publicReporterinit(Connectionconn)throwsSQLException {
20+
setSelfType(getSQLTypeName());
2021
setStartDate(newjava.sql.Date(Calendar.getInstance().getTimeInMillis()));
2122
setReporterId(DBHelper.newSysGuid(conn));
2223
returnthis;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp