Skip to content

Commit d487937

Browse files
committed
Stabilize tests, fix typo in exception message
1 parent 9026fe5 commit d487937

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>com.gvenzl</groupId>
44
<artifactId>oracleperfutils</artifactId>
5-
<version>0.1.4</version>
5+
<version>0.1.5</version>
66
<name>Oracle Performance Utilities</name>
77
<description>A collection of APIs that interface with various Oracle performance tuning features.</description>
88
<build>
@@ -20,8 +20,8 @@
2020
<dependencies>
2121
<dependency>
2222
<groupId>com.oracle</groupId>
23-
<artifactId>ojdbc7</artifactId>
24-
<version>12.1.0.2</version>
23+
<artifactId>ojdbc8</artifactId>
24+
<version>12.2.0.1</version>
2525
</dependency>
2626
<dependency>
2727
<groupId>junit</groupId>

src/main/java/com/gvenzl/info/DatabaseInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class DatabaseInfo {
3333
public DatabaseInfo(Connection conn) throws SQLException {
3434

3535
if (null == conn || conn.isClosed()) {
36-
throw new SQLException ("No connection to the database");
36+
throw new SQLException ("No connection to the database.");
3737
}
3838

3939
PreparedStatement psDBInfo = conn.prepareStatement(

src/test/java/com/gvenzl/info/DatabaseInfoTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import java.sql.Connection;
99
import java.sql.DriverManager;
10+
import java.sql.ResultSet;
1011
import java.sql.SQLException;
1112

1213
import org.junit.Assert;
@@ -62,7 +63,11 @@ public void test_getPlatformName() throws SQLException {
6263
public void test_getVersion() throws SQLException {
6364
System.out.println("test_getVersion()");
6465
DatabaseInfo dbInfo = new DatabaseInfo(conn);
65-
String expected = "Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production";
66+
67+
ResultSet rslt = conn.createStatement().executeQuery("SELECT banner FROM V$VERSION WHERE banner LIKE 'Oracle Database%'");
68+
rslt.next();
69+
String expected = rslt.getString(1);
70+
6671
Assert.assertEquals(expected, dbInfo.getVersion());
6772
}
6873

src/test/java/com/gvenzl/info/connection/ConnectionInfoTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public void test_getDbDomain() throws SQLException {
133133
@Test
134134
public void test_getDbName() throws SQLException {
135135
System.out.println("test_getDbName()");
136-
Assert.assertEquals(CDBNAME, ConnectionInfoFactory.getConnectionInfo(conn).getDbName());
136+
Assert.assertEquals(CONTAINERNAME, ConnectionInfoFactory.getConnectionInfo(conn).getDbName());
137137
}
138138

139139
@Test

0 commit comments

Comments
 (0)