*/
public void disabledtest() throws Exception {
SocketSyncChannelFactory factory = new SocketSyncChannelFactory();
final RequestChannel channel =
new AsyncChannelToClientRequestChannel(
AsyncToSyncChannel.adapt(
new SubjectCarryingChannel(
new PacketAggregatingAsyncChannel(
SyncToAsyncChannel.adapt(
factory.openSyncChannel(serverURI))))));
try {
channel.start();
Subject.doAs(clientSubject, new PrivilegedExceptionAction() {
public Object run() throws Exception {
Subject subject = Subject.getSubject(AccessController.getContext());
String p = subject.getPrincipals().iterator().next().toString();
log.info("Sending request as: "+p);
Packet request = new ByteArrayPacket("whoami".getBytes());
Packet response = channel.request(request, 1000*5*1000);
assertNotNull(response);
assertEquals( p, new String(response.sliceAsBytes()) );
return null;
}
});
} finally {
channel.dispose();
}
}