@Test public void testCopy() throws Exception { this.jmsMessageID = "testid"; this.jmsCorrelationID = "testcorrelationid"; this.jmsDestination = new JmsTopic("test.topic"); this.jmsReplyTo = new JmsTopic("test.replyto.topic:001"); this.jmsDeliveryMode = Message.DEFAULT_DELIVERY_MODE; this.jmsRedelivered = true; this.jmsType = "test type"; this.jmsExpiration = 100000; this.jmsPriority = 5; this.jmsTimestamp = System.currentTimeMillis(); JmsConnection connection = Mockito.mock(JmsConnection.class); JmsMessage msg1 = factory.createMessage(); msg1.setJMSMessageID(this.jmsMessageID); msg1.setJMSCorrelationID(this.jmsCorrelationID); msg1.setJMSDestination(this.jmsDestination); msg1.setJMSReplyTo(this.jmsReplyTo); msg1.setJMSDeliveryMode(this.jmsDeliveryMode); msg1.setJMSRedelivered(this.jmsRedelivered); msg1.setJMSType(this.jmsType); msg1.setJMSExpiration(this.jmsExpiration); msg1.setJMSPriority(this.jmsPriority); msg1.setJMSTimestamp(this.jmsTimestamp); msg1.setReadOnlyProperties(true); msg1.setConnection(connection); boolean isValidate = !msg1.isValidatePropertyNames(); msg1.setValidatePropertyNames(isValidate); JmsMessage msg2 = msg1.copy(); assertEquals(msg1.getJMSMessageID(), msg2.getJMSMessageID()); assertTrue(msg2.isReadOnlyProperties()); assertTrue(msg1.getJMSCorrelationID().equals(msg2.getJMSCorrelationID())); assertTrue(msg1.getJMSDestination().equals(msg2.getJMSDestination())); assertTrue(msg1.getJMSReplyTo().equals(msg2.getJMSReplyTo())); assertEquals(msg1.getJMSDeliveryMode(), msg2.getJMSDeliveryMode()); assertEquals(msg1.getJMSRedelivered(), msg2.getJMSRedelivered()); assertEquals(msg1.getJMSType(), msg2.getJMSType()); assertEquals(msg1.getJMSExpiration(), msg2.getJMSExpiration()); assertEquals(msg1.getJMSPriority(), msg2.getJMSPriority()); assertEquals(msg1.getJMSTimestamp(), msg2.getJMSTimestamp()); assertEquals(msg1.getConnection(), msg2.getConnection()); assertEquals(msg1.isValidatePropertyNames(), msg2.isValidatePropertyNames()); LOG.info("Message is: " + msg1); }
public JmsMessage copy() throws JMSException { JmsMessage other = new JmsMessage(facade.copy()); other.copy(this); return other; }
JmsMessage implements javax.jms.Message { public JmsMessage copy() throws JMSException { JmsMessage other = new JmsMessage(facade.copy()); other.copy(this); return other; } }
JmsMessage implements javax.jms.Message { public JmsMessage copy() throws JMSException { JmsMessage other = new JmsMessage(facade.copy()); other.copy(this); return other; } JmsMessage(JmsMessageFacade facade); }
JmsMessage implements javax.jms.Message { public JmsMessage copy() throws JMSException { JmsMessage other = new JmsMessage(facade.copy()); other.copy(this); return other; } JmsMessage(JmsMessageFacade facade); JmsMessage copy(); @Override int hashCode(); @Override boolean equals(Object o); @Override void acknowledge(); @Override boolean isBodyAssignableTo(@SuppressWarnings("rawtypes") Class target); @Override final T getBody(Class<T> asType); @Override void clearBody(); boolean isValidatePropertyNames(); void setValidatePropertyNames(boolean validatePropertyNames); boolean isReadOnly(); void setReadOnly(boolean readOnly); boolean isReadOnlyBody(); void setReadOnlyBody(boolean readOnlyBody); boolean isReadOnlyProperties(); void setReadOnlyProperties(boolean readOnlyProperties); @Override String getJMSMessageID(); @Override void setJMSMessageID(String value); @Override long getJMSTimestamp(); @Override void setJMSTimestamp(long timestamp); @Override String getJMSCorrelationID(); @Override void setJMSCorrelationID(String correlationId); @Override byte[] getJMSCorrelationIDAsBytes(); @Override void setJMSCorrelationIDAsBytes(byte[] correlationId); @Override Destination getJMSReplyTo(); @Override void setJMSReplyTo(Destination destination); @Override Destination getJMSDestination(); @Override void setJMSDestination(Destination destination); @Override int getJMSDeliveryMode(); @Override void setJMSDeliveryMode(int mode); @Override boolean getJMSRedelivered(); @Override void setJMSRedelivered(boolean redelivered); @Override String getJMSType(); @Override void setJMSType(String type); @Override long getJMSExpiration(); @Override void setJMSExpiration(long expiration); @Override int getJMSPriority(); @Override void setJMSPriority(int priority); @Override long getJMSDeliveryTime(); @Override void setJMSDeliveryTime(long deliveryTime); @Override void clearProperties(); @Override boolean propertyExists(String name); @Override Enumeration<?> getPropertyNames(); Enumeration<?> getAllPropertyNames(); @Override void setObjectProperty(String name, Object value); @Override Object getObjectProperty(String name); @Override boolean getBooleanProperty(String name); @Override byte getByteProperty(String name); @Override short getShortProperty(String name); @Override int getIntProperty(String name); @Override long getLongProperty(String name); @Override float getFloatProperty(String name); @Override double getDoubleProperty(String name); @Override String getStringProperty(String name); @Override void setBooleanProperty(String name, boolean value); @Override void setByteProperty(String name, byte value); @Override void setShortProperty(String name, short value); @Override void setIntProperty(String name, int value); @Override void setLongProperty(String name, long value); @Override void setFloatProperty(String name, float value); @Override void setDoubleProperty(String name, double value); @Override void setStringProperty(String name, String value); JmsAcknowledgeCallback getAcknowledgeCallback(); void setAcknowledgeCallback(JmsAcknowledgeCallback jmsAcknowledgeCallback); void onSend(long producerTtl); void onSendComplete(); void onDispatch(); JmsConnection getConnection(); void setConnection(JmsConnection connection); JmsMessageFacade getFacade(); boolean isExpired(); @Override String toString(); }
JmsMessage implements javax.jms.Message { public JmsMessage copy() throws JMSException { JmsMessage other = new JmsMessage(facade.copy()); other.copy(this); return other; } JmsMessage(JmsMessageFacade facade); JmsMessage copy(); @Override int hashCode(); @Override boolean equals(Object o); @Override void acknowledge(); @Override boolean isBodyAssignableTo(@SuppressWarnings("rawtypes") Class target); @Override final T getBody(Class<T> asType); @Override void clearBody(); boolean isValidatePropertyNames(); void setValidatePropertyNames(boolean validatePropertyNames); boolean isReadOnly(); void setReadOnly(boolean readOnly); boolean isReadOnlyBody(); void setReadOnlyBody(boolean readOnlyBody); boolean isReadOnlyProperties(); void setReadOnlyProperties(boolean readOnlyProperties); @Override String getJMSMessageID(); @Override void setJMSMessageID(String value); @Override long getJMSTimestamp(); @Override void setJMSTimestamp(long timestamp); @Override String getJMSCorrelationID(); @Override void setJMSCorrelationID(String correlationId); @Override byte[] getJMSCorrelationIDAsBytes(); @Override void setJMSCorrelationIDAsBytes(byte[] correlationId); @Override Destination getJMSReplyTo(); @Override void setJMSReplyTo(Destination destination); @Override Destination getJMSDestination(); @Override void setJMSDestination(Destination destination); @Override int getJMSDeliveryMode(); @Override void setJMSDeliveryMode(int mode); @Override boolean getJMSRedelivered(); @Override void setJMSRedelivered(boolean redelivered); @Override String getJMSType(); @Override void setJMSType(String type); @Override long getJMSExpiration(); @Override void setJMSExpiration(long expiration); @Override int getJMSPriority(); @Override void setJMSPriority(int priority); @Override long getJMSDeliveryTime(); @Override void setJMSDeliveryTime(long deliveryTime); @Override void clearProperties(); @Override boolean propertyExists(String name); @Override Enumeration<?> getPropertyNames(); Enumeration<?> getAllPropertyNames(); @Override void setObjectProperty(String name, Object value); @Override Object getObjectProperty(String name); @Override boolean getBooleanProperty(String name); @Override byte getByteProperty(String name); @Override short getShortProperty(String name); @Override int getIntProperty(String name); @Override long getLongProperty(String name); @Override float getFloatProperty(String name); @Override double getDoubleProperty(String name); @Override String getStringProperty(String name); @Override void setBooleanProperty(String name, boolean value); @Override void setByteProperty(String name, byte value); @Override void setShortProperty(String name, short value); @Override void setIntProperty(String name, int value); @Override void setLongProperty(String name, long value); @Override void setFloatProperty(String name, float value); @Override void setDoubleProperty(String name, double value); @Override void setStringProperty(String name, String value); JmsAcknowledgeCallback getAcknowledgeCallback(); void setAcknowledgeCallback(JmsAcknowledgeCallback jmsAcknowledgeCallback); void onSend(long producerTtl); void onSendComplete(); void onDispatch(); JmsConnection getConnection(); void setConnection(JmsConnection connection); JmsMessageFacade getFacade(); boolean isExpired(); @Override String toString();  }