Examples of DriverLocator


Examples of org.osgi.service.device.DriverLocator

        // Populate matches with driver locator recommendations
        DriverLocator[] dla = locators;
        if (dla != null) {
            for (int i = 0; i < dla.length; i++) {
                try {
                    DriverLocator dl = dla[i];
                    String[] dria = dl.findDrivers(props);
                    for (int j = 0; j < dria.length; j++) {
                        String dri = dria[j];
                        MatchImpl m = null;
                        for (int k = 0; k < matches.size(); k++) {
                            m = (MatchImpl) matches.elementAt(k);
View Full Code Here

Examples of org.osgi.service.device.DriverLocator

     */
    @Test
    public void LocatorAdded()
    {

        DriverLocator locator = Mockito.mock( DriverLocator.class );
        m_manager.locatorAdded( locator );

    }
View Full Code Here

Examples of org.osgi.service.device.DriverLocator

     */
    @Test
    public void LocatorRemoved()
    {

        DriverLocator locator = Mockito.mock( DriverLocator.class );

        m_manager.locatorAdded( locator );
        m_manager.locatorRemoved( locator );

    }
View Full Code Here

Examples of org.osgi.service.device.DriverLocator

        final String driverId1 = "org.apache.felix.driver-1.0";
        final String driverId2 = "org.apache.felix.driver-1.1";
        final String notMatchingButLoadedDriverId = "dotorg.apache.felix.driver-1.0";


        DriverLocator locator = Mockito.mock( DriverLocator.class );

        Map<String, Driver> drivers = tstExpectDriverLocatorFor( locator,
        new String[] { driverId1, driverId2 },
        new int[] { 30, 3 } );
View Full Code Here

Examples of org.osgi.service.device.DriverLocator

        final String driverId1 = "org.apache.felix.driver-1.0";
        final String driverId2 = "org.apache.felix.driver-1.1";
        final String notMatchingButLoadedDriverId = "dotorg.apache.felix.driver-1.0";


        DriverLocator locator = Mockito.mock( DriverLocator.class );

        Map<String, Driver> drivers = tstExpectDriverLocatorFor( locator,
        new String[] { driverId1, driverId2 },
        new int[] { 30, 3 } );
View Full Code Here

Examples of org.osgi.service.device.DriverLocator

    {

        final String driverId1 = "org.apache.felix.driver-1.0";
        final String driverId2 = "org.apache.felix.driver-1.1";

        DriverLocator locator = Mockito.mock( DriverLocator.class );

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

Examples of org.osgi.service.device.DriverLocator

                latch.countDown();
                throw new RuntimeException( "test exception" );
            }
        };

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

Examples of org.osgi.service.device.DriverLocator

        String[] driverIds = new String[]
            { "org.apache.felix.driver-1.0", "org.apache.felix.driver-1.1" };
       
        int[] driverMatches = new int[]{ 1, Device.MATCH_NONE };
       
        DriverLocator locator = Mockito.mock( DriverLocator.class, "locator for v1.x" );
        Map<String, Driver> drivers = tstExpectDriverLocatorFor( locator, driverIds, driverMatches );

       
        DriverLocator locatorv2 = Mockito.mock( DriverLocator.class, "locator for v2.x (fails always)" );
        Mockito.when( locatorv2.findDrivers( Mockito.isA( Dictionary.class ) ) )
          .thenReturn( null );

        Mockito.when( locatorv2.loadDriver( Mockito.startsWith( "org.apache.felix.driver-1" ) ) )
        .thenReturn( null );
       
        InputStream referredInputStream = Mockito.mock(InputStream.class);
        Mockito.when( locatorv2.loadDriver( referredDriver ) ).thenReturn( referredInputStream );


        //this is what initial driver referral eventually leads
        //to: the loading of a driver bundle
        //we fake it, so that it fails
View Full Code Here

Examples of org.osgi.service.device.DriverLocator

    }


    private DriverLocator tstExpectDriverIdsFor(String[] ids) {
     
        DriverLocator dl = Mockito.mock(DriverLocator.class );
        Mockito.when( dl.findDrivers( Mockito.isA(Dictionary.class) ) ).thenReturn( ids );
        return dl;
    }
View Full Code Here

Examples of org.osgi.service.device.DriverLocator

    public void findDriversWithDriverLocator()
    {

        List<DriverLocator> locators = new ArrayList<DriverLocator>();

        DriverLocator dl = tstExpectDriverIdsFor(
            new String[] { "org.apache.felix.driver-1.0", "org.apache.felix.driver-1.1" } );

        locators.add( dl );

        Properties dict = new Properties();
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.