Package org.osgi.service.device

Examples of org.osgi.service.device.Device


    @Test
    public void DeviceAddedNoDriverLocator() throws InterruptedException
    {

        //create a mocked device
        Device device = tstCreateDevice( new String[]
            { "org.apache.felix" } );

        CountDownLatch latch = tstExpectNoDriverFound( device );

        m_manager.deviceAdded( m_osgi.getReference( device ), device );
View Full Code Here


     */
    @Test
    public void DeviceAddedNoDriverLocatorSuccessfulAttach() throws Exception
    {

        Device device = tstCreateDevice( new String[] { "org.apache.felix" } );
        Driver driver = tstCreateDriver( "org.apache.felix.driver-1.0", 1 );

        CountDownLatch attachLatch = tstExpectAttach( driver, device );

        m_manager.driverAdded( m_osgi.getReference( driver ), driver );
View Full Code Here

     */
    @Test
    public void DeviceAddedNoDriverLocatorAttachFails() throws Exception
    {

        Device device = tstCreateDevice( new String[] { "org.apache.felix" } );
        Driver driver = tstCreateDriver( "org.apache.felix.driver-1.0", Device.MATCH_NONE );

        CountDownLatch attachLatch = tstExpectNoDriverFound( device );

        m_manager.driverAdded( m_osgi.getReference( driver ), driver );
View Full Code Here

        new String[] { driverId1, driverId2 },
        new int[] { 30, 3 } );

        Driver noMatcher = tstCreateDriver( notMatchingButLoadedDriverId, 100 );

        Device device = tstCreateDevice( new String[]{ "org.apache.felix" } );

        final CountDownLatch attachLatch = tstExpectAttach( drivers.get( driverId1 ), device );

        final CountDownLatch unloadDriverLatch = tstExpectUnloadDriverBundle( drivers.get ( driverId2 ) );
View Full Code Here

        new String[] { driverId1, driverId2 },
        new int[] { 30, 3 } );

        Driver noMatcher = tstCreateDriver( notMatchingButLoadedDriverId, 100 );

        Device device = tstCreateDevice( new String[]{ "org.apache.felix" } );

        final CountDownLatch attachLatch = tstExpectAttach( drivers.get( driverId1 ), device );

        final CountDownLatch unloadDriverLatch = new CountDownLatch( 1 );
       
View Full Code Here

        Map<String, Driver> drivers = tstExpectDriverLocatorFor( locator,
        new String[] { driverId1, driverId2 },
        new int[] { 20, 20 } );

        Device device = tstCreateDevice( new String[]{ "org.apache.felix" } );

        DriverSelector selector = Mockito.mock( DriverSelector.class );

        SelectorMatcher matcher = new SelectorMatcher( driverId2 );
View Full Code Here

        DriverLocator locator = Mockito.mock( DriverLocator.class, "locator" );
        Mockito.when( locator.findDrivers( Mockito.isA( Dictionary.class ) ) )
          .thenAnswer( answer );

        Device device = tstCreateDevice( new String[]
            { "org.apache.felix" } );

        final CountDownLatch latch2 = new CountDownLatch( 1 );

        Answer<Object> answer2 = new Answer<Object>()
View Full Code Here

                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 ) ) )
View Full Code Here

TOP

Related Classes of org.osgi.service.device.Device

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.