Package com.iqser.core.model

Examples of com.iqser.core.model.Content


   
    // dummy event start and end dates
    long tomorrow = System.currentTimeMillis() / 1000 + 60L * 60L * 24L;
    long tomorrowX2 = System.currentTimeMillis() / 1000 + 60L * 60L * 48L;
   
    Content eventContent = new Content();
    eventContent.setContentUrl(URLUtils.makeContentURL("noIdYet", "event"));
    eventContent.getAttributes().add(
        new Attribute("name", "Random API Event",
            Attribute.ATTRIBUTE_TYPE_TEXT));
    eventContent.getAttributes().add(new Attribute("start_time", tomorrow + "", Attribute.ATTRIBUTE_TYPE_TEXT));
    eventContent.getAttributes().add(new Attribute("end_time", tomorrowX2 + "", Attribute.ATTRIBUTE_TYPE_TEXT));

    eventBuilder.performAction(FacebookContentProvider.ACTION_POST,
        eventContent);

    String fbid = URLUtils.getFbId(eventContent.getContentUrl());

    // status should be removed from object graph
    assertEquals(1, repository
        .getContentByProvider(contentProvider.getId()).size());
    // status should be in from Facebook
View Full Code Here


    }
  }

  public void testGetContent() {
    String contentURL = "facebook/accessTokenKey/212001712166365/event";
    Content c = eventBuilder.getContent(contentURL);

    assertEquals(contentProvider.getId(), c.getProvider());
    assertEquals(ContentTypeEnum.EVENT.name(), c.getType());
    assertEquals(contentURL, c.getContentUrl());

    assertTrue(c.getAttributes().size() > 0);

    assertEquals("212001712166365", c.getAttributeByName("id").getValue());
    assertEquals("Special meetup related to FP7 projects "
        + "Insemtives, LarKC and Planet Data",
        c.getAttributeByName("name").getValue());
   
    assertNotNull(c.getAttributeByName("start_time").getValue());
    assertNotNull(c.getAttributeByName("end_time").getValue());

    Calendar cal = Calendar.getInstance();

    long et = Long.valueOf(c.getAttributeByName("endTime").getValue()).longValue();
    cal.setTimeInMillis(et);   
   
    assertEquals(2011, cal.get(Calendar.YEAR));
    assertEquals(Calendar.AUGUST, cal.get(Calendar.MONTH));
    assertEquals(26, cal.get(Calendar.DAY_OF_MONTH));
View Full Code Here

    String subject = "Facebook for iPhone 3.0";
    String message = "\u003cimg class=\"img\" src=\"http://photos-h.ak.fbcdn.net/hphotos-ak-snc1/5650_98675398379_6628568379_2126294_254285_a.jpg\" />\u003cimg class=\"img\" src=\"http://photos-c.ak.fbcdn.net/hphotos-ak-snc1/5650_98675293379_6628568379_2126292_547965_a.jpg\" />Facebook for iPhone 3.0 is coming very soon.  I can't predict an exact date when I will submit to Apple, but I can say that I am about 98\u0025 done.  So what's new in this update?\u003cBR />\u003cBR />1. The "new" News Feed\u003cBR />2. Like\u003cBR />3. Events (including the ability to RSVP)\u003cBR />4. Notes\u003cBR />5. Pages\u003cBR />6. Create new photo albums\u003cBR />7. Upload photos to any album\u003cBR />8. Zoom into photos\u003cBR />9. Easier photo tagging\u003cBR />10. Profile Pictures albums\u003cBR />11. A new home screen for easy access to all your stuff, search, and notifications\u003cBR />12. Add your favorite profiles and pages to the home screen\u003cBR />13. Better Notifications (they link to the comments so you can reply)\u003cBR />14. Quickly call or text people right from the Friends page\u003cBR />15. Messages you are typing will be restored if you quit or are interrupted by a phone call\u003cBR />\u003cBR />The one feature everyone is asking for, Push Notifications, is in development but it won't make it into 3.0.  You can expect it in a 3.1 update later this summer.\u003cBR />\u003cBR />When I have submitted the app to Apple I will let you all know!\u003cBR />\u003cBR />- Joe\u003cBR />";

    // create facebook post
    String contentUrl = URLUtils.makeContentURL(fbid, "note");
    Content content = createDummyContentFromUrl(contentUrl);
    content.addAttribute(new Attribute("subject", subject,
        Attribute.ATTRIBUTE_TYPE_TEXT));
    content.addAttribute(new Attribute("message", message,
        Attribute.ATTRIBUTE_TYPE_TEXT));

    // check if documents exists in object graph
    assertTrue(repo.getContentByProvider(providerID, true).size() == 0);
View Full Code Here

        new ArrayList<NamedFacebookType>());

    // register behavior
    EasyMock.replay(mockFbClient);

    Content content = builder.getContent(contentUrl);

    // verify
    EasyMock.verify();

    // assertions
    assertNotNull(content);
    assertNotNull(content.getModificationDate());
    assertEquals(ContentTypeEnum.NOTE.name(), content.getType());
    assertEquals(providerID, content.getProvider());

    assertTrue(content.getAttributes().size() > 0);

    // test all attributes
    assertEquals("122788341354", content.getAttributeByName("id")
        .getValue());
    assertEquals("Facebook for iPhone",
        content.getAttributeByName("from_name").getValue());
    assertEquals("6628568379", content.getAttributeByName("from_id")
        .getValue());
    assertEquals("Facebook for iPhone 3.0",
        content.getAttributeByName("subject").getValue());

    assertNotNull(content.getAttributeByName("icon"));
    assertNotNull(content.getAttributeByName("created_time"));
    assertNotNull(content.getAttributeByName("updated_time"));

    assertNull(content.getAttributeByName("comments"));

  }
View Full Code Here

        .getResourceAsStream(path));
    return jsonMapper.toJavaList(postJsonString, clazz);
  }

  private Content createDummyContentFromUrl(String contentUrl) {
    Content content = new Content();
    content.setProvider(providerID);
    content.setContentUrl(contentUrl);

    return content;
  }
View Full Code Here

  public void testPerformPostAction() throws IOException, IQserException {
    String STATUS_FBID = "122788341354";

    // create facebook post
    String contentUrl = URLUtils.makeContentURL(STATUS_FBID, ContentTypeEnum.STATUS.name());
    Content content = createDummyContentFromUrl(contentUrl);
    content.addAttribute(new Attribute("message", "test status message",
        Attribute.ATTRIBUTE_TYPE_TEXT));

    // check if documents exists in object graph
    assertTrue(repo.getContentByProvider(providerID, true).size() == 0);
View Full Code Here

        .andReturn(expectedStatus);

    // register behavior
    EasyMock.replay(mockFbClient);

    Content content = builder.getContent(contentUrl);

    // verify
    EasyMock.verify();

    // assertions
    assertNotNull(content);
    assertNotNull(content.getModificationDate());
    assertEquals(ContentTypeEnum.STATUS.name(), content.getType());
    assertEquals(providerID, content.getProvider());

    assertTrue(content.getAttributes().size() > 0);

    // test all attributes
    assertEquals("George Boosley", content.getAttributeByName("from_name")
        .getValue());
    assertEquals("543824877", content.getAttributeByName("from_id")
        .getValue());

    assertNotNull(content.getAttributeByName("likes"));
    assertNotNull(content.getAttributeByName("comments"));
  }
View Full Code Here

        .getResourceAsStream(path));
    return jsonMapper.toJavaList(postJsonString, clazz);
  }

  private Content createDummyContentFromUrl(String contentUrl) {
    Content content = new Content();
    content.setProvider(providerID);
    content.setContentUrl(contentUrl);

    return content;
  }
View Full Code Here

    long tomorrowX2 = System.currentTimeMillis() / 1000 + 60L * 60L * 48L;

    // create facebook post
    String contentUrl = URLUtils.makeContentURL(STATUS_FBID,
        ContentTypeEnum.EVENT.name());
    Content content = createDummyContentFromUrl(contentUrl);
    content.addAttribute(new Attribute("owner", "George Boosley",
        Attribute.ATTRIBUTE_TYPE_TEXT));
    content.addAttribute(new Attribute("name", "TestEvent",
        Attribute.ATTRIBUTE_TYPE_TEXT));
    content.addAttribute(new Attribute("description", "some test event",
        Attribute.ATTRIBUTE_TYPE_TEXT));
    content.addAttribute(new Attribute("startTime", tomorrow + "",
        Attribute.ATTRIBUTE_TYPE_TEXT));
    content.addAttribute(new Attribute("endTime", tomorrowX2 + "",
        Attribute.ATTRIBUTE_TYPE_TEXT));

    // check if documents exists in object graph
    assertTrue(repo.getContentByProvider(providerID, true).size() == 0);

View Full Code Here

            EasyMock.eq(FacebookType.class))).andReturn(eventUsers)
        .anyTimes();
    // register behavior
    EasyMock.replay(mockFbClient);

    Content content = builder.getContent(contentUrl);

    // verify
    EasyMock.verify();

    // assertions
    assertNotNull(content);
    assertNotNull(content.getModificationDate());
    assertEquals(ContentTypeEnum.EVENT.name(), content.getType());
    assertEquals(providerID, content.getProvider());

    assertTrue(content.getAttributes().size() > 0);

    // test all attributes
    assertEquals(
        "Special meetup related to FP7 projects Insemtives, LarKC and Planet Data",
        content.getAttributeByName("name").getValue());
    assertEquals("212001712166365", content.getAttributeByName("id")
        .getValue());

  }
View Full Code Here

TOP

Related Classes of com.iqser.core.model.Content

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.