@Test public void testEquals() { JmsDefaultRedeliveryPolicy policy1 = new JmsDefaultRedeliveryPolicy(); JmsDefaultRedeliveryPolicy policy2 = new JmsDefaultRedeliveryPolicy(); assertTrue(policy1.equals(policy1)); assertTrue(policy1.equals(policy2)); assertTrue(policy2.equals(policy1)); assertFalse(policy1.equals(null)); assertFalse(policy1.equals("test")); policy1.setMaxRedeliveries(5); policy2.setMaxRedeliveries(6); assertFalse(policy1.equals(policy2)); assertFalse(policy2.equals(policy1)); policy1.setMaxRedeliveries(5); policy2.setMaxRedeliveries(5); policy1.setOutcome(1); policy2.setOutcome(2); assertFalse(policy1.equals(policy2)); assertFalse(policy2.equals(policy1)); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } JmsDefaultRedeliveryPolicy other = (JmsDefaultRedeliveryPolicy) obj; return maxRedeliveries == other.maxRedeliveries && outcome == other.outcome; }
JmsDefaultRedeliveryPolicy implements JmsRedeliveryPolicy { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } JmsDefaultRedeliveryPolicy other = (JmsDefaultRedeliveryPolicy) obj; return maxRedeliveries == other.maxRedeliveries && outcome == other.outcome; } }
JmsDefaultRedeliveryPolicy implements JmsRedeliveryPolicy { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } JmsDefaultRedeliveryPolicy other = (JmsDefaultRedeliveryPolicy) obj; return maxRedeliveries == other.maxRedeliveries && outcome == other.outcome; } JmsDefaultRedeliveryPolicy();  JmsDefaultRedeliveryPolicy(JmsDefaultRedeliveryPolicy source); }
JmsDefaultRedeliveryPolicy implements JmsRedeliveryPolicy { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } JmsDefaultRedeliveryPolicy other = (JmsDefaultRedeliveryPolicy) obj; return maxRedeliveries == other.maxRedeliveries && outcome == other.outcome; } JmsDefaultRedeliveryPolicy();  JmsDefaultRedeliveryPolicy(JmsDefaultRedeliveryPolicy source); @Override JmsDefaultRedeliveryPolicy copy(); @Override int getMaxRedeliveries(JmsDestination destination); @Override int getOutcome(JmsDestination destination); int getOutcome(); void setOutcome(int outcome); void setOutcome(String outcome); int getMaxRedeliveries(); void setMaxRedeliveries(int maxRedeliveries); @Override int hashCode(); @Override boolean equals(Object obj); }
JmsDefaultRedeliveryPolicy implements JmsRedeliveryPolicy { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } JmsDefaultRedeliveryPolicy other = (JmsDefaultRedeliveryPolicy) obj; return maxRedeliveries == other.maxRedeliveries && outcome == other.outcome; } JmsDefaultRedeliveryPolicy();  JmsDefaultRedeliveryPolicy(JmsDefaultRedeliveryPolicy source); @Override JmsDefaultRedeliveryPolicy copy(); @Override int getMaxRedeliveries(JmsDestination destination); @Override int getOutcome(JmsDestination destination); int getOutcome(); void setOutcome(int outcome); void setOutcome(String outcome); int getMaxRedeliveries(); void setMaxRedeliveries(int maxRedeliveries); @Override int hashCode(); @Override boolean equals(Object obj); static final int DEFAULT_MAX_REDELIVERIES; static final int DEFAULT_OUTCOME; }