Package net.sf.uadetector.internal.data.domain

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


    b.appendRobot(null);
  }

  @Test
  public void appendRobot_successful() {
    final Robot robot = new Robot(12, "Majestic-12", UserAgentFamily.MJ12BOT, "Majestic-12 bot", "http://majestic12.co.uk/bot.php",
        "Majestic-12", "http://www.majestic12.co.uk/", "MJ12bot/v1.4.3", "mj12.png");
    final DataBuilder b = new DataBuilder();
    assertThat(b.appendRobot(robot)).isSameAs(b);

    // test to add same robot one more time
View Full Code Here


    final SortedSet<OperatingSystemPattern> osPatternSet = new TreeSet<OperatingSystemPattern>();
    return new OperatingSystem(id, "n1", "f1", "iu1", osPatternSet, "p1", "pu1", "u1", "i1");
  }

  private static final Robot createRobot(final int id) {
    return new Robot(id, "Majestic-12", UserAgentFamily.MJ12BOT, "Majestic-12 bot", "http://majestic12.co.uk/bot.php", "Majestic-12",
        "http://www.majestic12.co.uk/", "MJ12bot/v1.4.3", "mj12.png");
  }
View Full Code Here

    assertThat(data1.hashCode() == data2.hashCode()).isFalse();
  }

  @Test
  public void equals_different_robots() {
    final Robot robot1 = createRobot(1);
    final Robot robot2 = createRobot(2);
    final List<Robot> robots1 = new ArrayList<Robot>();
    robots1.add(robot1);
    robots1.add(robot2);
    final List<Robot> robots2 = new ArrayList<Robot>();
    robots2.add(robot1);
View Full Code Here

    final UserAgentFamily family = UserAgentFamily.YAHOO;
    final String familyName = "family-name";
    final String producerUrl = "producer url";
    final String producer = "producer";
    final String userAgentString = "I'm a robot";
    return new Robot(id, name, family, familyName, infoUrl, producer, producerUrl, userAgentString, icon);
  }
View Full Code Here

        b.setUserAgentString(entry.getValue().getAsString());
      }
    }

    // create robot entry
    Robot robot = null;
    try {
      robot = b.build();

      // check hash when option is set
      checkHash(json, hash, robot);
View Full Code Here

    final Device device = new Device("device-category-name", 1, Category.OTHER, "device.png", "device-info", devicePatternSet);
    devices.add(device);

    patternToDeviceMap.put(devicePattern, device);

    final Robot robot = new Robot(12, "Majestic-12", UserAgentFamily.MJ12BOT, "Majestic-12 bot", "http://majestic12.co.uk/bot.php",
        "Majestic-12", "http://www.majestic12.co.uk/", "MJ12bot/v1.4.3", "mj12.png");
    robots.add(robot);
  }
View Full Code Here

    assertThat(a.hashCode() == b.hashCode()).isFalse();
  }

  @Test
  public void equals_different_ROBOTS() {
    final Robot robot1 = new Robot(1, "n1", UserAgentFamily.BINGBOT, "fn1", "iu1", "p1", "pu1", "uas1", "icn1");
    final Data a = new DataBlueprint().robots(Lists.newArrayList(robot1)).build();

    final Robot robot2 = new Robot(2, "n2", UserAgentFamily.YAHOOFEEDSEEKER, "fn2", "iu2", "p2", "pu2", "uas2", "icn2");
    final Data b = new DataBlueprint().robots(Lists.newArrayList(robot2)).build();

    assertThat(a.equals(b)).isFalse();
    assertThat(a.hashCode() == b.hashCode()).isFalse();
  }
View Full Code Here

    final Browser browser = new Browser(1, UserAgentFamily.NCSA_MOSAIC, UserAgentFamily.NCSA_MOSAIC.getName(),
        new TreeSet<BrowserPattern>(), browserType, operatingSystem, "icn", "iu", "p", "pu", "http://www.ncsa.uiuc.edu/");
    browsers.add(browser);
    patternToBrowserMap.put(browserPattern, browser);
    browserToOperatingSystemMappings.add(new BrowserOperatingSystemMapping(browser.getId(), operatingSystem.getId()));
    final Robot robot = new Robot(123, "r-name", UserAgentFamily.MJ12BOT, "MJ-12 bot", "info-url", "prod-1", "p-url-1", "uas", "icn1");
    robots.add(robot);

    // create Data instance
    final DataBlueprint dataBlueprint = new DataBlueprint();
    dataBlueprint.browsers(browsers);
View Full Code Here

TOP

Related Classes of net.sf.uadetector.internal.data.domain.Robot

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.