use of org.activityinfo.server.endpoint.rest.SchemaCsvWriter in project activityinfo by bedatadriven.
the class GetSchemaTest method toCSV.
@Test
public void toCSV() throws IOException {
int databaseId = 1;
SchemaCsvWriter writer = new SchemaCsvWriter(getDispatcherSync());
writer.write(databaseId);
System.out.println(writer.toString());
}
use of org.activityinfo.server.endpoint.rest.SchemaCsvWriter in project activityinfo by bedatadriven.
the class SchemaImporterV2Test method syria.
@Test
public void syria() throws IOException {
UserDatabaseDTO syria = doImport("schema_1064.csv");
int activityId = syria.getActivities().get(0).getId();
ActivityFormDTO cash = execute(new GetActivityForm(activityId));
for (AttributeGroupDTO group : cash.getAttributeGroups()) {
System.out.println(group.getName());
}
assertThat(cash.getName(), equalTo("1.Provision of urgent cash assistance"));
assertThat(cash.getAttributeGroups().size(), equalTo(3));
SchemaCsvWriter writer = new SchemaCsvWriter(getDispatcherSync());
writer.write(syria.getId());
Files.write(writer.toString(), TestOutput.getFile(getClass(), "syria", ".csv"), Charsets.UTF_8);
}
Aggregations