Examples of LaunchEventType


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

    int duration1 = 10010;
    int duration2 = 187341;
    Set<String> fileIds1 = new HashSet<String>(Arrays.asList("a", "b"));
    Set<String> fileIds2 = new HashSet<String>(Arrays.asList("1"));
   
    LaunchEventType type1 = new LaunchEventType();
    type1.setName(name);
    type1.setLaunchTypeId(type);
    type1.setLaunchModeId(mode);
    type1.setCount(count1);
    type1.setTotalDuration(duration1);
    type1.getFilePath().addAll(fileIds1);
    LaunchEventType type2 = new LaunchEventType();
    type2.setName(name);
    type2.setLaunchTypeId(type);
    type2.setLaunchModeId(mode);
    type2.setCount(count2);
    type2.setTotalDuration(duration2);
    type2.getFilePath().addAll(fileIds2);
   
    LaunchEventType result = merger.merge(type1, type2);
    assertNotSame(type1, result);
    assertNotSame(type2, result);
    assertEquals(name, type1.getName());
    assertEquals(mode, type1.getLaunchModeId());
    assertEquals(type, type1.getLaunchTypeId());
View Full Code Here

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

    return new LaunchEventTypeMerger();
  }

  @Override
  protected LaunchEventType createTargetType() {
    LaunchEventType type = new LaunchEventType();
    type.setCount(1);
    type.setLaunchModeId("someModeId");
    type.setLaunchTypeId("someTypeId");
    type.setName("aName");
    type.setTotalDuration(1999);
    type.getFilePath().add("1");
    type.getFilePath().add("2");
    return type;
  }
View Full Code Here

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

    return type;
  }

  @Override
  protected LaunchEventType createTargetTypeDiff() {
    LaunchEventType type = new LaunchEventType();
    type.setCount(1111);
    type.setLaunchModeId("someModeId111111");
    type.setLaunchTypeId("someTypeId111111");
    type.setName("aName11111");
    type.setTotalDuration(1999111);
    type.getFilePath().add("A");
    return type;
  }
View Full Code Here

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

    return type;
  }

  @Override
  protected LaunchEventType createElement() {
    LaunchEventType type = new LaunchEventType();
    type.setTotalDuration(10);
    type.setLaunchModeId(ILaunchManager.RUN_MODE);
    type.setName("name");
    type.setLaunchTypeId("type");
    type.setCount(1);
    return type;
  }
View Full Code Here

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

public class LaunchEventTypeMergerTest extends
    AbstractMergerTest<LaunchEventType> {

  @Override
  public void testIsMergeable() throws Exception {
    LaunchEventType t1 = createTargetType();
    LaunchEventType t2 = createTargetType();
    assertTrue(merger.isMergeable(t1, t2));

    t2 = createTargetTypeDiff();
    assertFalse(merger.isMergeable(t1, t2));

    // Launch mode ID:
    t2 = createTargetType();
    assertTrue(merger.isMergeable(t1, t2));
    t2.setLaunchModeId(t2.getLaunchModeId() + ".");
    assertFalse(merger.isMergeable(t1, t2));

    // Launch type ID:
    t2 = createTargetType();
    assertTrue(merger.isMergeable(t1, t2));
    t2.setLaunchTypeId(t2.getLaunchTypeId() + ".");
    assertFalse(merger.isMergeable(t1, t2));

    // Name:
    t2 = createTargetType();
    assertTrue(merger.isMergeable(t1, t2));
    t2.setName(t2.getName() + ".");
    assertFalse(merger.isMergeable(t1, t2));
  }
View Full Code Here

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

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

  @Test
  public void testIsMergeable_bothParamGetLaunchModeIdReturnsNull() {
    LaunchEventType t1 = createTargetType();
    t1.setLaunchModeId(null);
    LaunchEventType t2 = createTargetType();
    t2.setLaunchModeId(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.LaunchEventType

  public LaunchEventConverter() {}

  @Override
  protected LaunchEventType doConvert(LaunchEvent element) {
    LaunchEventType type = new LaunchEventType();
    for (IPath path : element.getFilePaths()) {
      type.getFilePath().add(path.toString());
    }
    type.setTotalDuration(element.getInterval().toDurationMillis());
    type.setName(element.getLaunchConfiguration().getName());
    type.setLaunchTypeId(element.getLaunchConfigurationType().getIdentifier());
    type.setLaunchModeId(element.getLaunch().getLaunchMode());
    type.setCount(1);

    return type;
  }
View Full Code Here

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

        && (t1.getLaunchTypeId().equals(t2.getLaunchTypeId()));
  }

  @Override
  protected LaunchEventType doMerge(LaunchEventType t1, LaunchEventType t2) {
    LaunchEventType result = new LaunchEventType();
    result.setLaunchModeId(t1.getLaunchModeId());
    result.setLaunchTypeId(t1.getLaunchTypeId());
    result.setName(t1.getName());
    result.setCount(t1.getCount() + t2.getCount());
    result.setTotalDuration(t1.getTotalDuration() + t2.getTotalDuration());

    Set<String> fileIds = Sets.newLinkedHashSet(t1.getFilePath());
    fileIds.addAll(t2.getFilePath());
    result.getFilePath().addAll(fileIds);
    return result;
  }
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.