Code Comments
Programming Forum and web based access to our favorite programming groups.Hi,
Is there a simple way to unit test ( using junit 4) the following
code:
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final DistributionGroup other = (DistributionGroup) obj;
if (address == null) {
if (other.address != null)
return false;
} else if (!address.equals(other.address))
return false;
if (description == null) {
if (other.description != null)
return false;
} else if (!description.equals(other.description))
return false;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (noAnswerTimeout == null) {
if (other.noAnswerTimeout != null)
return false;
} else if (!noAnswerTimeout.equals(other.noAnswerTimeout))
return false;
if (open != other.open)
return false;
if (overflowWhenBusy == null) {
if (other.overflowWhenBusy != null)
return false;
} else if (!overflowWhenBusy.equals(other.overflowWhenBusy))
return false;
if (overflowWhenClosed == null) {
if (other.overflowWhenClosed != null)
return false;
} else if (!overflowWhenClosed.equals(other.overflowWhenClosed))
return false;
if (overflowWhenNoAgents == null) {
if (other.overflowWhenNoAgents != null)
return false;
} else if (!overflowWhenNoAgents.equals(other.overflowWhenNoAgents))
return false;
if (announcement != other.announcement)
return false;
if (supportAgents == null) {
if (other.supportAgents != null)
return false;
} else if (!supportAgents.equals(other.supportAgents))
return false;
return true;
}
cheers,
//mike
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.