Examples of PerspectiveEventType


Examples of rabbit.data.internal.xml.schema.events.PerspectiveEventType

    return new PerspectiveEventListType();
  }

  @Override
  protected PerspectiveEventType createElement() {
    PerspectiveEventType type = new PerspectiveEventType();
    type.setDuration(11);
    type.setPerspectiveId("abc");
    return type;
  }
View Full Code Here

Examples of rabbit.data.internal.xml.schema.events.PerspectiveEventType

   * {@link PerspectiveEventTypeMerger#isMergeable(PerspectiveEventType, PerspectiveEventType)}
   * should return false (as not mergeable) instead of failing.
   */
  @Test
  public void testIsMerageable_bothParamGetPerspectiveIdReturnsNull() {
    PerspectiveEventType t1 = new PerspectiveEventType();
    t1.setPerspectiveId(null);
    PerspectiveEventType t2 = new PerspectiveEventType();
    t2.setPerspectiveId(null);

    try {
      assertFalse(merger.isMergeable(t1, t2));
    } catch (Exception e) {
      fail("Should return false instead of exception");
View Full Code Here

Examples of rabbit.data.internal.xml.schema.events.PerspectiveEventType

   * {@link PerspectiveEventTypeMerger#isMergeable(PerspectiveEventType, PerspectiveEventType)}
   * should return false instead of failing.
   */
  @Test
  public void testIsMerageable_firstParamGetPerspectiveIdReturnsNull() {
    PerspectiveEventType t1 = new PerspectiveEventType();
    t1.setPerspectiveId(null);
    PerspectiveEventType t2 = new PerspectiveEventType();
    t2.setPerspectiveId("NotNull");

    try {
      assertFalse(merger.isMergeable(t1, t2));
    } catch (Exception e) {
      fail("Should return false instead of exception");
View Full Code Here

Examples of rabbit.data.internal.xml.schema.events.PerspectiveEventType

   * {@link PerspectiveEventTypeMerger#isMergeable(PerspectiveEventType, PerspectiveEventType)}
   * should return false instead of failing.
   */
  @Test
  public void testIsMerageable_secondParamGetPerspectiveIdReturnsNull() {
    PerspectiveEventType t1 = new PerspectiveEventType();
    t1.setPerspectiveId("NotNull");
    PerspectiveEventType t2 = new PerspectiveEventType();
    t2.setPerspectiveId(null);

    try {
      assertFalse(merger.isMergeable(t1, t2));
    } catch (Exception e) {
      fail("Should return false instead of exception");
View Full Code Here

Examples of rabbit.data.internal.xml.schema.events.PerspectiveEventType

    return new PerspectiveEventTypeMerger();
  }

  @Override
  protected PerspectiveEventType createTargetType() {
    PerspectiveEventType type = new PerspectiveEventType();
    type.setDuration(19834);
    type.setPerspectiveId("abc.1234");
    return type;
  }
View Full Code Here

Examples of rabbit.data.internal.xml.schema.events.PerspectiveEventType

    return type;
  }

  @Override
  protected PerspectiveEventType createTargetTypeDiff() {
    PerspectiveEventType type = new PerspectiveEventType();
    type.setDuration(98);
    type.setPerspectiveId("1234567890");
    return type;
  }
View Full Code Here

Examples of rabbit.data.internal.xml.schema.events.PerspectiveEventType

    return type;
  }

  @Override
  public void testIsMergeable() throws Exception {
    PerspectiveEventType t1 = createTargetType();
    PerspectiveEventType t2 = createTargetTypeDiff();

    assertTrue(merger.isMergeable(t1, t1));
    assertFalse(merger.isMergeable(t1, t2));

    t2.setPerspectiveId(t1.getPerspectiveId());
    assertTrue(merger.isMergeable(t1, t2));
  }
View Full Code Here

Examples of rabbit.data.internal.xml.schema.events.PerspectiveEventType

    assertTrue(merger.isMergeable(t1, t2));
  }

  @Override
  public void testMerge() throws Exception {
    PerspectiveEventType t1 = createTargetType();
    t1.setDuration(100);

    PerspectiveEventType t2 = createTargetTypeDiff();
    t2.setPerspectiveId(t1.getPerspectiveId());
    t2.setDuration(3000);

    String perspectiveId = t1.getPerspectiveId();
    long totalDuration = t1.getDuration() + t2.getDuration();

    PerspectiveEventType result = merger.merge(t1, t2);
    assertEquals(perspectiveId, result.getPerspectiveId());
    assertEquals(totalDuration, result.getDuration());
  }
View Full Code Here

Examples of rabbit.data.internal.xml.schema.events.PerspectiveEventType

  public void testMerge_notModifyParams() throws Exception {
    String perspectiveId = "amAnCommandId";
    int duration1 = 10010;
    int duration2 = 187341;
   
    PerspectiveEventType type1 = new PerspectiveEventType();
    type1.setPerspectiveId(perspectiveId);
    type1.setDuration(duration1);
    PerspectiveEventType type2 = new PerspectiveEventType();
    type2.setPerspectiveId(perspectiveId);
    type2.setDuration(duration2);
   
    PerspectiveEventType result = merger.merge(type1, type2);
    assertNotSame(type1, result);
    assertNotSame(type2, result);
    assertEquals(perspectiveId, type1.getPerspectiveId());
    assertEquals(duration1, type1.getDuration());
    assertEquals(perspectiveId, type2.getPerspectiveId());
View Full Code Here

Examples of rabbit.data.internal.xml.schema.events.PerspectiveEventType

  @Override
  public void testConvert() throws Exception {
    PerspectiveEvent event = new PerspectiveEvent(new Interval(0, 1),
        getPerspective());
    PerspectiveEventType type = converter.convert(event);
    assertEquals(event.getInterval().toDurationMillis(), type.getDuration());
    assertEquals(event.getPerspective().getId(), type.getPerspectiveId());
  }
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.