Package org.springframework.xd.test.fixtures

Examples of org.springframework.xd.test.fixtures.FileJdbcJob


  }


  @Test
  public void testJobLifecycle() throws InterruptedException {
    FileJdbcJob job = new FileJdbcJob(FileJdbcJob.DEFAULT_DIRECTORY, FileJdbcJob.DEFAULT_FILE_NAME,
        FileJdbcJob.DEFAULT_TABLE_NAME, FileJdbcJob.DEFAULT_NAMES);
    String jobName = "tjl" + UUID.randomUUID().toString();
    logger.info("Testing Job Lifecycle for: " + jobName);
    job(jobName, job.toDSL(),true);
    checkJob(jobName, job.toDSL(), true);
    undeployJob(jobName);
    checkJob(jobName, job.toDSL(), false);
  }
View Full Code Here


  @Test
  public void testJobCreateDuplicate() throws InterruptedException {
    exception.expect(SpringXDException.class);
    exception.expectMessage("Batch Job with the name " + JOB_NAME + " already exists");
    logger.info("Testing Job Create Duplicate");
    FileJdbcJob job = new FileJdbcJob(FileJdbcJob.DEFAULT_DIRECTORY, FileJdbcJob.DEFAULT_FILE_NAME,
        FileJdbcJob.DEFAULT_TABLE_NAME, FileJdbcJob.DEFAULT_NAMES);
    job(job.toDSL());
    checkJob(job.toDSL(), true);
    job(job.toDSL());
  }
View Full Code Here

  public void testJobCreateDuplicateWithDeployFalse() {
    exception.expect(SpringXDException.class);
    exception.expectMessage("There is already a job named 'jobFalseDeploy'");
    logger.info("Testing Job False Deploy");

    FileJdbcJob job = new FileJdbcJob(FileJdbcJob.DEFAULT_DIRECTORY, FileJdbcJob.DEFAULT_FILE_NAME,
        FileJdbcJob.DEFAULT_TABLE_NAME, FileJdbcJob.DEFAULT_NAMES);
    job("jobFalseDeploy", job.toDSL(),false);
    checkJob(job.toDSL(), false);
    job("jobFalseDeploy", job.toDSL(),false);
  }
View Full Code Here

    job("jobFalseDeploy", job.toDSL(),false);
  }

  @Test
  public void testJobDeployUndeployFlow() throws InterruptedException {
    FileJdbcJob job = new FileJdbcJob(FileJdbcJob.DEFAULT_DIRECTORY, FileJdbcJob.DEFAULT_FILE_NAME,
        FileJdbcJob.DEFAULT_TABLE_NAME, FileJdbcJob.DEFAULT_NAMES);
    String jobName = "tjduf" + UUID.randomUUID().toString();
    logger.info("Testing Job Deploy Undeploy Flow for: " + jobName);

    job(jobName, job.toDSL(),true);
    checkJob(jobName, job.toDSL(), true);
    undeployJob(jobName);
    checkJob(jobName, job.toDSL(), false);
    deployJob(jobName);
    checkJob(jobName, job.toDSL(), true);
    undeployJob(jobName);
  }
View Full Code Here

  public void testListStepExecutions() {
    String data = UUID.randomUUID().toString();
    String jobName = "tsle" + UUID.randomUUID().toString();

    jdbcSink.getJdbcTemplate().getDataSource();
    FileJdbcJob job = new FileJdbcJob(FileJdbcJob.DEFAULT_DIRECTORY, FileJdbcJob.DEFAULT_FILE_NAME,
        FileJdbcJob.DEFAULT_TABLE_NAME, FileJdbcJob.DEFAULT_NAMES);

    // Create a stream that writes to a file. This file will be used by the job.
    stream("dataSender", sources.http() + XD_DELIMITER
        + sinks.file(FileJdbcJob.DEFAULT_DIRECTORY, DEFAULT_FILE_NAME).toDSL());
    sources.http(getContainerHostForSource("dataSender")).postData(data);
    job(jobName, job.toDSL(),true);
    jobLaunch(jobName);
    String query = String.format("SELECT data FROM %s", tableName);

    waitForTablePopulation(query, jdbcSink.getJdbcTemplate(), 1);
View Full Code Here

   */
  @Test
  public void testPartitionedFileJdbcJob() {
    String data = UUID.randomUUID().toString();
    jdbcSink.getJdbcTemplate().getDataSource();
    FileJdbcJob job = new FileJdbcJob(FileJdbcJob.DEFAULT_DIRECTORY,
        String.format("/%spartition*", DEFAULT_FILE_NAME),
        FileJdbcJob.DEFAULT_TABLE_NAME,
        FileJdbcJob.DEFAULT_NAMES);

    for (int i = 0; i < 5; i++) {
      // Create a stream that writes to a file. This file will be used by the job.
      stream("dataSender" + i, sources.http("foobar", 9000 + i) + XD_DELIMITER
          + sinks.file(FileJdbcJob.DEFAULT_DIRECTORY, DEFAULT_FILE_NAME + "partition" + i).toDSL());
      sources.http(getContainerHostForSource("dataSender" + i), 9000 + i).postData(data);
    }
    waitForXD();
    job(job.toDSL());
    waitForXD();
    jobLaunch();

    String query = String.format("SELECT data FROM %s", tableName);
    waitForTablePopulation(query, jdbcSink.getJdbcTemplate(), 5);
View Full Code Here

   */
  @Test
  public void testFileJdbcJob() {
    String data = UUID.randomUUID().toString();
    jdbcSink.getJdbcTemplate().getDataSource();
    FileJdbcJob job = new FileJdbcJob(FileJdbcJob.DEFAULT_DIRECTORY, FileJdbcJob.DEFAULT_FILE_NAME,
        FileJdbcJob.DEFAULT_TABLE_NAME, FileJdbcJob.DEFAULT_NAMES);

    // Create a stream that writes to a file. This file will be used by the job.
    stream("dataSender", sources.http() + XD_DELIMITER
        + sinks.file(FileJdbcJob.DEFAULT_DIRECTORY, DEFAULT_FILE_NAME).toDSL());
    sources.http(getContainerHostForSource("dataSender")).postData(data);
    job(job.toDSL());
    waitForXD();
    jobLaunch();
    String query = String.format("SELECT data FROM %s", tableName);

    waitForTablePopulation(query, jdbcSink.getJdbcTemplate(), 1);
View Full Code Here

TOP

Related Classes of org.springframework.xd.test.fixtures.FileJdbcJob

Copyright © 2018 www.massapicom. 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.