server = HornetQServers.newHornetQServer(conf, false);
server.start();
notifQueue = RandomUtil.randomSimpleString();
HornetQSecurityManager securityManager = server.getSecurityManager();
securityManager.addUser("admin", "admin");
securityManager.addUser("guest", "guest");
securityManager.setDefaultUser("guest");
Role role = new Role("notif", true, true, true, true, true, true, true);
Set<Role> roles = new HashSet<Role>();
roles.add(role);
server.getSecurityRepository().addMatch(ConfigurationImpl.DEFAULT_MANAGEMENT_NOTIFICATION_ADDRESS.toString(),
roles);
securityManager.addRole("admin", "notif");
ClientSessionFactory sf = HornetQClient.createClientSessionFactory(new TransportConfiguration(InVMConnectorFactory.class.getName()));
adminSession = sf.createSession("admin", "admin", false, true, true, false, 1);
adminSession.start();