Package fpdu

Examples of fpdu.FPDUParameter


  }
 
  @Test
  public void testFPDUReception() {
    ConnectionWS cws = new ConnectionWS();
    FPDUParameter parameter = new FPDUParameter("Bob", "Local");
    parameter.setLocalConnectionId(1);
    FPDU fpdu = new FPDU(EnumFPDU.CONNECT, parameter);
   
    // Case 1
    System.out.println("testFPDUReception : Case 1/6");
    OutputConnectionWS ocws;
    try {
      ocws = cws.FPDUReception(fpdu);
      assertEquals(EnumFPDU.ACONNECT, ocws.getFpdu().getType())
      assertEquals("Bob", ocws.getFpdu().getParameter().getReceiver());
      assertEquals("Local", ocws.getFpdu().getParameter().getSender());
    } catch (Exception e) {
      fail("testFPDUReception : No exception " +
      "should have been raised");
    }
   
    // Case 2
    System.out.println("testFPDUReception : Case 2/6");
    try {
      ocws = cws.FPDUReception(fpdu);
      fail("testFPDUReception : ConnectionException " +
      "should have been raised");
    } catch (ConnectionException e) {
    } catch (Exception e) {
      e.printStackTrace();
    }
   
    // Case 3
    System.out.println("testFPDUReception : Case 3/6");
    parameter = new FPDUParameter("Alice", "Local");
    fpdu = new FPDU(EnumFPDU.ACONNECT, parameter);
    try {
      ocws = cws.FPDUReception(fpdu);
      fail("testFPDUReception : WrongFPDUException " +
      "should have been raised");
View Full Code Here


   * Expected return:
   * *Date* Sent: FPDU CONNECT   to Bob.
   *     We ask Bob for a connection. Waiting for ACONNECT.
   */
  public void testLogLocalNominalConnect() {
    FPDUParameter param = new FPDUParameter("Alice", "Bob");

    FPDU fpdu = new FPDU(param);
    fpdu.setType(EnumFPDU.CONNECT);
   
    String result = PeSITLog.logLocal(fpdu);
View Full Code Here

   * Expected return:
   * *Date* Sent: FPDU RELEASE   to Bob.
   *     We will close the connection with Bob. Waiting for RELCONF.
   */
  public void testLogLocalNominalRelease() {
    FPDUParameter param = new FPDUParameter("Alice", "Bob");

    FPDU fpdu = new FPDU(param);
    fpdu.setType(EnumFPDU.RELEASE);
   
    String result = PeSITLog.logLocal(fpdu);
View Full Code Here

   * Test of logLocal with the case of a correct RELCONF FPDU
   * Expected return:
   * *Date* Sent: FPDU RELCONF   to Bob. We are now disconnected.
   */
  public void testLogLocalNominalRelconf() {
    FPDUParameter param = new FPDUParameter("Alice", "Bob");

    FPDU fpdu = new FPDU(param);
    fpdu.setType(EnumFPDU.RELCONF);
   
    String result = PeSITLog.logLocal(fpdu);
View Full Code Here

   * Test of logLocal with the case of a correct DTF FPDU
   * Expected return:
   * *Date* Sent: FPDU DTF   to Bob. Sending data to Bob.
   */
  public void testLogLocalNominalDTF() {
    FPDUParameter param = new FPDUParameter("Alice", "Bob");

    FPDU fpdu = new FPDU(param);
    fpdu.setType(EnumFPDU.DTF);
   
    String result = PeSITLog.logLocal(fpdu);
View Full Code Here

   * Expected return: Error null FPDU
   * This test doesn't pass because when we create a FPDU without telling
   * its type, the type is DTF (0).
   */
  public void testLogLocalNullType() {
    FPDUParameter param = new FPDUParameter("Alice", "Bob");

    FPDU fpdu = new FPDU();
    fpdu.setParameter(param);
   
    System.out.println("\n\n\n!!!!! " + fpdu.getType() + " !!!!!\n\n\n");
View Full Code Here

   * Test of logRemote with a correct CONNECT FPDU
   * Expected return:
   * *Date* Received: FPDU CONNECT   from Bob. Bob wants to connect.
   */
  public void testLogRemoteNominalConnect() {
    FPDUParameter param = new FPDUParameter("Bob", "Alice");

    FPDU fpdu = new FPDU(param);
    fpdu.setType(EnumFPDU.CONNECT);
   
    String result = PeSITLog.logRemote(fpdu);
View Full Code Here

   * Expected return:
   * *Date* Received: FPDU ACONNECT   from Bob.
   *     Connection accepted. We are now connected to Bob.
   */
  public void testLogRemoteNominalAConnect() {
    FPDUParameter param = new FPDUParameter("Bob", "Alice");

    FPDU fpdu = new FPDU(param);
    fpdu.setType(EnumFPDU.ACONNECT);
   
    String result = PeSITLog.logRemote(fpdu);
View Full Code Here

   * Test of logRemote with a correct RCONNECT FPDU
   * Expected return:
   * *Date* Received: FPDU RCONNECT   from Bob. Connection refused.
   */
  public void testLogRemoteNominalRConnect() {
    FPDUParameter param = new FPDUParameter("Bob", "Alice");

    FPDU fpdu = new FPDU(param);
    fpdu.setType(EnumFPDU.RCONNECT);
   
    String result = PeSITLog.logRemote(fpdu);
View Full Code Here

   * Test of logRemote with a correct READ FPDU
   * Expected return:
   * *Date* Received: FPDU READ   from Bob. File reading request from Bob.
   */
  public void testLogRemoteNominalRead() {
    FPDUParameter param = new FPDUParameter("Bob", "Alice");

    FPDU fpdu = new FPDU(param);
    fpdu.setType(EnumFPDU.READ);
   
    String result = PeSITLog.logRemote(fpdu);
View Full Code Here

TOP

Related Classes of fpdu.FPDUParameter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.