public void testGenerateDownloadMap() {
Mapping m = MappingHelper.readFromTestFile("parser/download-map.ttl");
MappingHelper.connectToDummyDBs(m);
Resource name = ResourceFactory.createResource("http://example.org/dm");
assertTrue(m.downloadMapResources().contains(name));
DownloadMap d = m.downloadMap(name);
assertNotNull(d);
assertEquals("image/png",
d.getMediaTypeValueMaker().makeValue(
new ResultRow() {public String get(ProjectionSpec column) {return null;}}));
assertEquals("People.pic", d.getContentDownloadColumn().qualifiedName());
assertEquals("URI(Pattern(http://example.org/downloads/@@People.ID@@))",
d.nodeMaker().toString());
assertEquals(
new HashSet<ProjectionSpec>() {{
add(SQL.parseAttribute("People.ID"));
add(SQL.parseAttribute("People.pic"));
}},
d.getRelation().projections());
assertTrue(d.getRelation().isUnique());
assertTrue(d.getRelation().condition().isTrue());
assertTrue(d.getRelation().joinConditions().isEmpty());
}