Esempio n. 1
0
  @Test
  public void testConnectToEntity() {
    TalendInputEntity tie = new TalendInputEntity("job", "component1");
    assertEquals(0, tie.getNextEntitiesId().size());
    tie.connectToEntity(
        Arrays.asList("component2", "component3"), Arrays.asList("component4", "component5"));
    assertEquals(2, tie.getNextEntitiesId().size());
    assertEquals(2, tie.getTargetProxies().size());

    assertEquals(
        "component1 ("
            + GeneratorID.generateEntityID("job", "component1")
            + ") --->["
            + GeneratorID.generateNodeID("job", "component4")
            + ", "
            + GeneratorID.generateNodeID("job", "component5")
            + "]",
        tie.toString());
  }
Esempio n. 2
0
  @Test
  public void testAddNextEntity() {
    TalendInputEntity tie = new TalendInputEntity("job", "component1");
    assertEquals(0, tie.getNextEntitiesId().size());
    tie.addNextEntity("component4");
    assertEquals(1, tie.getNextEntitiesId().size());
    assertEquals("component4", tie.getNextEntitiesId().get(0));
    assertEquals(1, tie.getTargetProxies().size());

    tie.addNextEntity("component5");
    assertEquals(2, tie.getNextEntitiesId().size());
    assertEquals("component4", tie.getNextEntitiesId().get(0));
    assertEquals("component5", tie.getNextEntitiesId().get(1));
    assertEquals(2, tie.getTargetProxies().size());

    assertEquals(
        "component1 ("
            + GeneratorID.generateEntityID("job", "component1")
            + ") --->[component4, component5]",
        tie.toString());
  }