-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathOutputBufferProviderIT.java
More file actions
49 lines (35 loc) · 1.89 KB
/
OutputBufferProviderIT.java
File metadata and controls
49 lines (35 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package org.utplsql.api.outputBuffer;
import org.junit.jupiter.api.Test;
import org.utplsql.api.AbstractDatabaseTest;
import org.utplsql.api.Version;
import org.utplsql.api.compatibility.CompatibilityProxy;
import org.utplsql.api.exception.InvalidVersionException;
import org.utplsql.api.reporter.CoreReporters;
import org.utplsql.api.reporter.Reporter;
import org.utplsql.api.reporter.ReporterFactory;
import java.sql.SQLException;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
public class OutputBufferProviderIT extends AbstractDatabaseTest {
@Test
void testGettingPre310Version() throws SQLException {
CompatibilityProxy proxy = new CompatibilityProxy(getConnection(), Version.V3_0_4);
ReporterFactory reporterFactory = ReporterFactory.createDefault(proxy);
Reporter r = reporterFactory.createReporter(CoreReporters.UT_DOCUMENTATION_REPORTER.name());
r.init(getConnection(), proxy, reporterFactory);
OutputBuffer buffer = proxy.getOutputBuffer(r, getConnection());
assertThat(buffer, instanceOf(CompatibilityOutputBufferPre310.class));
}
@Test
void testGettingActualVersion() throws SQLException, InvalidVersionException {
CompatibilityProxy proxy = new CompatibilityProxy(getConnection(), Version.LATEST);
// We can only test new behaviour with DB-Version >= 3.1.0
if ( proxy.getRealDbPlsqlVersion().isGreaterOrEqualThan(Version.V3_1_0)) {
ReporterFactory reporterFactory = ReporterFactory.createDefault(proxy);
Reporter r = reporterFactory.createReporter(CoreReporters.UT_DOCUMENTATION_REPORTER.name());
r.init(getConnection(), proxy, reporterFactory);
OutputBuffer buffer = proxy.getOutputBuffer(r, getConnection());
assertThat(buffer, instanceOf(DefaultOutputBuffer.class));
}
}
}