public void testNestedRegistryOperations() throws RegistryException {
// get the realm config to retrieve admin username, password
realmConfig = ctx.getRealmService().getBootstrapRealmConfiguration();
Registry adminRegistry = embeddedRegistryService.getUserRegistry(
realmConfig.getAdminUserName(), realmConfig.getAdminPassword());
RegistryContext registryContext = adminRegistry.getRegistryContext();
MyPrivateHandler myPrivateHandler = new MyPrivateHandler();
HandlerManager handlerManager = registryContext.getHandlerManager();
URLMatcher myPrivateHandlerMatcher = new URLMatcher();
myPrivateHandlerMatcher.setGetPattern(".*/to/my/private/handler");
myPrivateHandlerMatcher.setPutPattern(".*/to/my/private/handler");
handlerManager.addHandler(
new String[] {Filter.GET, Filter.PUT} , myPrivateHandlerMatcher, myPrivateHandler);
Resource r = adminRegistry.newResource();
String originalContent = "original content";
r.setContent(originalContent.getBytes());
adminRegistry.put("/to/my/private/handler", r);
Resource rr = adminRegistry.get("/to/my/private/handler");
byte[] newContent = (byte[])rr.getContent();
String newContentString = new String(newContent);
String expectedString = "<adminRegistry-output><systemRegistry-output>" +