BindRequest { public void accept(String systemId) throws PDUStringException, IllegalStateException, IOException { accept(systemId, null); } BindRequest(int sequenceNumber, BindType bindType, String systemId, String password, 
            String systemType, TypeOfNumber addrTon, NumberingPlanIndicator addrNpi, 
            String addressRange, InterfaceVersion interfaceVersion, ServerResponseHandler responseHandler);  BindRequest(Bind bind, ServerResponseHandler responseHandler); @Deprecated BindParameter getBindParameter(); BindType getBindType(); String getSystemId(); String getPassword(); String getSystemType(); TypeOfNumber getAddrTon(); NumberingPlanIndicator getAddrNpi(); String getAddressRange(); InterfaceVersion getInterfaceVersion(); void accept(String systemId); void accept(String systemId, InterfaceVersion interfaceVersion); void reject(int errorCode);  }
@Test(groups="checkintest") public void testSucceedAccept() { try { bindRequest.accept("sys"); } catch (PDUStringException e) { fail("Should succes accepting bind request"); } catch (IllegalStateException e1) { fail("Should succes accepting bind request"); } catch (IOException e1) { fail("Should succes accepting bind request"); } }
@Test(groups="checkintest") public void testFailedAccept() { responseHandler.closeConnection(); try { bindRequest.accept("sys"); fail("Should throw IOException"); } catch (PDUStringException e) { fail("Should throw IOException"); } catch (IllegalStateException e) { fail("Should throw IOException"); } catch (IOException e) { } }
@Test(groups="checkintest") public void testNonSingleAccept() { try { bindRequest.accept("sys"); } catch (PDUStringException e) { fail("Should success accepting bind request"); } catch (IllegalStateException e1) { fail("Should success accepting bind request"); } catch (IOException e1) { fail("Should success accepting bind request"); } try { bindRequest.accept("sys"); fail("Should fail on 2nd accept"); } catch (PDUStringException e) { fail("Should throw IllegalStateException"); } catch (IllegalStateException e) { } catch (IOException e) { fail("Should throw IllegalStateException"); } }