@Test public void testLinkNameNotNull() { assertEquals(getNumberOfLinks(), getClient().getLinks().size()); for (MLink link : getClient().getLinks()) { assertNotNull(link.getName()); } MLink link = getClient().createLink("generic-jdbc-connector"); assertNull(link.getName()); assertEquals(getClient().saveLink(link), Status.ERROR); }
@Test public void testBasic() throws Exception { createFromFile( "input-0001", "1,'USA','2004-10-23','San Francisco'", "2,'USA','2004-10-24','Sunnyvale'", "3,'Czech Republic','2004-10-25','Brno'", "4,'USA','2004-10-26','Palo Alto'"); // RDBMS link MLink rdbmsLink = getClient().createLink("generic-jdbc-connector"); fillRdbmsLinkConfig(rdbmsLink); saveLink(rdbmsLink); // HDFS link MLink hdfsLink = getClient().createLink("hdfs-connector"); fillHdfsLink(hdfsLink); saveLink(hdfsLink); // Job creation MJob job = getClient().createJob(hdfsLink.getName(), rdbmsLink.getName()); // set hdfs "FROM" config for the job, since the connector test case base class only has // utilities for hdfs! fillHdfsFromConfig(job); // set the rdbms "TO" config here fillRdbmsToConfig(job); // driver config MDriverConfig driverConfig = job.getDriverConfig(); driverConfig.getIntegerInput("throttlingConfig.numExtractors").setValue(3); saveJob(job); executeJob(job); assertEquals(4L, provider.rowCount(getTableName())); assertRowInCities(1, "USA", "2004-10-23", "San Francisco"); assertRowInCities(2, "USA", "2004-10-24", "Sunnyvale"); assertRowInCities(3, "Czech Republic", "2004-10-25", "Brno"); assertRowInCities(4, "USA", "2004-10-26", "Palo Alto"); }