Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] test package names

Hi Everyone,

I was just porting a bunch of tests from the C99 preprocessor to the new
CPreprocessor when I realized that maybe the package structure of the test
plugins could be improved. The problem I ran into is that I had a test that
I wanted to apply to the expression evaluator but couldn't because that
class is package-private for the new preprocessor.

There's a common practice that allows tests to have access to
package-private members while still living in a separate directory or
plug-in. Its possible for more than one plug-in to have a package with the
same name and the cool thing is that Java considers them to be logically
the same package.  This means that the tests for a package can actually
live in that package, but in a separate source tree.

Its important to limit the visibility of classes when appropriate, so for
example ExpressionEvaluator should stay package-private. And putting the
tests in the same package allows one to write more tests which is also very
good.

Its probably too much work to change the package structure in the test
plugins at this point. I'm just mentioning this because it might be
something useful to keep in mind going forward. Thoughts?


Mike Kucera
Software Developer
IBM CDT Team, Toronto
mkucera@xxxxxxxxxx



Back to the top