Examples of BrowserType


Examples of net.sf.uadetector.internal.data.domain.BrowserType

  public void appendBrowserBuilder_successful_withoutPattern() {
    final DataBuilder d = new DataBuilder().setVersion("test version");
    final Browser.Builder b1 = new Browser.Builder();
    b1.setId(1);
    b1.setFamilyName(UserAgentFamily.FIREFOX.getName());
    b1.setType(new BrowserType(1, "Browser"));
    assertThat(d.appendBrowserBuilder(b1)).isSameAs(d);
    final Browser.Builder b2 = new Browser.Builder();
    b2.setId(2);
    b2.setFamilyName(UserAgentFamily.CHROME.getName());
    b2.setType(new BrowserType(1, "Browser"));
    assertThat(d.appendBrowserBuilder(b2)).isSameAs(d);
    final Data data = d.build();
    assertThat(data.getBrowsers()).hasSize(2);
  }
View Full Code Here

Examples of net.sf.uadetector.internal.data.domain.BrowserType

  }

  @Test
  public void appendBrowserBuilder_withTypeId() {
    final DataBuilder d = new DataBuilder().setVersion("test version");
    final BrowserType type = new BrowserType(2, "Email client");
    d.appendBrowserType(type);
    final Browser.Builder builder = new Browser.Builder();
    builder.setId(1);
    builder.setFamilyName(UserAgentFamily.FIREFOX.getName());
    builder.setTypeId(2);
View Full Code Here

Examples of net.sf.uadetector.internal.data.domain.BrowserType

    // browser builder entry
    final Browser.Builder browserBuilder = new Browser.Builder();
    browserBuilder.setId(1);
    browserBuilder.setFamilyName(UserAgentFamily.FIREFOX.getName());
    browserBuilder.setType(new BrowserType(1, "Browser"));
    d.appendBrowserBuilder(browserBuilder);
    browserBuilder.setId(2);
    browserBuilder.setFamilyName(UserAgentFamily.CHROME.getName());
    browserBuilder.setType(new BrowserType(1, "Browser"));
    d.appendBrowserBuilder(browserBuilder);

    // operating system entry
    final OperatingSystem.Builder builder = new OperatingSystem.Builder();
    builder.setId(303);
View Full Code Here

Examples of net.sf.uadetector.internal.data.domain.BrowserType

public class DataEqualsTest {

  private static Browser createBrowser(final int id) {
    final SortedSet<OperatingSystemPattern> osPatternSet = new TreeSet<OperatingSystemPattern>();
    final OperatingSystem os = new OperatingSystem(1, "n1", "f1", "iu1", osPatternSet, "p1", "pu1", "u1", "i1");
    final BrowserType browserType = new BrowserType(1, "Browser");
    return new Browser(id, UserAgentFamily.FIREBIRD, UserAgentFamily.FIREBIRD.getName(), new TreeSet<BrowserPattern>(), browserType,
        os, "icn", "iu1", "p1", "pu1", "u1");
  }
View Full Code Here

Examples of net.sf.uadetector.internal.data.domain.BrowserType

      } else if (PRODUCER.getName().equals(entry.getKey())) {
        b.setProducer(entry.getValue().getAsString());
      } else if (PRODUCER_URL.getName().equals(entry.getKey())) {
        b.setProducerUrl(entry.getValue().getAsString());
      } else if (BROWSER_TYPE_HASH.getName().equals(entry.getKey())) {
        final BrowserType type = browserTypeDeserializer.findBrowserType(entry.getValue().getAsString());
        if (type != null) {
          b.setType(type);
        }
      } else if (URL.getName().equals(entry.getKey())) {
        b.setUrl(entry.getValue().getAsString());
View Full Code Here

Examples of net.sf.uadetector.internal.data.domain.BrowserType

import org.junit.Test;

public class BrowserTypeHashCodeBuilderTest {

  protected static final BrowserType create() {
    return new BrowserType(1, "Browser");
  }
View Full Code Here

Examples of net.sf.uadetector.internal.data.domain.BrowserType

    final String infoUrl = "info url";
    final String url = "url";
    final UserAgentFamily family = UserAgentFamily.FIREFOX;
    final String producerUrl = "producer url";
    final String producer = "producer";
    final BrowserType type = new BrowserType(1, "Browser");
    final SortedSet<OperatingSystemPattern> osPatternSet = new TreeSet<OperatingSystemPattern>();
    final OperatingSystem operatingSystem = new OperatingSystem(1, "n1", "f1", "iu1", osPatternSet, "p1", "pu1", "u1", "i1");
    final SortedSet<BrowserPattern> patterns = new TreeSet<BrowserPattern>();
    patterns.add(new BrowserPattern(1, Pattern.compile("[0-9]"), 1));
    patterns.add(new BrowserPattern(2, Pattern.compile("[a-z]"), 2));
View Full Code Here

Examples of net.sf.uadetector.internal.data.domain.BrowserType

        hash = entry.getValue().getAsString();
      }
    }

    // create browser type
    BrowserType type = null;
    try {
      type = new BrowserType(counter.incrementAndGet(), name);

      // check hash when option is set
      checkHash(json, hash, type);

      // add pattern to map
View Full Code Here

Examples of net.sf.uadetector.internal.data.domain.BrowserType

  }

  @Nullable
  public BrowserType findBrowserType(@Nonnull final String hash) {
    Check.notEmpty(hash, "hash");
    final BrowserType browserType = browserTypes.get(hash);
    if (browserType == null) {
      addWarning("Can not find browser type for hash '" + hash + "'.");
    }
    return browserType;
  }
View Full Code Here

Examples of net.sf.uadetector.internal.data.domain.BrowserType

    final String infoUrl = "info url";
    final String url = "url";
    final UserAgentFamily family = UserAgentFamily.FIREFOX;
    final String producerUrl = "producer url";
    final String producer = "producer";
    final BrowserType type = new BrowserType(1, "Browser");
    final SortedSet<OperatingSystemPattern> osPatternSet = new TreeSet<OperatingSystemPattern>();
    osPatternSet.add(new OperatingSystemPattern(1, Pattern.compile("12345"), 123));
    osPatternSet.add(new OperatingSystemPattern(2, Pattern.compile("82378"), 987));
    final OperatingSystem operatingSystem = new OperatingSystem(1, "n1", "f1", "iu1", osPatternSet, "p1", "pu1", "u1", "i1");
    final SortedSet<BrowserPattern> patterns = new TreeSet<BrowserPattern>();
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.