Mockito.when( m_context.installBundle(
Mockito.anyString(),
Mockito.isA( InputStream.class ) ) )
.thenThrow(new BundleException( "test exception" ) );
Driver matched = drivers.get( "org.apache.felix.driver-1.0" );
final CountDownLatch latch = new CountDownLatch( 1 );
Answer<String> driver10_attach = new Answer<String>()
{
public String answer(InvocationOnMock invocation) throws Throwable
{
System.out.println("driver10_attach()");
latch.countDown();
return referredDriver;
}
};
Device device = tstCreateDevice( new String[]{ "org.apache.felix" } );
Mockito.when( matched.match( m_osgi.getReference( device ) ) ).thenReturn( 10 );
Mockito.when( matched.attach( Mockito.isA( ServiceReference.class ) ) )
.thenAnswer( driver10_attach );
// for ( String driverId : driverIds )
// {
// Driver driver = drivers.get( driverId );