Skip to content

Commit fd62bdc

Browse files
committed
Fix test: We can only test new behavior in instances >= 3.1.0
1 parent c8b65ab commit fd62bdc

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/test/java/org/utplsql/api/outputBuffer/OutputBufferProviderIT.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.utplsql.api.AbstractDatabaseTest;
55
import org.utplsql.api.Version;
66
import org.utplsql.api.compatibility.CompatibilityProxy;
7+
import org.utplsql.api.exception.InvalidVersionException;
78
import org.utplsql.api.reporter.CoreReporters;
89
import org.utplsql.api.reporter.Reporter;
910
import 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

Comments
 (0)