15:10:07 <colindixon> #startmeeting jQuery/XPath for MD-SAL intern
15:10:07 <odl_meetbot> Meeting started Tue Jul  1 15:10:07 2014 UTC.  The chair is colindixon. Information about MeetBot at http://ci.openstack.org/meetbot.html.
15:10:07 <odl_meetbot> Useful Commands: #action #agreed #help #info #idea #link #topic #startvote.
15:10:07 <odl_meetbot> The meeting name has been set to 'jquery_xpath_for_md_sal_intern'
15:10:08 <Neel_B> updated my git with latest code
15:10:27 <colindixon> #link https://github.com/neel1438/Opendaylight/ Neel_B has updated the github with his latest code
15:10:37 <colindixon> hopefully this meeting will be fast and easy
15:10:40 <colindixon> so, what did you find?
15:11:39 <Neel_B> it is not exactly forming a tree
15:12:08 <Neel_B> if i try nodeList nodelist=(NodeList)xpath.evaluate("/",root,XPathConstants.NODESET);
15:12:20 <Neel_B> only root node is listed
15:12:44 <Neel_B> if i try any thing other like "//b" or "//b/c1"
15:12:52 <Neel_B> it shows 0 nodes
15:13:39 * colindixon looks
15:13:53 <devinavery> Looking..
15:14:42 <devinavery> Neel - one thing that would be good is to have a side-by-side comparison. That is, we really want to write a "unit test" which tells us exactly how we expect to work. Then swap out the implementation and make sure that it still works
15:15:09 <devinavery> The way I would do this is take XML mark up that represents the tree structure we think we are returning, and then make a series of calls and validate the output.
15:15:26 <devinavery> Then swap out the implementation like we did in your test program and make sure we handle all of the same cases in the same way.
15:15:49 <devinavery> That will help us. Because at this point I can't figure out if this is expected behavior or not. Which means we probably need to map that out a little bit more.
15:17:17 <Neel_B> okay
15:17:22 <Neel_B> thats what i was thinking
15:17:27 <colindixon> #info it seems as thoguh the sample code for the new node is behaving oddly, but it’s hard to tell if it’s right or not
15:17:57 <colindixon> #info the next step woudl be to build a unit test (or a few) which make parallel calls to a real Document and to a Node that we think should behave the same
15:18:15 <colindixon> hey jmedved
15:18:44 <colindixon> jmedved: if you wanted to catch up, the log so far is here: https://meetings.opendaylight.org/opendaylight-intern/2014/jquery_xpath_for_md_sal_intern/opendaylight-intern-jquery_xpath_for_md_sal_intern.2014-07-01-15.10.log.txt
15:18:52 <colindixon> Neel_B: does that make sense?
15:18:59 <Neel_B> yeah
15:20:15 <colindixon> devinavery: do you have 2-3 queries that you think would be good ones?
15:20:34 <colindixon> otherwise, I can take a look
15:21:30 <Neel_B> we are thinking of this right  a-->b-->c1
15:21:30 <Neel_B> |
15:21:36 <Neel_B> b-->c2
15:21:37 <devinavery> Um. We can start simple.
15:21:53 <Neel_B> this is the tree structure i am thinking
15:21:54 <devinavery> /a
15:21:57 <devinavery> /a/b
15:22:02 <devinavery> /a/b/c1
15:22:17 <devinavery> I think '/' technically returns the "document" which is why that might be returning null... not positive though
15:22:18 <Neel_B> /a/b/c2
15:22:35 <Neel_B> no "/" is returning a
15:22:40 <Neel_B> nothing else
15:22:55 <colindixon> Neel_B: let me look for a second
15:23:19 <devinavery> Sorry, '/' returns "that" element.. which since we are passing in root (i.e. a) returns a. If you pass in an XML document it would return the XML document
15:23:32 <devinavery> So actually the / should only return 'a'
15:23:39 <devinavery> but /* should return b
15:24:15 <Neel_B> okay let me see
15:25:03 <Neel_B> "/*" is returning nothing
15:25:36 <devinavery> Ok. Something is fishy there. It would be worth validating my assumptions against a real XML document, but I am 90% sure it should return all immediate children (in this case, b)(
15:26:41 <colindixon> so, Neel_B the next step is to do what we said above
15:27:11 <colindixon> which is come up with 3 queries “/“ and “/*” are good ones probably
15:27:18 <colindixon> Neel_B: do you know how to use Eclipse’s debugger?
15:27:25 <colindixon> or how are you writing the code?
15:27:37 <Neel_B> not exactly  should not be a problem
15:27:39 <Neel_B> though
15:28:02 <Neel_B> i guess
15:28:30 <Neel_B> using eclipse i put print statements whre ever required
15:28:35 <Neel_B> to check
15:29:04 <colindixon> so, do you know how to set breakpoints?
15:29:24 <colindixon> that’s worth looking at
15:29:29 <colindixon> here, hold on one second
15:29:30 <Neel_B> okay i would
15:29:56 <Neel_B> i used gdb so i know how to use a debugger
15:30:13 <Neel_B> but never used eclipse debugger
15:30:48 <colindixon> let’s try this
15:30:54 <colindixon> can you go to http://hangout.vyatta.com/
15:31:03 <colindixon> and I’ll show you how to use the Eclipse debugger a bit
15:32:20 <colindixon> #action Neel_B to create unit tests where he compares the result of XPath queries to his Node implementations to a Document which we believe should be the same
15:41:25 <colindixon> #info colindixon showed Neel_B a bit of how to use the Eclipse interactive debugger (which will hopefully help a bit) and talked about next steps a bit
15:41:58 <colindixon> Neel_B: do you have the original XML document
15:42:04 <colindixon> I just want to check one thing?
15:42:26 <Neel_B> all the nodes ??
15:42:39 <colindixon> Neel_B: no, the actual a.xml file
15:42:43 <colindixon> so I can look at it
15:42:48 <colindixon> I guess devinavery mailed it out
15:42:50 <colindixon> so I can look there
15:43:25 <colindixon> #info the 3 test queries that seem to make sense to start with for unit tests are “/“, “/*” and “//a/b/c1”, but Neel_B should use his judgement if those queries either don’t work or he thinks there are more tests that make sense
15:43:58 <Neel_B> http://pastebin.com/LKTKrsyL
15:44:03 <Neel_B> this is a.xml
15:44:09 <colindixon> thanks
15:44:17 <colindixon> oh, no, not that one
15:44:26 <colindixon> the a/b/{c1,c2}
15:44:35 <Neel_B> no i don't have that one
15:44:41 <Neel_B> i could write in a bit
15:45:40 <colindixon> <a>
15:45:41 <colindixon> <b attr="attributeValue">
15:45:43 <colindixon> <c id="1">Some Value</c>
15:45:44 <colindixon> <c id="2">Some Other Value</c>
15:45:45 <colindixon> </b>
15:45:46 <colindixon> </a>
15:45:47 <colindixon> that one
15:45:50 <Neel_B> <a>
15:45:51 <Neel_B> <b>
15:45:51 <Neel_B> <c1>Some Value</c>
15:45:51 <Neel_B> <c2>Some Other Value</c>
15:45:51 <Neel_B> </b>
15:45:51 <Neel_B> </a>
15:45:54 <colindixon> yes
15:45:55 <colindixon> that’
15:46:06 <Neel_B> we do not need attributes so removed it
15:47:18 <colindixon> exactly
15:47:52 <Neel_B> okay sure
15:47:57 <devinavery> (need to drop off to get ready for MD-SAL call.
15:47:58 <colindixon> so, in the unit tests you’d do “Document d = new Document( file.xml )” where file.xml is that document
15:48:02 <colindixon> devinavery: no worries
15:48:05 <colindixon> I’ve got it
15:48:16 <Neel_B> yeah
15:48:20 <Neel_B> i got it
15:48:25 <colindixon> (I’m actually not sure you can do new Document like that, but you have the general idea
15:48:29 <colindixon> perfect
15:48:40 <colindixon> so, yeah, we’ll plan to meet tomorrow at this time and check in
15:48:54 <colindixon> if this is easy, which I’m hoping it is, you can start with the Ping example we’ve talked about in the past
15:49:10 <Neel_B> DocumentBuilder dBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
15:49:10 <Neel_B> Document document = dBuilder.parse(xmlfile);
15:49:13 <colindixon> and as always e-mail if you need anything or just want to let us know how things are doing
15:49:14 <Neel_B> this does that
15:49:18 <colindixon> Neel_B: perfect
15:49:25 <colindixon> see, you know more than me already :p
15:49:28 <colindixon> ok
15:49:34 <Neel_B> hahaha
15:49:36 <colindixon> anything else you need from us?
15:49:47 <Neel_B> after i finish this
15:49:57 <Neel_B> i might need help in the ping example
15:50:03 <Neel_B> i would email you then
15:50:08 <colindixon> sounds good
15:50:13 <colindixon> please do
15:50:39 <colindixon> e-mail devinavery, me, ryan, and jan just so that everyone is in the loop
15:50:46 <colindixon> thanks again for your time and have a nice night
15:50:49 <colindixon> sleep some :p
15:50:50 <Neel_B> yeah i meant all
15:50:59 <Neel_B> i will
15:51:04 <colindixon> #endmeeting