44import org .utplsql .api .AbstractDatabaseTest ;
55import org .utplsql .api .Version ;
66import org .utplsql .api .compatibility .CompatibilityProxy ;
7+ import org .utplsql .api .exception .InvalidVersionException ;
78import org .utplsql .api .reporter .CoreReporters ;
89import org .utplsql .api .reporter .Reporter ;
910import org .utplsql .api .reporter .ReporterFactory ;
@@ -30,15 +31,19 @@ void testGettingPre310Version() throws SQLException {
3031 }
3132
3233 @ Test
33- void testGettingActualVersion () throws SQLException {
34+ void testGettingActualVersion () throws SQLException , InvalidVersionException {
3435 CompatibilityProxy proxy = new CompatibilityProxy (getConnection (), Version .LATEST );
35- ReporterFactory reporterFactory = ReporterFactory .createDefault (proxy );
3636
37- Reporter r = reporterFactory .createReporter (CoreReporters .UT_DOCUMENTATION_REPORTER .name ());
38- r .init (getConnection (), proxy , reporterFactory );
37+ // We can only test new behaviour with DB-Version >= 3.1.0
38+ if ( proxy .getRealDbPlsqlVersion ().isGreaterOrEqualThan (Version .V3_1_0 )) {
39+ ReporterFactory reporterFactory = ReporterFactory .createDefault (proxy );
3940
40- OutputBuffer buffer = proxy .getOutputBuffer (r , getConnection ());
41+ Reporter r = reporterFactory .createReporter (CoreReporters .UT_DOCUMENTATION_REPORTER .name ());
42+ r .init (getConnection (), proxy , reporterFactory );
43+
44+ OutputBuffer buffer = proxy .getOutputBuffer (r , getConnection ());
4145
42- assertThat (buffer , instanceOf (DefaultOutputBuffer .class ));
46+ assertThat (buffer , instanceOf (DefaultOutputBuffer .class ));
47+ }
4348 }
4449}
0 commit comments