Package com.volantis.mcs.http

Examples of com.volantis.mcs.http.MutableHttpHeaders



                Device device = repository.getDevice((HttpHeaders) null);
                assertNull("No device should be found", device);

                MutableHttpHeaders headers =
                    HTTP_HEADERS_FACTORY.createHTTPHeaders();
                device = repository.getDevice(headers);
                assertNotNull("Valid device should be found", device);
                assertEquals("Device name should match", "PC",
                    device.getName());

                headers.addHeader("User-Agent", "Nokia3330/");
                device = repository.getDevice(headers);
                assertNotNull("Valid device should be found", device);
                assertEquals("Device name should match", "Nokia-3330",
                    device.getName());
             }
View Full Code Here


                // so I'm preserving this behaviuor)
                Device device = repository.getDevice((HttpHeaders) null, defaultDeviceName);
                assertNull("No device should be found", device);

                // Empty headers cause default device to be used
                MutableHttpHeaders headers =
                    HTTP_HEADERS_FACTORY.createHTTPHeaders();
                device = repository.getDevice(headers, defaultDeviceName);
                assertNotNull("Valid device should be found", device);
                assertEquals("Device name should match", defaultDeviceName,
                    device.getName());

                // Default device should be ignoired if a valid device can be extracted from headers
                headers.addHeader("User-Agent", "Nokia3330/");
                device = repository.getDevice(headers, defaultDeviceName);
                assertNotNull("Valid device should be found", device);
                assertEquals("Device name should match", "Nokia-3330",
                    device.getName());
             }
View Full Code Here

                            DeviceRepositoryFactory.getDefaultInstance();
                URL deviceRepositoryUrl = file.toURL();
                DeviceRepository repository = factory.getDeviceRepository(
                        deviceRepositoryUrl, null);

                MutableHttpHeaders mutableHeaders = HTTP_HEADERS_FACTORY.
                        createHTTPHeaders();

                Device device = repository.getDevice((HttpHeaders)null);
                assertNull("No device should be found", device);

                device = repository.getDevice(mutableHeaders);
                assertNotNull("Valid device should be found", device);
                assertEquals("Device name should match", "PC", device.getName());

                mutableHeaders.addHeader("user-agent", "Nokia3330/");
                device = repository.getDevice(mutableHeaders);
                assertNotNull("Valid device should be found", device);
                assertEquals("Name should match: ", "Nokia-3330", device.getName());
            }
        });
View Full Code Here

                            DeviceRepositoryFactory.getDefaultInstance();
                URL deviceRepositoryUrl = file.toURL();
                DeviceRepository repository = factory.getDeviceRepository(
                        deviceRepositoryUrl, null);

    MutableHttpHeaders mutableHeaders =
            HTTP_HEADERS_FACTORY.createHTTPHeaders();

    Device device = repository.getDevice((HttpHeaders)null);
    assertNull("No device should be found", device);
   
    device = repository.getDevice(mutableHeaders);
    assertNotNull("Valid device should be found", device);
    assertEquals("Device name should match",
           "PC",
           device.getName());
   
    mutableHeaders.addHeader("accept", "text/vnd.wap.wml");
    device = repository.getDevice(mutableHeaders);
   
    assertNotNull("Valid device should be found", device);
   
    assertEquals("Name should match: ",
View Full Code Here

TOP

Related Classes of com.volantis.mcs.http.MutableHttpHeaders

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.