-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCompatibilityTest.java
More file actions
44 lines (38 loc) · 1.25 KB
/
CompatibilityTest.java
File metadata and controls
44 lines (38 loc) · 1.25 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
package org.utplsql.api;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.utplsql.api.compatibility.CompatibilityProxy;
import org.utplsql.api.rules.DatabaseRule;
import java.sql.Connection;
import java.sql.SQLException;
public class CompatibilityTest {
@Rule
public final DatabaseRule db = new DatabaseRule();
@Test
public void compatibleVersion() {
try {
Connection conn = db.newConnection();
CompatibilityProxy proxy = new CompatibilityProxy(conn);
proxy.failOnNotCompatible();
Assert.assertEquals(true, proxy.isCompatible());
} catch (SQLException e) {
e.printStackTrace();
Assert.fail();
}
}
@Test
public void skipCompatibilityCheck()
{
try {
Connection conn = db.newConnection();
CompatibilityProxy proxy = new CompatibilityProxy(conn, true);
proxy.failOnNotCompatible();
Assert.assertEquals(true, proxy.isCompatible());
Assert.assertEquals(CompatibilityProxy.UTPLSQL_API_VERSION, proxy.getDatabaseVersion().toString());
} catch (SQLException e) {
e.printStackTrace();
Assert.fail();
}
}
}