use of org.apache.activemq.artemis.api.core.ActiveMQConnectionTimedOutException in project activemq-artemis by apache.
the class ConnectionLimitTest method testNettyConnectionLimit.
@Test
public void testNettyConnectionLimit() throws Exception {
ServerLocator locator = createNonHALocator(true).setCallTimeout(3000);
ClientSessionFactory clientSessionFactory = locator.createSessionFactory();
ClientSession clientSession = addClientSession(clientSessionFactory.createSession());
try {
ClientSessionFactory extraClientSessionFactory = locator.createSessionFactory();
ClientSession extraClientSession = addClientSession(extraClientSessionFactory.createSession());
fail("creating a session here should fail");
} catch (Exception e) {
assertTrue(e instanceof ActiveMQConnectionTimedOutException);
}
}
use of org.apache.activemq.artemis.api.core.ActiveMQConnectionTimedOutException in project activemq-artemis by apache.
the class CoreClientOverOneWaySSLTest method testPlainConnectionToSSLEndpoint.
// see https://jira.jboss.org/jira/browse/HORNETQ-234
@Test
public void testPlainConnectionToSSLEndpoint() throws Exception {
createCustomSslServer();
tc.getParams().put(TransportConstants.SSL_ENABLED_PROP_NAME, false);
ServerLocator locator = addServerLocator(ActiveMQClient.createServerLocatorWithoutHA(tc)).setCallTimeout(2000);
try {
createSessionFactory(locator);
fail("expecting exception");
} catch (ActiveMQNotConnectedException se) {
// ok
} catch (ActiveMQConnectionTimedOutException ctoe) {
// ok
} catch (ActiveMQException e) {
fail("Invalid Exception type:" + e.getType());
}
}
Aggregations