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);
}
Aggregations