use of com.unboundid.ldap.sdk.IntermediateResponse in project ldapsdk by pingidentity.
the class CollectSupportDataIRListenerTestCase method testOtherResponse.
/**
* Tests the behavior for some other type of intermediate response.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testOtherResponse() throws Exception {
final ByteArrayOutputStream out = new ByteArrayOutputStream();
final ByteArrayOutputStream err = new ByteArrayOutputStream();
final CollectSupportData tool = new CollectSupportData(out, err);
final File outputFile = createTempFile();
assertTrue(outputFile.delete());
final CollectSupportDataIRListener listener = new CollectSupportDataIRListener(tool, outputFile);
listener.handleOtherIntermediateResponse(new IntermediateResponse("1.2.3.4", new ASN1OctetString("foo")));
assertEquals(out.size(), 0);
assertTrue(err.size() > 0);
assertFalse(outputFile.exists());
assertNull(listener.getOutputStreamReference().get());
assertNull(listener.getFirstIOExceptionReference().get());
err.reset();
assertEquals(out.size(), 0);
listener.close();
assertEquals(out.size(), 0);
assertEquals(err.size(), 0);
assertFalse(outputFile.exists());
assertNull(listener.getOutputStreamReference().get());
assertNull(listener.getFirstIOExceptionReference().get());
}
Aggregations