Community
Participate
Working Groups
Need to incrementally test model rewrite for Bug # 193214.
J-Unit test cases would be nice but don't have enough time in 3.4 to include them for the Simple Cheatsheet.
Anyone want to be a hero and write some JUnit's ;)?
I'm all ears to junits :) but hm where's the code to be tested? I walked over all pde.ui classes matching "*editors.cheatsheet*" but didn't find any cvs changes labeled [193214]
Let me see if I can give you a simple patch to start with >:)
Created attachment 92171 [details] org.eclipse.pde.ui.tests.patch Here is a patch I will commit to CVS that adds a simple test case for the cheatsheet model. This should help you get started as it sets up the basis on how to test the rest of the cheatsheet model.
btw Jacek, you're a true hero to do JUnits for PDE... We're so thankful that there's no code coverage running against PDE now ;)
you know it's my passion (who else would take testing as M.Sc. topic?) ;) I'll try to look at this later this week.
using simple stylesheets API i noticed that items in cheatsheet are indexed from 1, but you can move first item by -1, to index 0, and then subsequentially by -1, to any negative index. I guess items should not have indexes less than 1. correct?
cheatsheet API fails to parse XML without newline at the end of file. e.g.: <?xml version="1.0" encoding="UTF-8"?> <cheatsheet title="Title"><intro><description></description></intro></cheatsheet> (without newline after "</cheatsheet>") in cheatsheet editor shows up empty.
Created attachment 92696 [details] some tests some more tests. but don't commit yet. Simple Cheatsheet coverage about 40% :)
(In reply to comment #9) > cheatsheet API fails to parse XML without newline at the end of file. > e.g.: > > <?xml version="1.0" encoding="UTF-8"?> > <cheatsheet > title="Title"><intro><description></description></intro></cheatsheet> > > (without newline after "</cheatsheet>") in cheatsheet editor shows up empty. > That could be a bug in the cheatsheet code or the PDE text framework. I think we support this scenario in the plugin.xml editor.
(In reply to comment #8) > using simple stylesheets API i noticed that items in cheatsheet are indexed > from 1, but you can move first item by -1, to index 0, and then subsequentially > by -1, to any negative index. > I guess items should not have indexes less than 1. correct? I'd try to look into this, it could be just some esoteric issue... we haven't tested the code before so it's good to see if we have issues with the PDE text framework. Thanks for looking into this Jacek.
(In reply to comment #12) > I'd try to look into this, it could be just some esoteric issue... we haven't > tested the code before so it's good to see if we have issues with the PDE text > framework. ok, I'll do that and eventually create separate bugs if needed. thanks for hint :)
(In reply to comment #12) > (In reply to comment #8) > > using simple stylesheets API i noticed that items in cheatsheet are indexed > > from 1, but you can move first item by -1, to index 0, and then subsequentially > > by -1, to any negative index. > > I guess items should not have indexes less than 1. correct? > > I'd try to look into this, it could be just some esoteric issue... we haven't > tested the code before so it's good to see if we have issues with the PDE text > framework. ok, my understanding was that ISimpleCS.indexOfItem takes into account only items, but it does exactly the same what indexOf. So in above case index 0 was used by ISimpleCSIntro. I can't repro. negative index any more.
Let me know when you have something ready to commit Jacek.
Created attachment 95802 [details] test tests for cheatsheets. they all pass now. Cover about 50-60% (depends on metrics) of org.eclipse.pde.internal.core.text.cheatsheet.simple package. Should be good for now...
That's good for now. Thanks Jacek, you rock!