Package com.rabbitmq.client.AMQP

Examples of com.rabbitmq.client.AMQP.BasicProperties


  @Test
  @SuppressWarnings("unchecked")
  public void testToMessagePropertiesLongStringDeepInList() {
    Map<String, Object> headers = new HashMap<String, Object>();
    headers.put("list", Arrays.asList(Arrays.asList(longString)));
    BasicProperties source = new BasicProperties.Builder()
        .headers(headers)
        .build();
    MessageProperties messageProperties = messagePropertiesConverter.toMessageProperties(source, envelope, "UTF-8");
    assertEquals("LongString deeply nested in List not converted to String",
        longStringString, ((List<?>) ((List<?>) messageProperties.getHeaders().get("list")).get(0)).get(0));
View Full Code Here


  public void testToMessagePropertiesLongStringInMap() {
    Map<String, Object> mapWithLongString = new HashMap<String, Object>();
    mapWithLongString.put("longString", longString);
    Map<String, Object> headers = new HashMap<String, Object>();
    headers.put("map", mapWithLongString);
    BasicProperties source = new BasicProperties.Builder()
        .headers(headers)
        .build();
    MessageProperties messageProperties = messagePropertiesConverter.toMessageProperties(source, envelope, "UTF-8");
    assertEquals("LongString nested in Map not converted to String",
        longStringString, ((Map<String, Object>) messageProperties.getHeaders().get("map")).get("longString"));
View Full Code Here

  @Test
  public void testFromUnsupportedValue() {
    MessageProperties messageProperties = new MessageProperties();
    messageProperties.setHeader("unsupported", new Object());
    BasicProperties basicProps = messagePropertiesConverter.fromMessageProperties(messageProperties, "UTF-8");
    assertTrue("Unsupported value not converted to String",
        basicProps.getHeaders().get("unsupported") instanceof String);
  }
View Full Code Here

  @Test
  public void testFromUnsupportedValueInList() {
    MessageProperties messageProperties = new MessageProperties();
    List<Object> listWithUnsupportedValue = Arrays.asList(new Object());
    messageProperties.setHeader("list", listWithUnsupportedValue);
    BasicProperties basicProps = messagePropertiesConverter.fromMessageProperties(messageProperties, "UTF-8");
    assertTrue("Unsupported value nested in List not converted to String",
        ((List<?>) basicProps.getHeaders().get("list")).get(0) instanceof String);
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public void testFromUnsupportedValueDeepInList() {
    MessageProperties messageProperties = new MessageProperties();
    List<List<Object>> listWithUnsupportedValue = Arrays.asList(Arrays.asList(new Object()));
    messageProperties.setHeader("list", listWithUnsupportedValue);
    BasicProperties basicProps = messagePropertiesConverter.fromMessageProperties(messageProperties, "UTF-8");
    assertTrue("Unsupported value deeply nested in List not converted to String",
        ((List<Object>) ((List<?>) basicProps.getHeaders().get("list")).get(0)).get(0) instanceof String);
  }
View Full Code Here

  public void testFromUnsupportedValueInMap() {
    MessageProperties messageProperties = new MessageProperties();
    Map<String, Object> mapWithUnsupportedValue = new HashMap<String, Object>();
    mapWithUnsupportedValue.put("unsupported", new Object());
    messageProperties.setHeader("map", mapWithUnsupportedValue);
    BasicProperties basicProps = messagePropertiesConverter.fromMessageProperties(messageProperties, "UTF-8");
    assertTrue("Unsupported value nested in Map not converted to String",
        ((Map<String, Object>) basicProps.getHeaders().get("map")).get("unsupported") instanceof String);
  }
View Full Code Here

    container.setShutdownTimeout(100);
    container.setTransactionManager(new DummyTxManager());
    container.afterPropertiesSet();
    container.start();

    consumer.get().handleDelivery("qux", new Envelope(1, false, "foo", "bar"), new BasicProperties(), new byte[] {0});

    assertTrue(latch.await(10, TimeUnit.SECONDS));

    Exception e = tooManyChannels.get();
    if (e != null) {
View Full Code Here

    container.setShutdownTimeout(100);
    container.setTransactionManager(new DummyTxManager());
    container.afterPropertiesSet();
    container.start();

    consumer.get().handleDelivery("qux", new Envelope(1, false, "foo", "bar"), new BasicProperties(), new byte[] {0});

    assertTrue(latch.await(10, TimeUnit.SECONDS));

    Exception e = tooManyChannels.get();
    if (e != null) {
View Full Code Here

    container.setShutdownTimeout(100);
    container.setTransactionManager(new DummyTxManager());
    container.afterPropertiesSet();
    container.start();

    consumer.get().handleDelivery("qux", new Envelope(1, false, "foo", "bar"), new BasicProperties(), new byte[] {0});

    assertTrue(latch.await(10, TimeUnit.SECONDS));

    Exception e = tooManyChannels.get();
    if (e != null) {
View Full Code Here

    container.setShutdownTimeout(100);
    container.setTransactionManager(new DummyTxManager());
    container.afterPropertiesSet();
    container.start();

    consumer.get().handleDelivery("qux", new Envelope(1, false, "foo", "bar"), new BasicProperties(), new byte[] {0});

    assertTrue(latch.await(10, TimeUnit.SECONDS));

    Exception e = tooManyChannels.get();
    if (e != null) {
View Full Code Here

TOP

Related Classes of com.rabbitmq.client.AMQP.BasicProperties

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.