Jeff, the equals() method isn't implemented. The best way to achieve what you want is to use something like XMLUnit. Today two Woden objects are equal if they are the same object ... Object.equals() is called under the covers.
There's a problem with the equals() method as we have it on Woden classes. The place to implement equals() is on the DescriptionImpl, InterfaceImpl etc classes. However, DescriptionImpl is the implementation of both the Description and DescriptionElement interfaces, so the question is what should the method compare? Should it compare at the Description (component model level) or the DescriptionElement (element model level). It's not correct to implement two equals() methods with different signatures as this will break the equals() method contract for transitivity. That is: Object obj; Description desc1; Description desc2; desc1.equals(desc2); // see note 1 obj=desc1; obj.equals(desc2); // see note 2 desc2.equals(obj); // see note 3 Note 1: as it is today will call the baseclass WSDLComponentImpl.equals(WSDLComponent comp) method which actually defers to the Object.equals() method as I mentioned, but this isn't very useful Note 2: this will call the Object.equals() method Note 3: this will call WSDLComponentImpl.equals(WSDLComponent comp) which while today this defers to Object.equals(), if we wanted something useful - ie compare each individual Component model object inside the Description objects - then we don't have transitivity. We need transitivity if the objects can be put into hashmaps etc. We also need a hashCode implementation but that is another (related) discussion. If you have any ideas on fixing this, then that would be welcome as I think component model and element model comparison would be useful for a well formed programming model. However, all thoughts I've had about this up to now haven't fitted well with the current design. Oh yes, back on-topic :-) ... XML file comparison / XMLUnit is more likely to solve your problem of testing the converter in the short term. Thanks, Jeremy 2008/6/12 Jeff MAURY <[EMAIL PROTECTED]>: > Hello, > > as I am working on the converter, I have a little question. > In order to non regress the converter, I want to build tests that checks the > output. > The fastest and easiest way to do it is to compare the generated WSDL2.0 > with the expected WSDL2.0. In order to do that, my idea was to load both > documents using the Woden API and to use the equals method on the resulting > objects in order to check the equality. Can I do that ? > > Thanks > Jeff MAURY > > > -- > La mélancolie c'est communiste > Tout le monde y a droit de temps en temps > La mélancolie n'est pas capitaliste > C'est même gratuit pour les perdants > La mélancolie c'est pacifiste > On ne lui rentre jamais dedans > La mélancolie oh tu sais ça existe > Elle se prend même avec des gants > La mélancolie c'est pour les syndicalistes > Il faut juste sa carte de permanent > > Miossec (2006) > > http://www.jeffmaury.com > http://riadiscuss.jeffmaury.com > http://www.lastfm.fr/listen/user/jeffmaury/personal --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
