Search in sources :

Example 6 with MLink

use of org.apache.sqoop.model.MLink in project testcases by coheigea.

the class SqoopTest method testCreateLinksAndJob.

@org.junit.Test
public void testCreateLinksAndJob() throws Exception {
    SqoopClient client = jettySqoopRunner.getSqoopClient("admin");
    assertFalse(client.getConnectors().isEmpty());
    MLink rdbmsLink = client.createLink("generic-jdbc-connector");
    jettySqoopRunner.fillRdbmsLinkConfig(rdbmsLink);
    rdbmsLink.setName("JDBC_link1");
    jettySqoopRunner.saveLink(client, rdbmsLink);
    MLink hdfsLink = client.createLink("hdfs-connector");
    jettySqoopRunner.fillHdfsLink(hdfsLink);
    hdfsLink.setName("HDFS_link1");
    jettySqoopRunner.saveLink(client, hdfsLink);
    MJob job1 = client.createJob(hdfsLink.getName(), rdbmsLink.getName());
    jettySqoopRunner.fillHdfsFromConfig(job1);
    jettySqoopRunner.fillRdbmsToConfig(job1);
    // create job
    job1.setName("HDFS_JDBS_job1");
    jettySqoopRunner.saveJob(client, job1);
}
Also used : MJob(org.apache.sqoop.model.MJob) MLink(org.apache.sqoop.model.MLink) SqoopClient(org.apache.sqoop.client.SqoopClient)

Aggregations

MJob (org.apache.sqoop.model.MJob)6 MLink (org.apache.sqoop.model.MLink)6 SqoopClient (org.apache.sqoop.client.SqoopClient)5 SqoopException (org.apache.sqoop.common.SqoopException)2 File (java.io.File)1 Repository (org.apache.sqoop.repository.Repository)1 RepositoryManager (org.apache.sqoop.repository.RepositoryManager)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1