use of org.apache.sqoop.client.SqoopClient in project testcases by coheigea.
the class SqoopSentryTest method setup.
@org.junit.BeforeClass
public static void setup() throws Exception {
tempDir = Files.createTempDirectory("sqoop");
String sentrySitePath = "file:" + SqoopSentryTest.class.getResource("/sentry-site.xml").getPath();
jettySqoopRunner = new JettySqoopRunner(tempDir.toString(), "sqoopServer1", sentrySitePath, false);
jettySqoopRunner.start();
// Create some links, jobs via the admin
SqoopClient client = jettySqoopRunner.getSqoopClient("admin");
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);
}
use of org.apache.sqoop.client.SqoopClient in project testcases by coheigea.
the class SqoopRangerTest method testBobUser.
// "bob" can't do anything
@org.junit.Test
public void testBobUser() throws Exception {
SqoopClient client = jettySqoopRunner.getSqoopClient("bob");
assertTrue(client.getConnectors().isEmpty());
assertTrue(client.getLinks().isEmpty());
assertTrue(client.getJobs().isEmpty());
}
use of org.apache.sqoop.client.SqoopClient in project testcases by coheigea.
the class SqoopRangerTest method setup.
@org.junit.BeforeClass
public static void setup() throws Exception {
tempDir = Files.createTempDirectory("sqoop");
jettySqoopRunner = new JettySqoopRunner(tempDir.toString(), "sqoopServer1", null, true);
jettySqoopRunner.start();
// Create some links, jobs via the admin
SqoopClient client = jettySqoopRunner.getSqoopClient("admin");
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);
}
use of org.apache.sqoop.client.SqoopClient 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