mirror of https://github.com/apache/activemq.git
Fix invalid assertion in the test which was causing it to fail after recent changes for compliance
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1421574 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f21992ef41
commit
cdf05dcd1d
|
@ -27,7 +27,6 @@ import javax.jms.DeliveryMode;
|
||||||
import javax.jms.Destination;
|
import javax.jms.Destination;
|
||||||
import javax.jms.JMSException;
|
import javax.jms.JMSException;
|
||||||
import javax.jms.MapMessage;
|
import javax.jms.MapMessage;
|
||||||
import javax.jms.Message;
|
|
||||||
import javax.jms.MessageConsumer;
|
import javax.jms.MessageConsumer;
|
||||||
import javax.jms.MessageEOFException;
|
import javax.jms.MessageEOFException;
|
||||||
import javax.jms.MessageProducer;
|
import javax.jms.MessageProducer;
|
||||||
|
@ -37,6 +36,7 @@ import javax.jms.StreamMessage;
|
||||||
import javax.jms.TextMessage;
|
import javax.jms.TextMessage;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
import org.apache.activemq.command.ActiveMQDestination;
|
import org.apache.activemq.command.ActiveMQDestination;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -99,6 +99,7 @@ public class JMSMessageTest extends JmsTestSupport {
|
||||||
junit.textui.TestRunner.run(suite());
|
junit.textui.TestRunner.run(suite());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected ConnectionFactory createConnectionFactory() throws URISyntaxException {
|
protected ConnectionFactory createConnectionFactory() throws URISyntaxException {
|
||||||
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(connectURL);
|
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(connectURL);
|
||||||
return factory;
|
return factory;
|
||||||
|
@ -271,181 +272,228 @@ public class JMSMessageTest extends JmsTestSupport {
|
||||||
private long expiration;
|
private long expiration;
|
||||||
private int priority;
|
private int priority;
|
||||||
private String text;
|
private String text;
|
||||||
private HashMap<String, Object> props = new HashMap<String, Object>();
|
private final HashMap<String, Object> props = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getJMSMessageID() throws JMSException {
|
public String getJMSMessageID() throws JMSException {
|
||||||
return messageId;
|
return messageId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setJMSMessageID(String arg0) throws JMSException {
|
public void setJMSMessageID(String arg0) throws JMSException {
|
||||||
messageId = arg0;
|
messageId = arg0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public long getJMSTimestamp() throws JMSException {
|
public long getJMSTimestamp() throws JMSException {
|
||||||
return timestamp;
|
return timestamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setJMSTimestamp(long arg0) throws JMSException {
|
public void setJMSTimestamp(long arg0) throws JMSException {
|
||||||
timestamp = arg0;
|
timestamp = arg0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public byte[] getJMSCorrelationIDAsBytes() throws JMSException {
|
public byte[] getJMSCorrelationIDAsBytes() throws JMSException {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setJMSCorrelationIDAsBytes(byte[] arg0) throws JMSException {
|
public void setJMSCorrelationIDAsBytes(byte[] arg0) throws JMSException {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setJMSCorrelationID(String arg0) throws JMSException {
|
public void setJMSCorrelationID(String arg0) throws JMSException {
|
||||||
correlationId = arg0;
|
correlationId = arg0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getJMSCorrelationID() throws JMSException {
|
public String getJMSCorrelationID() throws JMSException {
|
||||||
return correlationId;
|
return correlationId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Destination getJMSReplyTo() throws JMSException {
|
public Destination getJMSReplyTo() throws JMSException {
|
||||||
return replyTo;
|
return replyTo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setJMSReplyTo(Destination arg0) throws JMSException {
|
public void setJMSReplyTo(Destination arg0) throws JMSException {
|
||||||
replyTo = arg0;
|
replyTo = arg0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Destination getJMSDestination() throws JMSException {
|
public Destination getJMSDestination() throws JMSException {
|
||||||
return destination;
|
return destination;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setJMSDestination(Destination arg0) throws JMSException {
|
public void setJMSDestination(Destination arg0) throws JMSException {
|
||||||
destination = arg0;
|
destination = arg0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getJMSDeliveryMode() throws JMSException {
|
public int getJMSDeliveryMode() throws JMSException {
|
||||||
return deliveryMode;
|
return deliveryMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setJMSDeliveryMode(int arg0) throws JMSException {
|
public void setJMSDeliveryMode(int arg0) throws JMSException {
|
||||||
deliveryMode = arg0;
|
deliveryMode = arg0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean getJMSRedelivered() throws JMSException {
|
public boolean getJMSRedelivered() throws JMSException {
|
||||||
return redelivered;
|
return redelivered;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setJMSRedelivered(boolean arg0) throws JMSException {
|
public void setJMSRedelivered(boolean arg0) throws JMSException {
|
||||||
redelivered = arg0;
|
redelivered = arg0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getJMSType() throws JMSException {
|
public String getJMSType() throws JMSException {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setJMSType(String arg0) throws JMSException {
|
public void setJMSType(String arg0) throws JMSException {
|
||||||
type = arg0;
|
type = arg0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public long getJMSExpiration() throws JMSException {
|
public long getJMSExpiration() throws JMSException {
|
||||||
return expiration;
|
return expiration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setJMSExpiration(long arg0) throws JMSException {
|
public void setJMSExpiration(long arg0) throws JMSException {
|
||||||
expiration = arg0;
|
expiration = arg0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getJMSPriority() throws JMSException {
|
public int getJMSPriority() throws JMSException {
|
||||||
return priority;
|
return priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setJMSPriority(int arg0) throws JMSException {
|
public void setJMSPriority(int arg0) throws JMSException {
|
||||||
priority = arg0;
|
priority = arg0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void clearProperties() throws JMSException {
|
public void clearProperties() throws JMSException {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean propertyExists(String arg0) throws JMSException {
|
public boolean propertyExists(String arg0) throws JMSException {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean getBooleanProperty(String arg0) throws JMSException {
|
public boolean getBooleanProperty(String arg0) throws JMSException {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public byte getByteProperty(String arg0) throws JMSException {
|
public byte getByteProperty(String arg0) throws JMSException {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public short getShortProperty(String arg0) throws JMSException {
|
public short getShortProperty(String arg0) throws JMSException {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getIntProperty(String arg0) throws JMSException {
|
public int getIntProperty(String arg0) throws JMSException {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public long getLongProperty(String arg0) throws JMSException {
|
public long getLongProperty(String arg0) throws JMSException {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public float getFloatProperty(String arg0) throws JMSException {
|
public float getFloatProperty(String arg0) throws JMSException {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public double getDoubleProperty(String arg0) throws JMSException {
|
public double getDoubleProperty(String arg0) throws JMSException {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getStringProperty(String arg0) throws JMSException {
|
public String getStringProperty(String arg0) throws JMSException {
|
||||||
return (String)props.get(arg0);
|
return (String)props.get(arg0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object getObjectProperty(String arg0) throws JMSException {
|
public Object getObjectProperty(String arg0) throws JMSException {
|
||||||
return props.get(arg0);
|
return props.get(arg0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Enumeration getPropertyNames() throws JMSException {
|
public Enumeration getPropertyNames() throws JMSException {
|
||||||
return new Vector<String>(props.keySet()).elements();
|
return new Vector<String>(props.keySet()).elements();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setBooleanProperty(String arg0, boolean arg1) throws JMSException {
|
public void setBooleanProperty(String arg0, boolean arg1) throws JMSException {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setByteProperty(String arg0, byte arg1) throws JMSException {
|
public void setByteProperty(String arg0, byte arg1) throws JMSException {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setShortProperty(String arg0, short arg1) throws JMSException {
|
public void setShortProperty(String arg0, short arg1) throws JMSException {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setIntProperty(String arg0, int arg1) throws JMSException {
|
public void setIntProperty(String arg0, int arg1) throws JMSException {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setLongProperty(String arg0, long arg1) throws JMSException {
|
public void setLongProperty(String arg0, long arg1) throws JMSException {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setFloatProperty(String arg0, float arg1) throws JMSException {
|
public void setFloatProperty(String arg0, float arg1) throws JMSException {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setDoubleProperty(String arg0, double arg1) throws JMSException {
|
public void setDoubleProperty(String arg0, double arg1) throws JMSException {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setStringProperty(String arg0, String arg1) throws JMSException {
|
public void setStringProperty(String arg0, String arg1) throws JMSException {
|
||||||
props.put(arg0, arg1);
|
props.put(arg0, arg1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setObjectProperty(String arg0, Object arg1) throws JMSException {
|
public void setObjectProperty(String arg0, Object arg1) throws JMSException {
|
||||||
props.put(arg0, arg1);
|
props.put(arg0, arg1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void acknowledge() throws JMSException {
|
public void acknowledge() throws JMSException {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void clearBody() throws JMSException {
|
public void clearBody() throws JMSException {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setText(String arg0) throws JMSException {
|
public void setText(String arg0) throws JMSException {
|
||||||
text = arg0;
|
text = arg0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getText() throws JMSException {
|
public String getText() throws JMSException {
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
@ -475,8 +523,7 @@ public class JMSMessageTest extends JmsTestSupport {
|
||||||
// JMSDestination, JMSDeliveryMode, JMSExpiration, JMSPriority, JMSMessageID, and JMSTimestamp
|
// JMSDestination, JMSDeliveryMode, JMSExpiration, JMSPriority, JMSMessageID, and JMSTimestamp
|
||||||
//must be set by sending a message.
|
//must be set by sending a message.
|
||||||
|
|
||||||
// exception for jms destination as the format is provider defined so it is only set on the copy
|
assertNotNull(message.getJMSDestination());
|
||||||
assertNull(message.getJMSDestination());
|
|
||||||
assertEquals(Session.AUTO_ACKNOWLEDGE, message.getJMSDeliveryMode());
|
assertEquals(Session.AUTO_ACKNOWLEDGE, message.getJMSDeliveryMode());
|
||||||
assertTrue(start + timeToLive <= message.getJMSExpiration());
|
assertTrue(start + timeToLive <= message.getJMSExpiration());
|
||||||
assertTrue(end + timeToLive >= message.getJMSExpiration());
|
assertTrue(end + timeToLive >= message.getJMSExpiration());
|
||||||
|
|
Loading…
Reference in New Issue