@Test
  public void testCreateCF() throws Exception {
    JMSServerControl control = createJMSControl();
    control.createConnectionFactory("test", false, false, 0, "invm", "test");

    ConnectionFactoryControl controlCF = createCFControl("test");

    HornetQConnectionFactory cf = (HornetQConnectionFactory) ctx.lookup("test");

    assertFalse(cf.isCompressLargeMessage());

    controlCF.setCompressLargeMessages(true);

    cf = (HornetQConnectionFactory) ctx.lookup("test");
    assertTrue(cf.isCompressLargeMessage());

    stopServer();

    Thread.sleep(500);

    startServer();

    cf = (HornetQConnectionFactory) ctx.lookup("test");
    assertTrue(cf.isCompressLargeMessage());
  }
  @Test
  public void testCreateDurableQueueUsingJMXAndRestartServer() throws Exception {
    String queueName = RandomUtil.randomString();
    String binding = RandomUtil.randomString();

    UnitTestCase.checkNoBinding(context, binding);
    checkNoResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));

    JMSServerControl control = ManagementControlHelper.createJMSServerControl(mbeanServer);
    control.createQueue(queueName, binding);

    Object o = UnitTestCase.checkBinding(context, binding);
    Assert.assertTrue(o instanceof Queue);
    Queue queue = (Queue) o;
    assertEquals(queueName, queue.getQueueName());
    checkResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));

    serverManager.stop();

    checkNoBinding(context, binding);
    checkNoResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));

    serverManager = createJMSServer();
    serverManager.start();

    o = UnitTestCase.checkBinding(context, binding);
    Assert.assertTrue(o instanceof Queue);
    queue = (Queue) o;
    assertEquals(queueName, queue.getQueueName());
    checkResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName));
  }