Examples of ActivityDTO


Examples of org.eurekastreams.server.domain.stream.ActivityDTO

        HashMap<String, String> testValueMap = new HashMap<String, String>();
        testValueMap.put("content", longString);
        testValueMap.put("targetTitle", "title");
        testValueMap.put("targetUrl", "testurl");

        testActivity = new ActivityDTO();
        testActivity.setBaseObjectType(BaseObjectType.BOOKMARK);
        testActivity.setBaseObjectProperties(testValueMap);

        sut.validate(testActivity);
    }
View Full Code Here

Examples of org.eurekastreams.server.domain.stream.ActivityDTO

    {
        HashMap<String, String> testValueMap = new HashMap<String, String>();
        testValueMap.put("content", "good content");
        testValueMap.put("targetUrl", "testurl");

        testActivity = new ActivityDTO();
        testActivity.setBaseObjectType(BaseObjectType.BOOKMARK);
        testActivity.setBaseObjectProperties(testValueMap);

        sut.validate(testActivity);
    }
View Full Code Here

Examples of org.eurekastreams.server.domain.stream.ActivityDTO

    {
        HashMap<String, String> testValueMap = new HashMap<String, String>();
        testValueMap.put("content", "good content");
        testValueMap.put("targetTitle", "title");

        testActivity = new ActivityDTO();
        testActivity.setBaseObjectType(BaseObjectType.BOOKMARK);
        testActivity.setBaseObjectProperties(testValueMap);

        sut.validate(testActivity);
    }
View Full Code Here

Examples of org.eurekastreams.server.domain.stream.ActivityDTO

     * Test.
     */
    @Test
    public void test1()
    {
        final ActivityDTO a1 = context.mock(ActivityDTO.class, "a1");
        final ActivityDTO a2 = context.mock(ActivityDTO.class, "a2");
        final ActivityDTO a3 = context.mock(ActivityDTO.class, "a3");
        final ActivityDTO a4 = context.mock(ActivityDTO.class, "a4");

        final CommentDTO c1 = context.mock(CommentDTO.class, "c1");
        final CommentDTO c2 = context.mock(CommentDTO.class, "c2");
        final CommentDTO c3 = context.mock(CommentDTO.class, "c3");
        final CommentDTO c4 = context.mock(CommentDTO.class, "c4");
View Full Code Here

Examples of org.eurekastreams.server.domain.stream.ActivityDTO

     * Test.
     */
    @Test
    public void test2()
    {
        final ActivityDTO a1 = context.mock(ActivityDTO.class, "a1");
        final ActivityDTO a2 = context.mock(ActivityDTO.class, "a2");

        final DomainMapper personMapper = context.mock(DomainMapper.class, "personMapper");

        context.checking(new Expectations()
        {
View Full Code Here

Examples of org.sonar.core.activity.db.ActivityDto

  }

  @Test
  public void fail_insert_missing_type() {
    String testValue = "hello world";
    ActivityDto log = ActivityDto.createFor(testValue);
    try {
      dao.insert(session, log);
    } catch (IllegalArgumentException e) {
      assertThat(e.getMessage()).isEqualTo("Type must be set");
    }
View Full Code Here

Examples of org.sonar.core.activity.db.ActivityDto


  @Test
  public void fail_insert_missing_author() {
    String testValue = "hello world";
    ActivityDto log = ActivityDto.createFor(testValue)
      .setType(Activity.Type.QPROFILE);
    try {
      dao.insert(session, log);
    } catch (IllegalArgumentException e) {
      assertThat(e.getMessage()).isEqualTo("Type must be set");
View Full Code Here

Examples of org.sonar.core.activity.db.ActivityDto

  }

  @Test
  public void insert_text_log() {
    String testValue = "hello world";
    ActivityDto log = ActivityDto.createFor(testValue)
      .setType(Activity.Type.QPROFILE)
      .setAuthor("jUnit");
    dao.insert(session, log);

    ActivityDto newDto = Iterables.getFirst(dao.findAll(session), null);
    assertThat(newDto).isNotNull();
    assertThat(newDto.getAuthor()).isEqualTo(log.getAuthor());
    assertThat(newDto.getMessage()).isEqualTo(testValue);
  }
View Full Code Here

Examples of org.sonar.core.activity.db.ActivityDto

  @Test
  public void insert_loggable_log() {
    final String testKey = "message";
    final String testValue = "hello world";
    ActivityDto log = ActivityDto.createFor(new ActivityLog() {

      @Override
      public Map<String, String> getDetails() {
        return ImmutableMap.of(testKey, testValue);
      }

      @Override
      public String getAction() {
        return "myAction";
      }
    })
      .setAuthor("jUnit")
      .setType(Activity.Type.QPROFILE);

    dao.insert(session, log);

    ActivityDto newDto = Iterables.getFirst(dao.findAll(session), null);
    assertThat(newDto).isNotNull();
    assertThat(newDto.getAuthor()).isEqualTo(log.getAuthor());
    assertThat(newDto.getData()).isNotNull();
    Map<String, String> details = KeyValueFormat.parse(newDto.getData());
    assertThat(details.get(testKey)).isEqualTo(testValue);
  }
View Full Code Here

Examples of org.sonar.core.activity.db.ActivityDto

  @Test
  public void filter_by_date() throws InterruptedException {

    DateTime t0 = new DateTime().minusHours(1);
    ActivityDto activity = getActivityDto();
    activity.setCreatedAt(t0.toDate());
    dao.insert(dbSession, activity);
    activity = getActivityDto();
    activity.setCreatedAt(t0.toDate());
    dao.insert(dbSession, activity);
    dbSession.commit();
    DateTime t1 = new DateTime();
    activity = getActivityDto();
    activity.setCreatedAt(t1.toDate());
    dao.insert(dbSession, activity);
    dbSession.commit();
    DateTime t2 = new DateTime().plusHours(1);

    assertThat(service.search(new ActivityQuery(),
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.