Example #1
0
  @Ignore
  @Test
  public void testCreate() throws Exception {

    CommunityService svc = new CommunityService();
    Community comm = new Community();

    // using static constants allow to make assertions about them within the test client
    comm.setTitle(NEW_COMMUNITY);
    comm.setContent(TEST_COMMUNITY_DESCRIPTION);

    comm = svc.createCommunity(comm, true);
    assertEquals("NEW_COMMUNITY", comm.getTitle());
    assertEquals("TEST_COMMUNITY_DESCRIPTION", comm.getContent());
  }
Example #2
0
  @Ignore
  @Test
  public void testLoad() throws Exception {

    // test should use code in the same way we expect implementors to use it,
    // i.e. no changes at all from the java samples.

    CommunityService svc = new CommunityService();

    Collection<Community> communities = svc.getPublicCommunities();
    // some sample assertion, a proper test would be much more detailed than this
    for (Community community : communities) {
      assertNotNull(community.getTitle());
    }

    assertEquals(communities.size(), 2);
  }