コード例 #1
0
ファイル: EventTest.java プロジェクト: enonic/xp
  @Test
  public void testClone() {
    final Event event = this.createTestEvent();
    final Event clonedEvent = Event.create(event).build();

    assertEquals(event.getType(), clonedEvent.getType());
    assertEquals(event.isDistributed(), clonedEvent.isDistributed());
    assertEquals(event.getData(), clonedEvent.getData());
    assertEquals(event, clonedEvent);
  }
コード例 #2
0
ファイル: EventTest.java プロジェクト: enonic/xp
  @Test
  public void testBuilder() {
    final Event event = this.createTestEvent();

    assertEquals("type", event.getType());
    assertEquals(true, event.isDistributed());
    assertNotNull(event.getData());
    assertTrue(event.hasValue("key1"));
    assertTrue(event.hasValue("key2"));
    assertEquals("val1", event.getValue("key1").get());
    assertEquals("val2", event.getValue("key2").get());
  }