Examples of AmfTrace


Examples of flex.messaging.io.amf.AmfTrace

  return trace;
    }

    private void encodeAMFMessage() {
  try {
      AmfTrace trace = null;
      trace = new AmfTrace();

      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      AmfMessageSerializer amfser = new AmfMessageSerializer();
      amfser.initialize(serialContext, baos, trace);
      amfser.writeMessage(message);
View Full Code Here

Examples of flex.messaging.io.amf.AmfTrace

    }

    private static byte[] encodeAMFMessage(ActionMessage message) {
  byte[] messageBytes = null;
  try {
      AmfTrace trace = null;
      trace = new AmfTrace();

      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      AmfMessageSerializer amfser = new AmfMessageSerializer();
      SerializationContext context = SerializationContext.getSerializationContext();
      context.instantiateTypes = false;
View Full Code Here

Examples of flex.messaging.io.amf.AmfTrace

    SerializationContext dsContext;
    MessageDeserializer deserializer;
    AmfTrace trace;

    public UtilsFlexMessage() {
  trace = new AmfTrace();

  /**
   * CREATE A DESERIALIZER FOR SAMPLE AMF REQUEST
   */
  context = new ActionContext();
View Full Code Here

Examples of flex.messaging.io.amf.AmfTrace

  private void parseAMFMessage() {
    try {
      serialContext = SerializationContext.getSerializationContext();
      serialContext.instantiateTypes = false;

      AmfTrace trace = null;
      if (DEBUG)
        trace = new AmfTrace();

      AmfMessageDeserializer amfder = new AmfMessageDeserializer();
      amfder.initialize(serialContext, new ByteArrayInputStream(
          messageBytes), trace);
View Full Code Here

Examples of flex.messaging.io.amf.AmfTrace

    }
  }

  private void encodeAMFMessage() {
    try {
      AmfTrace trace = null;
      if (DEBUG)
        trace = new AmfTrace();

      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      AmfMessageSerializer amfser = new AmfMessageSerializer();
      amfser.initialize(serialContext, baos, trace);
      amfser.writeMessage(message);
View Full Code Here

Examples of flex.messaging.io.amf.AmfTrace

  }

  private static byte[] encodeAMFMessage(ActionMessage message) {
    byte[] messageBytes = null;
    try {
      AmfTrace trace = null;
      if (DEBUG)
        trace = new AmfTrace();

      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      AmfMessageSerializer amfser = new AmfMessageSerializer();
      SerializationContext context = SerializationContext
          .getSerializationContext();
View Full Code Here

Examples of org.racsor.jmeter.flex.messaging.io.amf.AmfTrace

    /**
     * Test creating an AMF message and then sending it through an AMFEndpoint
     */
    public void testDeserializeMessage() {
  AmfTrace trace = new AmfTrace();
  try {

      /**
       * GENERATE SAMPLE AMF REQUEST FROM DATA FILE
       */

//      File doc = new File(Thread.currentThread().getContextClassLoader().getResource("serialize/collectArcade_1h.binary").getFile());
//      File doc = new File(Thread.currentThread().getContextClassLoader().getResource("serialize/depositBank10000.binary").getFile());
      File doc = new File("C:\\TIC_LOCAL\\EclipseProjects\\OpenSourceRacsor\\cc_request\\jmeter\\bosses_attack.binary");
      byte[] theFile = FileUtils.readFileToByteArray(doc);
      ByteArrayInputStream bais = new ByteArrayInputStream(theFile);
      DataInputStream din = new DataInputStream(bais);

      /**
       * CREATE A DESERIALIZER FOR SAMPLE AMF REQUEST
       */
      ActionMessage message = new ActionMessage();
      trace.startRequest("----------Deserializing AMF/HTTP request-----");

      AmfMessageDeserializer deserializer = new AmfMessageDeserializer();
      deserializer.initialize(din, trace);

      /**
       * RECORD TIME TO DESERIALIZE THE SAMPLE MESSAGE AS OUR TEST
       * METRIC...
       */
      long start = System.currentTimeMillis();

      deserializer.readMessage(message);
     
      long finish = System.currentTimeMillis();
      trace.endMessage();
      long duration = finish - start;

      /**
       * PRINT TRACE OUTPUT
       */
      System.out.print(trace.toString());

      System.out.print("AMF Deserialization Time: " + duration + "ms");

  } catch (Exception e) {
      System.out.println(trace.toString());
      e.printStackTrace();
      fail();
  }
    }
View Full Code Here

Examples of org.racsor.jmeter.flex.messaging.io.amf.AmfTrace

      File dir = new File(doc.getParent());
//      File dir = doc;
      System.out.println(dir.getPath());
      String[] files = dir.list(new SuffixFileFilter(".binary"));
      for (int i = 0; i < files.length; i++) {
    AmfTrace trace = new AmfTrace();
    System.out.println("===================================================");
    System.out.println(files[i]);
    System.out.println(dir.getPath()+File.separatorChar+files[i]);

    byte[] theFile = FileUtils.readFileToByteArray(new File(dir.getPath()+File.separatorChar+files[i]));
    ByteArrayInputStream bais = new ByteArrayInputStream(theFile);
    DataInputStream din = new DataInputStream(bais);

    /**
     * CREATE A DESERIALIZER FOR SAMPLE AMF REQUEST
     */
    ActionMessage message = new ActionMessage();
    trace.startRequest("----------Deserializing AMF/HTTP request-----");

    AmfMessageDeserializer deserializer = new AmfMessageDeserializer();
    deserializer.initialize(din, trace);

    /**
     * RECORD TIME TO DESERIALIZE THE SAMPLE MESSAGE AS OUR TEST
     * METRIC...
     */
    long start = System.currentTimeMillis();

    deserializer.readMessage(message);

    long finish = System.currentTimeMillis();
    trace.endMessage();
    long duration = finish - start;

    /**
     * PRINT TRACE OUTPUT
     */
    System.out.print(trace.toString());

    System.out.print("AMF Deserialization Time: " + duration + "ms");
    System.out.println("===================================================");
      }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.