Writing tests that depend on information not available in the AST

Christian <[email protected]>
Newsgroups gmane.comp.java.audit.checkstyle.user
Message-ID <[email protected]>
Hi, 

I need to write some tests that depend on information
not available in the AST but only in the program's
java class structure, such as the inheritance tree or
an object's return value. 

For example I want to write a check that looks for
code that catches an exception to log an error and
then rethrows the same exception. This shall be
prohibited, provided the exception is a subclass of
some given class. 

Can I achieve this with checkstyle? I was thinking
about retrieving the name of the class via
IDENT.getText(), loading that class and finding out
about inheritance via reflection. Is this correct or
is there an easier way to achieve this? 

Another issue: there's a good introduction tutorial on
writing new checks on the website, but it is limited
to the given example - is there some comprehensive
list of possibilities, such as a list of tags that can
be queried from the AST?

Thanks a lot! 


      Machen Sie Yahoo! zu Ihrer Startseite. Los geht's: 
http://de.yahoo.com/set

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.