| View previous topic :: View next topic |
| Author |
Message |
Kopilman
Joined: 25 May 2006 Posts: 162
|
I'm being prevented from unit testing the internals of my application because I like to make things package-private if they shouldn't be used outside the package. But then tests can't test them out
Is it bad to put testcase classes in the same package as the non test classes? |
| |
|
|
|
|
Lusis Backwood JR
Joined: 26 May 2006 Posts: 87 Location: United States
|
| That's one reason I believe private/public should be part of the documentation, and not part of the language semantics |
| |
|
|
Kopilman
Joined: 25 May 2006 Posts: 162
|
Or am i doing something else wrong
Lusis Backwood JR, documentation doesn't force anything
I'd prefer an option to say, "only this package and this package can use it" |
| |
|
|
Poolkop
Joined: 01 Jun 2006 Posts: 123
|
| I've seen the tests separated into a different source folder or project, but still in the same package as the classes they test ... |
| |
|
|
Lusis Backwood JR
Joined: 26 May 2006 Posts: 87 Location: United States
|
| Another good approach is taken by lisp, where unexported symbols can still be used in other packages, but using a different syntax |
| |
|
|
Kopilman
Joined: 25 May 2006 Posts: 162
|
Poolkop, interesting
I looked at junit source
And they just have a bunch of methods/classes called internal
I think that's stupid and i'd prefer to avoid it |
| |
|
|
Lusis Backwood JR
Joined: 26 May 2006 Posts: 87 Location: United States
|
| Kopilman, why not just make the members public? |
| |
|
|
Kopilman
Joined: 25 May 2006 Posts: 162
|
I don't know what the definition of a member is unless it's sexual
You talking about instance variables? |
| |
|
|
Lusis Backwood JR
Joined: 26 May 2006 Posts: 87 Location: United States
|
| Member of a class |
| |
|
|
Kopilman
Joined: 25 May 2006 Posts: 162
|
| Or the classes? |
| |
|
|
| Page 1 of 2 |
Goto page 1, 2 Next |
|