public void testSimpleModel() throws Exception
{
RestLiResourceModelExporter exporter = new RestLiResourceModelExporter();
assertEquals(outdir.list().length, 0);
GeneratorResult result = exporter.export("twitter",
null,
new String[] {moduleDir + FS + TEST_DIR},
new String[] {"com.linkedin.restli.tools.twitter"},
null,
outdir.getAbsolutePath());
String[] expectedFiles = {STATUSES_FILE, FOLLOWS_FILE, ACCOUNTS_FILE, STATUSES_PARAMS_FILE, TRENDING_FILE};
assertEquals(outdir.list().length, expectedFiles.length);
assertEquals(result.getModifiedFiles().size(), expectedFiles.length);
assertEquals(result.getTargetFiles().size(), expectedFiles.length);
for (String file : expectedFiles)
{
String actualFile = outdir + FS + file;
String expectedFile = moduleDir + FS + IDLS_DIR + FS + file;
compareFiles(actualFile, expectedFile);
assertTrue(result.getModifiedFiles().contains(new File(actualFile)));
assertTrue(result.getTargetFiles().contains(new File(actualFile)));
}
}