Search in sources :

Example 1 with XmlBrokerFactoryHandler

use of org.apache.activemq.artemis.cli.factory.xml.XmlBrokerFactoryHandler in project activemq-artemis by apache.

the class WebServerComponentTest method testMaskPasswords.

@Test
public void testMaskPasswords() throws Exception {
    final String keyPassword = "keypass";
    final String trustPassword = "trustpass";
    File bootstrap = new File("./target/test-classes/bootstrap_secure_web.xml");
    File brokerHome = new File("./target");
    XmlBrokerFactoryHandler xmlHandler = new XmlBrokerFactoryHandler();
    BrokerDTO broker = xmlHandler.createBroker(bootstrap.toURI(), brokerHome.getAbsolutePath(), brokerHome.getAbsolutePath(), brokerHome.toURI());
    assertNotNull(broker.web);
    assertEquals(keyPassword, broker.web.getKeyStorePassword());
    assertEquals(trustPassword, broker.web.getTrustStorePassword());
}
Also used : XmlBrokerFactoryHandler(org.apache.activemq.artemis.cli.factory.xml.XmlBrokerFactoryHandler) File(java.io.File) BrokerDTO(org.apache.activemq.artemis.dto.BrokerDTO) Test(org.junit.Test)

Example 2 with XmlBrokerFactoryHandler

use of org.apache.activemq.artemis.cli.factory.xml.XmlBrokerFactoryHandler in project activemq-artemis by apache.

the class WebServerComponentTest method testDefaultMaskPasswords.

@Test
public void testDefaultMaskPasswords() throws Exception {
    File bootstrap = new File("./target/test-classes/bootstrap_web.xml");
    File brokerHome = new File("./target");
    XmlBrokerFactoryHandler xmlHandler = new XmlBrokerFactoryHandler();
    BrokerDTO broker = xmlHandler.createBroker(bootstrap.toURI(), brokerHome.getAbsolutePath(), brokerHome.getAbsolutePath(), brokerHome.toURI());
    assertNotNull(broker.web);
    assertNull(broker.web.passwordCodec);
}
Also used : XmlBrokerFactoryHandler(org.apache.activemq.artemis.cli.factory.xml.XmlBrokerFactoryHandler) File(java.io.File) BrokerDTO(org.apache.activemq.artemis.dto.BrokerDTO) Test(org.junit.Test)

Example 3 with XmlBrokerFactoryHandler

use of org.apache.activemq.artemis.cli.factory.xml.XmlBrokerFactoryHandler in project activemq-artemis by apache.

the class WebServerComponentTest method testMaskPasswordCodec.

@Test
public void testMaskPasswordCodec() throws Exception {
    final String keyPassword = "keypass";
    final String trustPassword = "trustpass";
    File bootstrap = new File("./target/test-classes/bootstrap_web_codec.xml");
    File brokerHome = new File("./target");
    XmlBrokerFactoryHandler xmlHandler = new XmlBrokerFactoryHandler();
    BrokerDTO broker = xmlHandler.createBroker(bootstrap.toURI(), brokerHome.getAbsolutePath(), brokerHome.getAbsolutePath(), brokerHome.toURI());
    assertNotNull(broker.web);
    assertNotNull("password codec not picked up!", broker.web.passwordCodec);
    assertEquals(keyPassword, broker.web.getKeyStorePassword());
    assertEquals(trustPassword, broker.web.getTrustStorePassword());
}
Also used : XmlBrokerFactoryHandler(org.apache.activemq.artemis.cli.factory.xml.XmlBrokerFactoryHandler) File(java.io.File) BrokerDTO(org.apache.activemq.artemis.dto.BrokerDTO) Test(org.junit.Test)

Aggregations

File (java.io.File)3 XmlBrokerFactoryHandler (org.apache.activemq.artemis.cli.factory.xml.XmlBrokerFactoryHandler)3 BrokerDTO (org.apache.activemq.artemis.dto.BrokerDTO)3 Test (org.junit.Test)3