Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sisu-users] JSR-330 and Plexus shim

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 );
    }

    public void testLookupOfJsr330()
        throws Exception {
        assertNotNull( lookup( SomeInterface.class ) );
    }
}




Back to the top