use of org.apache.activemq.wireformat.ObjectStreamWireFormat in project activemq-artemis by apache.
the class JDBCConfigTest method testJdbcConfig.
/*
* This tests creating a jdbc persistence adapter using xbeans-spring
*/
@Test
public void testJdbcConfig() throws Exception {
File journalFile = new File(JOURNAL_ROOT + "testJDBCConfig/journal");
recursiveDelete(journalFile);
// Default
File derbyFile = new File(DERBY_ROOT + "testJDBCConfig/derbydb");
recursiveDelete(derbyFile);
BrokerService broker;
broker = createBroker(new FileSystemResource(CONF_ROOT + "jdbc-example.xml"));
try {
assertEquals("Broker Config Error (brokerName)", "brokerJdbcConfigTest", broker.getBrokerName());
PersistenceAdapter adapter = broker.getPersistenceAdapter();
assertTrue("Should have created a jdbc persistence adapter", adapter instanceof JDBCPersistenceAdapter);
assertEquals("JDBC Adapter Config Error (cleanupPeriod)", 60000, ((JDBCPersistenceAdapter) adapter).getCleanupPeriod());
assertTrue("Should have created an EmbeddedDataSource", ((JDBCPersistenceAdapter) adapter).getDataSource() instanceof EmbeddedDataSource);
assertTrue("Should have created a DefaultWireFormat", ((JDBCPersistenceAdapter) adapter).getWireFormat() instanceof ObjectStreamWireFormat);
LOG.info("Success");
} finally {
if (broker != null) {
broker.stop();
}
}
}
use of org.apache.activemq.wireformat.ObjectStreamWireFormat in project activemq-artemis by apache.
the class SslTransportTest method createTransportAndConsume.
private void createTransportAndConsume(boolean wantAuth, boolean needAuth) throws IOException {
JMXPrincipal principal = new JMXPrincipal(certDistinguishedName);
X509Certificate cert = new StubX509Certificate(principal);
StubSSLSession sslSession = new StubSSLSession(cert);
sslSocket = new StubSSLSocket(sslSession);
sslSocket.setWantClientAuth(wantAuth);
sslSocket.setNeedClientAuth(needAuth);
SslTransport transport = new SslTransport(new ObjectStreamWireFormat(), sslSocket);
stubListener = new StubTransportListener();
transport.setTransportListener(stubListener);
ConnectionInfo sentInfo = new ConnectionInfo();
sentInfo.setUserName(username);
sentInfo.setPassword(password);
transport.doConsume(sentInfo);
}
Aggregations