• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need help on the org.w3c.dom.NodeList

 
Ranch Hand
Posts: 681
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am writing a test unit which is mocking elements from a XML converted into a document.

But at one stage I am returning a nodeList with two elements.

So instead of the code


which wont work since periodOfStayElement.getNodeName()). can only be CheckInDate or CheckOutDate i need to at this level


I need to return a real not mocked NodeList .

NodeList is a interface, but what i cant find is the nodelist object that implements NodeList.

Is it possible outside the DOm to be able to create this NodeListObject or are the objects proprietary to org.w3c.dom, and you can only create this objects when turning an XML into a document.

Thank you for any help
 
Tony Evans
Ranch Hand
Posts: 681
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actualluy if I want to returmn more than one element mockito can handle that here is the working code



Sorry this is now a mockito rather than XML example
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tony Evans wrote:Sorry this is now a mockito rather than XML example



So, I added the post to our "Testing" forum as well as leaving it here. But it looks like you have your answer -- am I right?
 
Tony Evans
Ranch Hand
Posts: 681
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes I do thanks
 
reply
    Bookmark Topic Watch Topic
  • New Topic