4
4
import org .utplsql .api .AbstractDatabaseTest ;
5
5
import org .utplsql .api .Version ;
6
6
import org .utplsql .api .compatibility .CompatibilityProxy ;
7
+ import org .utplsql .api .exception .InvalidVersionException ;
7
8
import org .utplsql .api .reporter .CoreReporters ;
8
9
import org .utplsql .api .reporter .Reporter ;
9
10
import org .utplsql .api .reporter .ReporterFactory ;
@@ -30,15 +31,19 @@ void testGettingPre310Version() throws SQLException {
30
31
}
31
32
32
33
@ Test
33
- void testGettingActualVersion () throws SQLException {
34
+ void testGettingActualVersion () throws SQLException , InvalidVersionException {
34
35
CompatibilityProxy proxy = new CompatibilityProxy (getConnection (), Version .LATEST );
35
- ReporterFactory reporterFactory = ReporterFactory .createDefault (proxy );
36
36
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 );
39
40
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 ());
41
45
42
- assertThat (buffer , instanceOf (DefaultOutputBuffer .class ));
46
+ assertThat (buffer , instanceOf (DefaultOutputBuffer .class ));
47
+ }
43
48
}
44
49
}
0 commit comments