* Enable this test again once its working.
*/
public void disabledtest() throws Exception {
SocketSynchChannelFactory factory = new SocketSynchChannelFactory();
final RequestChannel channel =
new AsynchChannelToClientRequestChannel(
AsynchToSynchChannelAdapter.adapt(
new SubjectCarryingChannel(
new PacketAggregatingAsynchChannel(
SynchToAsynchChannelAdapter.adapt(
factory.openSynchChannel(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();
}
}