[hibernate-dev] Moving Hibernate Search test packages

Sanne Grinovero sanne at hibernate.org
Mon Apr 4 16:38:20 EDT 2011

2011/4/4 Emmanuel Bernard <emmanuel at hibernate.org>:
> What's you actual use case. This explicit separation is something I've always appreciated to limit "clever" package-level visibility usages.
> Let's discuss tomorrow on IRC

In preparation to IRC, the use case is what I'm discussing with Tom
Waterhouse  in the parallel thread.
Tom's test is replacing the
FullTextIndexEventListener.searchFactoryImplementor with a mock

My version doesn't compile unless I make the field public, which is
obviously a no go but used it as temporary solution while working on
His original patch has the test moved to the same package as
FullTextIndexEventListener; I've already suggested him some changes,
but I remember in my first days on Search to have a hard time with the
same things.

> .
> On 4 avr. 2011, at 21:43, Sanne Grinovero wrote:
>> Hi,
>> it's sometimes useful from the test packages to be able to get
>> package-level visibility to classes in the main code.
>> All Hibernate Search tests are organized in a
>> "org.hibernate.search.test.X" package;
>> I'd like to move them to "org.hibernate.search.X.Y", i.e. give test
>> implementors the freedom to choose any package name.
>> It's of course possible to obtain the same with many clever tricks,
>> but it would make tests easier to write and cleaner to maintain.
>> Main code API is not affected, as obviously our test conventions don't
>> prevent people to do as they wish with their own package names...
>> to the opposite, we might be able to close down more APIs which
>> nowadays need "public" for testing purposes;
>> I'm not sure if there is such a case, just making the point that in theory it
>> A) won't make things worse
>> B) could make things better
>> I could either make a single commit moving them all out, or we can
>> just start making some tests out of the test package on a "as needed"
>> base.
>> WDYT?
>> Cheers,
>> Sanne
>> _______________________________________________
>> hibernate-dev mailing list
>> hibernate-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/hibernate-dev

More information about the hibernate-dev mailing list