Package org.osgi.service.device

Examples of org.osgi.service.device.DriverSelector.select()


            }

            // Maybe use driver selector instead
            DriverSelector ds = selector;
            if (ds != null) {
                int ix = ds.select(dev, sel);
                if (ix == DriverSelector.SELECT_NONE) {
                    tellNotFound(dev);
                    return;
                }
                try {
View Full Code Here


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

        SelectorMatcher matcher = new SelectorMatcher( driverId2 );

        Mockito.when( selector.select(
            Mockito.eq( m_osgi.getReference( device ) ),
            Mockito.isA(Match[].class) ) ).thenAnswer( matcher );

        final CountDownLatch attachLatch = tstExpectAttach( drivers.get( driverId2 ), device );
View Full Code Here

    {
     
      ServiceReference deviceRef = Mockito.mock(ServiceReference.class);
      DriverSelector selector = Mockito.mock(DriverSelector.class);

      Mockito.when(selector.select(Mockito.eq(deviceRef), Mockito.isA(Match[].class)))
        .thenThrow(new IllegalArgumentException("test"));
     
        Match match = m_matcherImpl.selectBestMatch(deviceRef, selector);
        Assert.assertNull( match );
View Full Code Here

        add( "org.apache.felix.driver-1.5", 1 );
       
       
       
        //this is the actual driverselector implementation
        Mockito.when( selector.select( Mockito.isA(ServiceReference.class), Mockito.isA(Match[].class) ) )
          .thenAnswer( new Answer<Integer>()
        {
         
          public Integer answer(InvocationOnMock invocation) throws Throwable
            {
View Full Code Here

    {

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

        Mockito.when( selector.select( Mockito.eq( deviceRef ), Mockito.isA(Match[].class) ) )
            .thenThrow( new RuntimeException( "test exception" ) );

        add( "org.apache.felix.driver-1.5", 1 );

        Match match = m_matcherImpl.selectBestMatch( deviceRef, selector );
View Full Code Here

    {

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

        Mockito.when( selector.select( Mockito.eq( deviceRef ), Mockito.isA(Match[].class) ) )
            .thenReturn( 0 );

        add( "org.apache.felix.driver-1.5", 2 );

        Match match = m_matcherImpl.selectBestMatch( deviceRef, selector );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.