Examples of PartEventType


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

   * {@link PartEventTypeMerger#isMergeable(PartEventType, PartEventType)}
   * should return false instead of failing.
   */
  @Test
  public void testIsMerageable_bothParamGetPartIdReturnsNull() {
    PartEventType t1 = new PartEventType();
    t1.setPartId(null);
    PartEventType t2 = new PartEventType();
    t2.setPartId(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.PartEventType

   * {@link PartEventTypeMerger#isMergeable(PartEventType, PartEventType)}
   * should return false instead of failing.
   */
  @Test
  public void testIsMerageable_firstParamGetPartIdReturnsNull() {
    PartEventType t1 = new PartEventType();
    t1.setPartId(null);
    PartEventType t2 = new PartEventType();
    t2.setPartId("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.PartEventType

   * {@link PartEventTypeMerger#isMergeable(PartEventType, PartEventType)}
   * should return false instead of failing.
   */
  @Test
  public void testIsMerageable_secondParamGetPartIdReturnsNull() {
    PartEventType t1 = new PartEventType();
    t1.setPartId("notNull");
    PartEventType t2 = new PartEventType();
    t2.setPartId(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.PartEventType

    }
  }

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

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

    t2.setPartId(t1.getPartId());
    assertTrue(merger.isMergeable(t1, t2));
  }
View Full Code Here

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

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

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

    PartEventType t2 = createTargetTypeDiff();
    t2.setPartId(t1.getPartId());
    t2.setDuration(3000);

    String partId = t1.getPartId();
    long totalDuration = t1.getDuration() + t2.getDuration();

    PartEventType result = merger.merge(t1, t2);
    assertEquals(partId, result.getPartId());
    assertEquals(totalDuration, result.getDuration());
  }
View Full Code Here

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

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

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

    return new PartEventTypeMerger();
  }

  @Override
  protected PartEventType createTargetType() {
    PartEventType type = new PartEventType();
    type.setDuration(19834);
    type.setPartId("com.org.net.abc");
    return type;
  }
View Full Code Here

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

    return type;
  }

  @Override
  protected PartEventType createTargetTypeDiff() {
    PartEventType type = new PartEventType();
    type.setDuration(123);
    type.setPartId("apple.pear.orange");
    return type;
  }
View Full Code Here

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

    return new PartEventListType();
  }

  @Override
  protected PartEventType createElement() {
    PartEventType type = new PartEventType();
    type.setDuration(11);
    type.setPartId("am.an.id");
    return type;
  }
View Full Code Here

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

    assertThat(data, hasItems("1", "2"));
  }

  @Test(expected = NullPointerException.class)
  public void testMerge_collectionAndElement_collectionNull() {
    Mergers.merge(new PartEventTypeMerger(), null, new PartEventType());
  }
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.