Package com.volantis.devrep.repository.impl.accessors

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


    public PolicyDescriptor getPolicyDescriptor(String policyName, Locale locale)
            throws DeviceRepositoryException {
        PolicyDescriptor descriptor = null;

        if (getCachedAccessiblePolicyNames().contains(policyName)) {
            final AbstractDeviceRepositoryAccessor abstractAccessor =
                ((AbstractDeviceRepositoryAccessor) accessor);
            final PolicyDescriptorAccessor descriptorAccessor =
                abstractAccessor.getPolicyDescriptorAccessor();
            descriptor = descriptorAccessor.getPolicyDescriptor(policyName, locale);
        }
        // else, policy name is invalid.

        // If we can't find the descriptor, we just return null.
View Full Code Here


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

                AbstractDeviceRepositoryAccessor accessor =
                        createAccessor(deviceRepositoryFile);

                Set expectedPatterns = getExpectedDevicePatterns();

                RepositoryEnumeration actualEnum =
                    accessor.enumerateDevicePatterns(createConnection());

                Set actualPatterns = new HashSet();

                while (actualEnum.hasNext()) {
                    String[] pair = (String[])actualEnum.next();
View Full Code Here

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

                AbstractDeviceRepositoryAccessor accessor =
                        createAccessor(deviceRepositoryFile);

                // Create a test connection
                RepositoryConnection connection = createConnection();

                RepositoryEnumeration enumeration = accessor.enumeratePolicyNames(connection);

                // Check successful operation of the enumeration
                assertNotNull("Enumeration over retrieved items should exist", enumeration);
                assertTrue("Should be items in the enumeration", enumeration.hasNext());
View Full Code Here

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

                final AbstractDeviceRepositoryAccessor accessor =
                        createAccessor(deviceRepositoryFile);

                // Create a test connection
                final RepositoryConnection connection = createConnection();

                final RepositoryEnumeration enumeration =
                    accessor.enumerateCategoryNames(connection);

                // Check successful operation of the enumeration
                assertNotNull("Enumeration over retrieved items should exist", enumeration);
                assertTrue("Should be items in the enumeration", enumeration.hasNext());
View Full Code Here

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

                AbstractDeviceRepositoryAccessor accessor =
                        createAccessor(deviceRepositoryFile);

                RepositoryConnection connection = createConnection();

                RepositoryEnumeration enumeration = accessor.enumerateDeviceTACs(connection);
                assertTrue("Enumeration should contain elements", enumeration.hasNext());
                DeviceTACPair dtp = (DeviceTACPair) enumeration.next();
                assertEquals("First device name should match 'Nokia-6210'",
                        "Nokia-6210", dtp.getDeviceName());
                assertEquals("First device TAC should match '350612'",
View Full Code Here

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

                AbstractDeviceRepositoryAccessor accessor =
                        createAccessor(deviceRepositoryFile);

                RepositoryConnection connection = createConnection();

                RepositoryEnumeration enumeration = accessor.enumerateDeviceTACs(connection);
                assertFalse("With no TAC data, enumeration should be empty",
                        enumeration.hasNext());
            }
        });
    }
View Full Code Here

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

                AbstractDeviceRepositoryAccessor accessor =
                        createAccessor(deviceRepositoryFile);

                // Create a test connection
                RepositoryConnection connection = createConnection();

                RepositoryEnumeration enumeration = accessor.enumeratePolicyNames(connection,
                                                                           "system");

                // Check successful operation of the enumeration
                assertNotNull("Enumeration over retrieved items should exist", enumeration);
                assertTrue("Should be items in the enumeration", enumeration.hasNext());
View Full Code Here

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

                final AbstractDeviceRepositoryAccessor accessor =
                        createAccessor(deviceRepositoryFile);

                final Locale locale = Locale.getDefault();

                // Create a test connection
                final RepositoryConnection connection = createConnection();

                CategoryDescriptor descriptor =
                        accessor.retrieveCategoryDescriptor(
                                connection, "protocol", locale);
                // Ensure the name matches as expected
                assertEquals("Descriptive name should match (boolean)",
                        descriptor.getCategoryDescriptiveName(),
                        "Protocol");

                descriptor = accessor.retrieveCategoryDescriptor(
                                connection, "audio", new Locale("de"));
                // Ensure the name matches as expected
                assertEquals("Descriptive name should match",
                        descriptor.getCategoryDescriptiveName(),
                        "Audiodaten");

                descriptor = accessor.retrieveCategoryDescriptor(
                                connection, "audio", new Locale("de", "CH"));
                // Ensure the name matches as expected
                assertEquals("Descriptive name should match",
                        descriptor.getCategoryDescriptiveName(),
                        "Audiodaten");
View Full Code Here

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

                final AbstractDeviceRepositoryAccessor accessor =
                        createAccessor(deviceRepositoryFile);

                // Create a test connection
                final RepositoryConnection connection = createConnection();

                final List descriptors =
                    accessor.retrieveCategoryDescriptors(connection, "audio");
                assertEquals(2, descriptors.size());
                final CategoryDescriptor descriptor1 =
                    (CategoryDescriptor) descriptors.get(0);
                checkLanguage(descriptor1);
                final CategoryDescriptor descriptor2 =
View Full Code Here

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

                final AbstractDeviceRepositoryAccessor accessor =
                        createAccessor(deviceRepositoryFile);

                // Create a test connection
                final RepositoryConnection connection = createConnection();

                final List descriptors =
                    accessor.retrievePolicyDescriptors(connection, "J2MEconf");
                assertEquals(2, descriptors.size());
                final PolicyDescriptor descriptor1 =
                    (PolicyDescriptor) descriptors.get(0);
                checkLanguage(descriptor1);
                final PolicyDescriptor descriptor2 =
View Full Code Here

TOP

Related Classes of com.volantis.devrep.repository.impl.accessors.AbstractDeviceRepositoryAccessor

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.