SystemServiceManager manager = SystemServiceManager.getInstance(token);
SimpleSystemService service = new SimpleSystemService();
manager.registerService(service);
SystemServiceRequestHandler requestHandler =
new SystemServiceRequestHandler(manager);
Isolate serviceIsolate = Isolate.currentIsolate();
Isolate clientIsolate = new Isolate(
"com.sun.midp.services.SystemServiceIsolate", null);
clientIsolate.start();
IsolateSystemServiceRequestHandler isolateRequestHandler =
requestHandler.newIsolateRequestHandler(clientIsolate);
Link namedPortalLink = Link.newLink(serviceIsolate, clientIsolate);
Link[] clientLinks = { namedPortalLink };
LinkPortal.setLinks(clientIsolate, clientLinks);
NamedLinkPortal.sendLinks(namedPortalLink);
requestHandler.handleIsolateRequests(isolateRequestHandler);
clientIsolate.waitForExit();
manager.shutdown();
assertTrue("Strings match", service.stringsMatch);