Skip to content

Commit c8b65ab

Browse files
committed
OutputBufferProvider-Test
This needs refactoring - it's far too complex and complicated
1 parent 90bc54f commit c8b65ab

File tree

2 files changed

+44
-12
lines changed

2 files changed

+44
-12
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package org.utplsql.api.outputBuffer;
2+
3+
import org.junit.jupiter.api.Test;
4+
import org.utplsql.api.AbstractDatabaseTest;
5+
import org.utplsql.api.Version;
6+
import org.utplsql.api.compatibility.CompatibilityProxy;
7+
import org.utplsql.api.reporter.CoreReporters;
8+
import org.utplsql.api.reporter.Reporter;
9+
import org.utplsql.api.reporter.ReporterFactory;
10+
11+
import java.sql.SQLException;
12+
13+
import static org.hamcrest.MatcherAssert.assertThat;
14+
import static org.hamcrest.core.IsInstanceOf.instanceOf;
15+
16+
public class OutputBufferProviderIT extends AbstractDatabaseTest {
17+
18+
@Test
19+
void testGettingPre310Version() throws SQLException {
20+
21+
CompatibilityProxy proxy = new CompatibilityProxy(getConnection(), Version.V3_0_4);
22+
ReporterFactory reporterFactory = ReporterFactory.createDefault(proxy);
23+
24+
Reporter r = reporterFactory.createReporter(CoreReporters.UT_DOCUMENTATION_REPORTER.name());
25+
r.init(getConnection(), proxy, reporterFactory);
26+
27+
OutputBuffer buffer = proxy.getOutputBuffer(r, getConnection());
28+
29+
assertThat(buffer, instanceOf(CompatibilityOutputBufferPre310.class));
30+
}
31+
32+
@Test
33+
void testGettingActualVersion() throws SQLException {
34+
CompatibilityProxy proxy = new CompatibilityProxy(getConnection(), Version.LATEST);
35+
ReporterFactory reporterFactory = ReporterFactory.createDefault(proxy);
36+
37+
Reporter r = reporterFactory.createReporter(CoreReporters.UT_DOCUMENTATION_REPORTER.name());
38+
r.init(getConnection(), proxy, reporterFactory);
39+
40+
OutputBuffer buffer = proxy.getOutputBuffer(r, getConnection());
41+
42+
assertThat(buffer, instanceOf(DefaultOutputBuffer.class));
43+
}
44+
}

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

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)