Examples of BrokerProperties


Examples of com.microsoft.windowsazure.services.servicebus.implementation.BrokerProperties

    /**
     * Creates an instance of the <code>Message</code> class.
     */
    public BrokeredMessage() {
        this(new BrokerProperties());
    }
View Full Code Here

Examples of com.microsoft.windowsazure.services.servicebus.implementation.BrokerProperties

     * @param body
     *            An <code>InputStream</code> object that represents the body of
     *            the message.
     */
    public BrokeredMessage(InputStream body) {
        this(new BrokerProperties());
        this.body = body;
    }
View Full Code Here

Examples of com.microsoft.windowsazure.services.servicebus.implementation.BrokerProperties

     *
     * @param body
     *            A byte array that represents the body of the message.
     */
    public BrokeredMessage(byte[] body) {
        this(new BrokerProperties());
        this.body = (body == null) ? null : new ByteArrayInputStream(body);
    }
View Full Code Here

Examples of com.microsoft.windowsazure.services.servicebus.implementation.BrokerProperties

     * @param body
     *            A <code>String</code> object that represents the body of the
     *            message.
     */
    public BrokeredMessage(String body) {
        this(new BrokerProperties());
        try {
            this.body = (body == null) ? null : new ByteArrayInputStream(
                    body.getBytes("UTF-8"));
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e);
View Full Code Here

Examples of com.microsoft.windowsazure.services.servicebus.implementation.BrokerProperties

        BrokerPropertiesMapper mapper = new BrokerPropertiesMapper();
        Locale defaultLocale = Locale.getDefault();
        Locale.setDefault(Locale.US);

        // Act
        BrokerProperties brokerProperties = mapper
                .fromString(testBrokerPropertiesString);
        Locale.setDefault(defaultLocale);

        // Assert
        long lockedUntilDelta = brokerProperties.getLockedUntilUtc().getTime()
                - lockedUntilUtc.getTime();
        assertTrue(Math.abs(lockedUntilDelta) < 2000);

    }
View Full Code Here

Examples of com.microsoft.windowsazure.services.servicebus.implementation.BrokerProperties

        BrokerPropertiesMapper mapper = new BrokerPropertiesMapper();
        Locale defaultLocale = Locale.getDefault();
        Locale.setDefault(Locale.CHINA);

        // Act
        BrokerProperties brokerProperties = mapper
                .fromString(testBrokerPropertiesString);
        Locale.setDefault(defaultLocale);

        // Assert
        long lockedUntilDelta = brokerProperties.getLockedUntilUtc().getTime()
                - lockedUntilUtc.getTime();
        assertTrue(Math.abs(lockedUntilDelta) < 2000);
    }
View Full Code Here

Examples of com.microsoft.windowsazure.services.servicebus.implementation.BrokerProperties

    public void jsonStringMapsToBrokerPropertiesObject() {
        // Arrange
        BrokerPropertiesMapper mapper = new BrokerPropertiesMapper();

        // Act
        BrokerProperties properties = mapper
                .fromString("{\"DeliveryCount\":5,\"MessageId\":\"something\"}");

        // Assert
        assertNotNull(properties);
        assertEquals(new Integer(5), properties.getDeliveryCount());
        assertEquals("something", properties.getMessageId());
    }
View Full Code Here

Examples of com.microsoft.windowsazure.services.servicebus.implementation.BrokerProperties

    public void nonDefaultPropertiesMapToJsonString() {
        // Arrange
        BrokerPropertiesMapper mapper = new BrokerPropertiesMapper();

        // Act
        BrokerProperties properties = new BrokerProperties();
        properties.setMessageId("foo");
        properties.setDeliveryCount(7);
        String json = mapper.toString(properties);

        // Assert
        assertNotNull(json);
        assertEquals("{\"DeliveryCount\":7,\"MessageId\":\"foo\"}", json);
View Full Code Here

Examples of com.microsoft.windowsazure.services.servicebus.implementation.BrokerProperties

    public void deserializingAllPossibleValues() {
        // Arrange
        BrokerPropertiesMapper mapper = new BrokerPropertiesMapper();

        // Act
        BrokerProperties properties = mapper
                .fromString(testBrokerPropertiesString);

        // Assert
        assertNotNull(properties);

        long lockedUntilDelta = properties.getLockedUntilUtc().getTime()
                - lockedUntilUtc.getTime();
        long schedTimeDelta = properties.getScheduledEnqueueTimeUtc().getTime()
                - schedTimeUtc.getTime();

        assertEquals("corid", properties.getCorrelationId());
        assertEquals("sesid", properties.getSessionId());
        assertEquals(5, (int) properties.getDeliveryCount());
        assertTrue(Math.abs(lockedUntilDelta) < 2000);
        assertEquals("loctok", properties.getLockToken());
        assertEquals("mesid", properties.getMessageId());
        assertEquals("lab", properties.getLabel());
        assertEquals("repto", properties.getReplyTo());
        assertEquals(7, (long) properties.getSequenceNumber());
        assertEquals(8.123, properties.getTimeToLive(), .001);
        assertEquals("to", properties.getTo());
        assertTrue(Math.abs(schedTimeDelta) < 2000);
        assertEquals("reptosesid", properties.getReplyToSessionId());
        assertEquals("mesloc", properties.getMessageLocation());
        assertEquals("locloc", properties.getLockLocation());
    }
View Full Code Here

Examples of com.microsoft.windowsazure.services.servicebus.implementation.BrokerProperties

    public void missingDatesDeserializeAsNull() {
        // Arrange
        BrokerPropertiesMapper mapper = new BrokerPropertiesMapper();

        // Act
        BrokerProperties properties = mapper.fromString("{}");

        // Assert
        assertNull(properties.getLockedUntilUtc());
        assertNull(properties.getScheduledEnqueueTimeUtc());
    }
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.