Пример #1
0
  @Test
  public void testGetClusterPhotos() throws FlickrException {

    TagsInterface iface = flickr.getTagsInterface();
    PhotoList<Photo> photos = iface.getClusterPhotos("ducati", "999-1098-848");
    assertEquals(23, photos.getTotal());
  }
Пример #2
0
  @Test
  public void testGetListUserRaw() throws FlickrException {

    TagsInterface iface = flickr.getTagsInterface();
    Collection<TagRaw> tags = iface.getListUserRaw();
    assertNotNull(tags);
    assertFalse(tags.isEmpty());
  }
Пример #3
0
  @Test
  public void testGetHotList() throws FlickrException {

    TagsInterface iface = flickr.getTagsInterface();
    Collection<HotlistTag> tags = iface.getHotList("day", 20);
    assertNotNull(tags);
    assertTrue(tags.size() > 1);
  }
Пример #4
0
  @Test
  public void testGetRelated() throws FlickrException {

    TagsInterface iface = flickr.getTagsInterface();
    RelatedTagsList relatedTags = iface.getRelated("flower");
    assertNotNull(relatedTags);
    assertEquals("flower", relatedTags.getSource());
    assertTrue("Number of related tags returned was 0", relatedTags.size() > 0);
  }
Пример #5
0
  @Test
  public void testGetListPhoto() throws FlickrException {

    TagsInterface iface = flickr.getTagsInterface();
    Photo photo = iface.getListPhoto(testProperties.getPhotoId());
    assertNotNull(photo);
    assertEquals(testProperties.getPhotoId(), photo.getId());
    assertNotNull(photo.getTags());
    assertFalse(photo.getTags().isEmpty());
  }
Пример #6
0
  @Test
  public void testListUserPopular() throws FlickrException {

    TagsInterface iface = flickr.getTagsInterface();
    Collection<Tag> tags = iface.getListUserPopular(testProperties.getNsid());
    assertNotNull(tags);
    assertEquals(10, tags.size());
    for (Tag tag : tags) {
      assertNotNull(tag.getValue());
    }
  }
Пример #7
0
  @Test
  public void testGetClusters() throws FlickrException {

    TagsInterface iface = flickr.getTagsInterface();
    ClusterList clusters = iface.getClusters("api");
    // System.out.println("size " + clusters.getClusters().get(2).getTags().size());
    assertTrue(clusters.getClusters().size() >= 3);
    Cluster cluster = clusters.getClusters().get(0);
    assertTrue(cluster.getTags().size() >= 1);
    cluster = clusters.getClusters().get(1);
    assertTrue(cluster.getTags().size() >= 1);
    cluster = clusters.getClusters().get(2);
    assertTrue(cluster.getTags().size() >= 1);
  }