use of org.teiid.net.ServerConnection in project teiid by teiid.
the class TestMMDatabaseMetaData method testDatabaseVersions.
@Test
public void testDatabaseVersions() throws Exception {
ConnectionImpl impl = Mockito.mock(ConnectionImpl.class);
Mockito.stub(impl.getConnectionProps()).toReturn(new Properties());
ServerConnection sconn = Mockito.mock(ServerConnection.class);
Mockito.stub(sconn.getServerVersion()).toReturn("01.02.03-something");
Mockito.stub(impl.getServerConnection()).toReturn(sconn);
DatabaseMetaDataImpl metadata = new DatabaseMetaDataImpl(impl);
assertEquals(1, metadata.getDatabaseMajorVersion());
assertEquals(2, metadata.getDatabaseMinorVersion());
}
Aggregations