use of org.teiid.net.socket.SocketServerConnection in project teiid by teiid.
the class TestCommSockets method testConnectWithoutPooling.
@Test
public void testConnectWithoutPooling() throws Exception {
Properties p = new Properties();
// $NON-NLS-1$
p.setProperty("org.teiid.sockets.maxCachedInstances", String.valueOf(0));
SocketServerConnection conn = helpEstablishConnection(false, new SSLConfiguration(), p);
SocketListenerStats stats = listener.getStats();
// handshake response, logon,
assertEquals(2, stats.objectsRead);
assertEquals(1, stats.sockets);
conn.close();
stats = listener.getStats();
assertEquals(1, stats.maxSockets);
// handshake response, logon, logoff
assertEquals(3, stats.objectsRead);
if (stats.sockets > 0) {
// there is a timing issue here, since the effect of shutdown on the
// server side can be delayed
Thread.sleep(500);
}
stats = listener.getStats();
assertEquals(0, stats.sockets);
}
use of org.teiid.net.socket.SocketServerConnection in project teiid by teiid.
the class TestCommSockets method testSSLConnectWithNonSSLServer.
@Test
public void testSSLConnectWithNonSSLServer() throws Exception {
// first make a non-ssl connection to ensure that it's not reused
SocketServerConnection conn = helpEstablishConnection(false);
conn.close();
try {
helpEstablishConnection(true);
// $NON-NLS-1$
fail("exception expected");
} catch (CommunicationException e) {
}
}
Aggregations