XmlOverlongNames extends AbstractDoSAttack { @Override public boolean equals( Object obj ) { if ( obj == null ) return false; if ( obj == this ) return true; if ( !obj.getClass().equals( getClass() ) ) return false; XmlOverlongNames that = (XmlOverlongNames) obj; List<DoSParam<?>> paramThis = this.getCurrentParams(); List<DoSParam<?>> paramThat = that.getCurrentParams(); DoSParam<?> forThis = paramThis.get( 2 ); DoSParam<?> forThat = paramThat.get( 2 ); return forThis.getValueAsString().equals( forThat.getValueAsString() ); } XmlOverlongNames(); @Override String getName(); @Override PayloadPosition[] getPossiblePossitions(); For[] getOverlongNamesFor(); void setOverlongNamesFor( For[] overlongFor ); IterateModel getLengthOfStringsIterator(); void setLengthOfStringsIterator( IterateModel iterateModel ); IterateModel getNumberOfElementsIterator(); void setNumberOfElementsIterator( IterateModel iterateModel ); @Override boolean hasFurtherParams(); @Override void nextParam(); @Override List<DoSParam<?>> getCurrentParams(); @Override String getTamperedRequest( String xml, PayloadPosition payloadPosition ); @Override DoSAttack minimal(); @Override DoSAttack middle( DoSAttack aThat ); @Override void initialize(); @Override int hashCode(); @Override boolean equals( Object obj ); @Override int compareTo( DoSAttack aThat ); static void main( String[] args );  }
@Test public void equalsTest() { assertThat( xmlOverlongNames.equals( null ), is( false ) ); assertThat( xmlOverlongNames.equals( xmlOverlongNames ), is( true ) ); CoerciveParsing coerciveParsing = new CoerciveParsing(); assertThat( xmlOverlongNames.equals( coerciveParsing ), is( false ) ); XmlOverlongNames o_this = new XmlOverlongNames(); o_this.nextParam(); XmlOverlongNames o_that = new XmlOverlongNames(); o_that.nextParam(); assertThat( o_this.equals( o_that ), is( true ) ); o_this = new XmlOverlongNames(); o_this.nextParam(); o_that = new XmlOverlongNames(); o_that.setOverlongNamesFor( new For[] { For.AttributeValue } ); o_that.nextParam(); assertThat( o_this.equals( o_that ), is( false ) ); }