Examples of AbstractDeviceRepositoryAccessor


Examples of com.volantis.devrep.repository.impl.accessors.AbstractDeviceRepositoryAccessor

        TemporaryFileManager manager = new TemporaryFileManager(
                RUNTIME_REPOSITORY_CREATOR);
        manager.executeWith(new TemporaryFileExecutor() {
            public void execute(File deviceRepositoryFile) throws Exception {

                AbstractDeviceRepositoryAccessor accessor =
                        createAccessor(deviceRepositoryFile);

                Set expectedChildren = new HashSet();
                Set actualChildren = new HashSet();
                Map fallbacks = getExpectedDeviceFallbacks();
                Iterator i = fallbacks.keySet().iterator();

                if (deviceName == null) {
                    throw new IllegalArgumentException("test case fault");
                }

                RepositoryEnumeration childrenEnum =
                    accessor.enumerateDevicesChildren(createConnection(),
                            deviceName);

                while (i.hasNext()) {
                    String name = (String)i.next();
                    String fallback = (String)fallbacks.get(name);
View Full Code Here

Examples of com.volantis.devrep.repository.impl.accessors.AbstractDeviceRepositoryAccessor

        TemporaryFileManager manager = new TemporaryFileManager(
                new TestDeviceRepositoryCreator());
        manager.executeWith(new TemporaryFileExecutor() {
            public void execute(File deviceRepositoryFile) throws Exception {

                AbstractDeviceRepositoryAccessor accessor =
                        createAccessor(deviceRepositoryFile);

                test.runTest(accessor, null);
            }
        });
View Full Code Here

Examples of com.volantis.devrep.repository.impl.accessors.AbstractDeviceRepositoryAccessor

        TemporaryFileManager manager = new TemporaryFileManager(
                new TestDeviceRepositoryCreator());
        manager.executeWith(new TemporaryFileExecutor() {
            public void execute(final File repository) throws Exception {

                AbstractDeviceRepositoryAccessor accessor =
                        createAccessor(repository);

                accessor.initializeDevicePatternCache(null);

                // Access a device for which an initial KeyInfo was set up
                String devName = accessor.retrieveMatchingDeviceName("profile: http://nds.nokia.com/uaprof/N6210r100.xml");
                assertEquals("Nokia 6210 should be retrieved by UAProf URI",
                        "Nokia-6210", devName);

                // Access a device which will be in the default profile bucket
                devName = accessor.retrieveMatchingDeviceName("profile: http://device.sprintpcs.com/Handspring/HSTR300HK");
                assertEquals("Handspring should be retrieved by UAProf URI",
                        "SprintPCS-HSTR-300", devName);

                // Attempt to access a non-existent device
                devName = accessor.retrieveMatchingDeviceName("profile: http://www.volantis.com/uaprof/NoSuchPhone.xml");
                assertNull("No device should be retrieved for unknown UAProf URI",
                        devName);
            }
        });
    }
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.