mathiasbroekelmann / js-test-driver

Automatically exported from code.google.com/p/js-test-driver
0 stars 0 forks source link

Double click could open the test in an editor #305

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
JUnit view has one useful feature: Double click opens selected test in an 
editor. Selected java test declaration is highlighted.

It would be great, if js-test-driver would have the same feature. That would 
save a lot of time currently spent by searching for tests in files.

Original issue reported on code.google.com by m.jurcov...@gmail.com on 6 Dec 2011 at 8:58

GoogleCodeExporter commented 8 years ago
Attached patch adds test opening feature. 

It keeps track of all files loaded on the server. Files are associated with 
their eclipse project. Therefore, they will not mix if user switches between 
two similar projects. The structure is stored in a new LoadedTestCasesLibrary 
class.

When user double click in js-test-driver view:
* search pattern TestCaseName.prototype.testName is created,
* search goes through all loaded files associated with current project,
* matching file is open in an editor,
* test function declaration is highlighted.

I used org.eclipse.search for searching. I did it because eclipse search does 
some optimizations (file indexing) not available in standard java matcher. It 
will be faster on bigger projects.

Note: It would be more elegant to use javascript development 
org.eclipse.wst.jsdt plugin for search. Unfortunately too many classes of that 
plugin have warning 'Provisional API - may change' written in comments.

Original comment by m.jurcov...@gmail.com on 6 Dec 2011 at 9:01

Attachments:

GoogleCodeExporter commented 8 years ago
Formatted, commented (sort of), and reorganized in r1100.

Also made a change in r1099 that adds the filename to a set of testcases. Might 
be a handy way to work around the regex.

Original comment by corbinrs...@gmail.com on 6 Dec 2011 at 8:05

GoogleCodeExporter commented 8 years ago
Thank you for commit, it was frustrating without this feature :).

Original comment by m.jurcov...@gmail.com on 7 Dec 2011 at 8:50

GoogleCodeExporter commented 8 years ago
Thank you for implementing it!

Original comment by corbinrs...@gmail.com on 8 Dec 2011 at 4:15