Package fr.imag.adele.apam.pax.test.msg.device

Examples of fr.imag.adele.apam.pax.test.msg.device.EletronicMsg


    List<EletronicMsg> messages1 = new ArrayList<EletronicMsg>();
    List<EletronicMsg> messages2 = new ArrayList<EletronicMsg>();
    ;

    for (int i = 1; i <= 20; i++) {
      messages1.add(new EletronicMsg(Integer.toString(i)));
    }

    for (int i = 21; i <= 50; i++) {
      messages2.add(new EletronicMsg(Integer.toString(i)));
    }

    List<EletronicMsg> allMessages = new ArrayList<EletronicMsg>();
    allMessages.addAll(messages1);
    allMessages.addAll(messages2);
View Full Code Here


        consumer.getQueue().size() == 3);
    Assert.assertTrue(
        String.format(usecase,
            "but the queue was not injected (the message is different than the one sent)"),
        consumer.getQueue().poll()
            .equals(new EletronicMsg("message 1")));

    // ensure that list and set type are not injected
    Assert.assertTrue(
        String.format(usecase, "the type List received the messages"),
        consumer.getList() == null);
View Full Code Here

    producer3.pushMessage(message1producer3);

    Assert.assertTrue(consumer.getQueue().size() == 3);

    Assert.assertTrue(consumer.getQueue().poll()
        .equals(new EletronicMsg(message1producer1)));
    Assert.assertTrue(consumer.getQueue().poll()
        .equals(new EletronicMsg(message1producer2)));
    Assert.assertTrue(consumer.getQueue().poll()
        .equals(new EletronicMsg(message1producer3)));

  }
View Full Code Here

        "Producer sent %d messages but the consumer received %d",
        POOL_SIZE, m1ConsumerImpl.getQueue().size()), m1ConsumerImpl
        .getQueue().size() == 10);

    for (int x = 0; x < POOL_SIZE; x++) {
      EletronicMsg message = m1ConsumerImpl.getQueue().poll();
      Assert.assertTrue(
          String.format(
              "The producer sent %d messages in ascending order, the consumer should receive in the same order but the message %d arrived in wrong order",
              POOL_SIZE, x), message.equals(new EletronicMsg(
              String.format("message %d", x))));
    }

  }
View Full Code Here

        String.format(
            "After producer sends 1 message, the consumer received %d messages instead of 1",
            m1ConsumerImpl.getQueue().size()), m1ConsumerImpl
            .getQueue().size() == 1);

    EletronicMsg message = m1ConsumerImpl.getQueue().poll();

    Assert.assertTrue(
        String.format("After producer sends 1 message, the consumer received the right number of messages but not the expected message (not the same message sent)"),
        message.equals(new EletronicMsg("message 1")));

  }
View Full Code Here

        String.format(
            "In this use case where the consumer was started before the producer, after producer sends 1 message, the consumer received %d messages instead of 1 ",
            m1ConsumerImpl.getQueue().size()), m1ConsumerImpl
            .getQueue().size() == 1);

    EletronicMsg message = m1ConsumerImpl.getQueue().poll();

    Assert.assertTrue(
        String.format("In this use case where the consumer was started before the producer, after producer sends 1 message, the consumer received the right number of messages but not the expected message (not the same message sent)"),
        message.equals(new EletronicMsg("message 1")));

  }
View Full Code Here

    List<EletronicMsg> messages1 = new ArrayList<EletronicMsg>();
    List<EletronicMsg> messages2 = new ArrayList<EletronicMsg>();
    ;

    for (int i = 1; i <= 20; i++) {
      messages1.add(new EletronicMsg(Integer.toString(i)));
    }

    for (int i = 21; i <= 50; i++) {
      messages2.add(new EletronicMsg(Integer.toString(i)));
    }

    List<EletronicMsg> allMessages = new ArrayList<EletronicMsg>();
    allMessages.addAll(messages1);
    allMessages.addAll(messages2);
View Full Code Here


public class PhilipsProducer {

    public EletronicMsg produceElectronicMsg(String msg){
        return new EletronicMsg(msg);
    }
View Full Code Here


public class GenericProducer {

    public EletronicMsg produceEletronicMsg(String msg){
        return new EletronicMsg(msg);
    }
View Full Code Here

import fr.imag.adele.apam.pax.test.msg.device.EletronicMsg;

public class M1ProducerImpl{
 
  public EletronicMsg pushMessage(String message){
    return new EletronicMsg(message);
  }
View Full Code Here

TOP

Related Classes of fr.imag.adele.apam.pax.test.msg.device.EletronicMsg

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.