public static void createAndStartBroker() throws Exception {
  broker=new BrokerService();
  broker.setPersistent(false);
  broker.setUseShutdownHook(false);
  broker.setUseJmx(false);
  broker.start();
  c=new ActiveMQConnectionFactory();
  c.setObjectMessageSerializationDefered(true);
  c.setBrokerURL("vm://localhost");
  c.setCopyMessageOnSend(false);
  System.setProperty("c2mon.client.jms.url","vm://localhost");
  System.setProperty("c2mon.client.jms.user","");
  System.setProperty("c2mon.client.jms.password","");
}

public static void createAndStartBroker ( ) throws Exception { broker = new BrokerService ( ) ; broker . setPersistent ( false ) ; broker . setUseShutdownHook ( false ) ; broker . setUseJmx ( false ) ; broker . start ( ) ; c = new ActiveMQConnectionFactory ( ) ; c . setObjectMessageSerializationDefered ( true ) ; c . setBrokerURL ( "vm://localhost" ) ; c . setCopyMessageOnSend ( false ) ; System . setProperty ( "c2mon.client.jms.url" , "vm://localhost" ) ; System . setProperty ( "c2mon.client.jms.user" , "" ) ; System . setProperty ( "c2mon.client.jms.password" , "" ) ; }
creates and starts the broker . also sets the following system properties for use in tests : jms . broker . url jms . client . user jms . client . password
