Package it.polito.appeal.traci.protocol

Examples of it.polito.appeal.traci.protocol.RequestMessage


    }
   
    if(queries.isEmpty())
      return;
   
    RequestMessage reqMsg = new RequestMessage();
    for (Query q : queries) {
      for (Command req : q.getRequests()) {
        reqMsg.append(req);
      }
    }
   
    reqMsg.writeTo(dos);
    ResponseMessage respMsg = new ResponseMessage(dis);
    Iterator<ResponseContainer> responseIterator = respMsg.responses().iterator();
    for (Query q : queries) {
      q.pickResponses(responseIterator);     
    }
View Full Code Here


    new ResponseMessage(dis);
  }

  @Test
  public void testRequestMessage() {
    new RequestMessage();
  }
View Full Code Here

    new RequestMessage();
  }

  @Test
  public void testAppend() {
    RequestMessage m = new RequestMessage();
    Command cmd = new Command(0xAA);
    m.append(cmd);
    assertEquals(cmd, m.commands().iterator().next());
  }
View Full Code Here

    assertEquals(cmd, m.commands().iterator().next());
  }

  @Test
  public void testWriteTo() throws IOException {
    RequestMessage m = new RequestMessage();
    Command cmd = new Command(0xAA);
    m.append(cmd);

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DataOutputStream dos = new DataOutputStream(baos);
    m.writeTo(dos);
   
    byte[] buf = baos.toByteArray();
    assertEquals(10, buf.length);
   
    ByteArrayInputStream bais = new ByteArrayInputStream(buf);
View Full Code Here

    }
  }
 
  @Test
  public void testGetVersionHighLevel() throws IOException {
    RequestMessage reqm = new RequestMessage();
    reqm.append(new Command(Constants.CMD_GETVERSION));
    reqm.writeTo(outStream);
   
    ResponseMessage respm = new ResponseMessage(inStream);
    assertEquals(1, respm.responses().size());
   
    ResponseContainer pair = respm.responses().get(0);
View Full Code Here

    System.out.println(resp.content().readStringASCII());
  }
 
  @Test
  public void testCloseHighLevel() throws IOException {
    RequestMessage reqm = new RequestMessage();
    reqm.append(new Command(Constants.CMD_CLOSE));
    reqm.writeTo(outStream);
   
    ResponseMessage respm = new ResponseMessage(inStream);
    assertEquals(1, respm.responses().size());
   
    ResponseContainer pair = respm.responses().get(0);
View Full Code Here

    new ResponseMessage(dis);
  }

  @Test
  public void testRequestMessage() {
    new RequestMessage();
  }
View Full Code Here

    new RequestMessage();
  }

  @Test
  public void testAppend() {
    RequestMessage m = new RequestMessage();
    Command cmd = new Command(0xAA);
    m.append(cmd);
    assertEquals(cmd, m.commands().iterator().next());
  }
View Full Code Here

    assertEquals(cmd, m.commands().iterator().next());
  }

  @Test
  public void testWriteTo() throws IOException {
    RequestMessage m = new RequestMessage();
    Command cmd = new Command(0xAA);
    m.append(cmd);

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DataOutputStream dos = new DataOutputStream(baos);
    m.writeTo(dos);
   
    byte[] buf = baos.toByteArray();
    assertEquals(10, buf.length);
   
    ByteArrayInputStream bais = new ByteArrayInputStream(buf);
View Full Code Here

    }
  }
 
  @Test
  public void testGetVersionHighLevel() throws IOException {
    RequestMessage reqm = new RequestMessage();
    reqm.append(new Command(Constants.CMD_GETVERSION));
    reqm.writeTo(outStream);
   
    ResponseMessage respm = new ResponseMessage(inStream);
    assertEquals(1, respm.responses().size());
   
    ResponseContainer pair = respm.responses().get(0);
View Full Code Here

TOP

Related Classes of it.polito.appeal.traci.protocol.RequestMessage

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.