I have a Java project with a lot of classes. Now I want to get a list with all jUnit tests. My idea was to use grep for that.
So I navigated to the root folder, and use the following command:
grep junit -R ./ > output.txt
But obviously this isn’t correct. So my question is. How is the correct command? And are there ways that are more easier to find jUnit tests?
You’d want:
But you need to be a little careful with that, as it’ll go through all files, include jars.
Better to use
findorack:Or more boringly:
(If you’re not using ack, for some stuff, it’s just awesome.)