[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [sisu-users] JSR-330 and Plexus shim
|
On 1 May 2014, at 16:21, Benjamin Bentmann <bentmann@xxxxxxxxxxxx> wrote:
> Stuart McCulloch wrote:
>
>> Actually even without @Typed in most cases it should work, so an example showing where it doesn’t work would help narrow down the exact change required in the shim.
>
> It indeed works, as long as one has classpath scanning enabled and any supporting index files around.
>
> Benjamin
>
> public interface SomeInterface {
> }
>
> @Named
> //@Typed(SomeInterface.class)
> public class SomeComponent
> implements SomeInterface {
> }
>
> public class PlexusBasedTest
> extends PlexusTestCase {
>
> protected void customizeContainerConfiguration( ContainerConfiguration containerConfiguration ) {
> containerConfiguration.setAutoWiring( true );
> containerConfiguration.setClassPathScanning( PlexusConstants.SCANNING_ON );
Note that SCANNING_ON does a full scan of the classpath and doesn’t use index files, whereas SCANNING_INDEX relies on index files and is much faster.
> }
>
> public void testLookupOfJsr330()
> throws Exception {
> assertNotNull( lookup( SomeInterface.class ) );
> }
> }
>
>
> _______________________________________________
> sisu-users mailing list
> sisu-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/sisu-users