예제 #1
0
  @Test
  public void testUndeploySucceeds() {
    TapDefinition tapDefinition = new TapDefinition("tap1", "test", "tap @test | file");
    repository.save(tapDefinition);
    final AtomicInteger deployCount = new AtomicInteger();
    final AtomicInteger undeployCount = new AtomicInteger();
    deployChannel.subscribe(
        new MessageHandler() {

          @Override
          public void handleMessage(Message<?> message) throws MessagingException {
            deployCount.getAndIncrement();
          }
        });
    undeployChannel.subscribe(
        new MessageHandler() {

          @Override
          public void handleMessage(Message<?> message) throws MessagingException {
            undeployCount.getAndIncrement();
          }
        });
    tapDeployer.deploy("tap1");
    tapDeployer.undeploy("tap1");
    assertEquals(2, deployCount.get());
    assertEquals(2, undeployCount.get());
  }
예제 #2
0
 @Test
 public void testCreateSucceeds() {
   TapDefinition tapDefinition = new TapDefinition("tap1", "test", "tap @test | file");
   streamDefinitionRepository.save(new StreamDefinition("test", "time | log"));
   tapDeployer.save(tapDefinition);
   assertTrue(repository.exists("tap1"));
 }
예제 #3
0
 @Test(expected = NoSuchDefinitionException.class)
 public void testCreateFailsIfSourceStreamDoesNotExist() {
   TapDefinition tapDefinition = new TapDefinition("tap1", "test", "tap @test | file");
   tapDeployer.save(tapDefinition);
 }
예제 #4
0
 @Test(expected = NoSuchDefinitionException.class)
 public void testDeployFailsForMissingDefinition() {
   tapDeployer.deploy("tap1");
 }