Examples of CommandEventType


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

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

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

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

    }
  }

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

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

    t2.setCommandId(t1.getCommandId());
    assertTrue(merger.isMergeable(t1, t2));
  }
View Full Code Here

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

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

  @Override
  public void testMerge() throws Exception {
    CommandEventType t1 = createTargetType();
    t1.setCount(100);
   
    CommandEventType t2 = createTargetTypeDiff();
    t2.setCommandId(t1.getCommandId());
    t2.setCount(3000);

    String commandId = t1.getCommandId();
    int totalCount = t1.getCount() + t2.getCount();

    CommandEventType result = merger.merge(t1, t2);
    assertEquals(commandId, result.getCommandId());
    assertEquals(totalCount, result.getCount());
  }
View Full Code Here

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

  public void testMerge_notModifyParams() throws Exception {
    String commandId = "amAnCommandId";
    int count1 = 10010;
    int count2 = 187341;
   
    CommandEventType type1 = new CommandEventType();
    type1.setCommandId(commandId);
    type1.setCount(count1);
    CommandEventType type2 = new CommandEventType();
    type2.setCommandId(commandId);
    type2.setCount(count2);
   
    CommandEventType result = merger.merge(type1, type2);
    assertNotSame(type1, result);
    assertNotSame(type2, result);
    assertEquals(commandId, type1.getCommandId());
    assertEquals(count1, type1.getCount());
    assertEquals(commandId, type2.getCommandId());
View Full Code Here

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

    return new CommandEventTypeMerger();
  }

  @Override
  protected CommandEventType createTargetType() {
    CommandEventType type = new CommandEventType();
    type.setCommandId("commandIdA");
    type.setCount(1);
    return type;
  }
View Full Code Here

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

    return type;
  }

  @Override
  protected CommandEventType createTargetTypeDiff() {
    CommandEventType type = new CommandEventType();
    type.setCommandId("commandIdB");
    type.setCount(2);
    return type;
  }
View Full Code Here

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

    return new CommandEventListType();
  }

  @Override
  protected CommandEventType createElement() {
    CommandEventType type = new CommandEventType();
    type.setCommandId("abc");
    type.setCount(10);
    return type;
  }
View Full Code Here

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

  }

  @Override
  public void testConvert() throws Exception {
    CommandEvent event = createEvent();
    CommandEventType type = converter.convert(event);
    assertEquals(event.getExecutionEvent().getCommand().getId(),
        type.getCommandId());
    assertEquals(1, type.getCount());
  }
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.