Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove spaces between commas in CSVs #3111

Merged
merged 1 commit into from
May 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void updateHeaderTest() throws IOException, ExecutionException, Interrupt
AuditEventSaveTask auditEventSaveTask = new AuditEventSaveTask(testFile, false, false);
auditEventSaveTask.execute(getSampleAuditEventsWithoutLocations().toArray(new AuditEvent[0])).get();
String expectedAuditContent = FileUtils.readFileToString(testFile);
String expectedData = "event, node, start, end\n" +
String expectedData = "event,node,start,end\n" +
"form start,,1548106927319,\n" +
"question,/data/q1,1548106927323,1548106930112\n" +
"add repeat,/data/g1[1],1548106930118,1548106931611\n" +
Expand All @@ -88,7 +88,7 @@ public void updateHeaderTest() throws IOException, ExecutionException, Interrupt
auditEventSaveTask = new AuditEventSaveTask(testFile, true, false);
auditEventSaveTask.execute(getMoreSampleAuditEventsWithLocations().toArray(new AuditEvent[0])).get();
expectedAuditContent = FileUtils.readFileToString(testFile);
String expectedData2 = "event, node, start, end, latitude, longitude, accuracy\n" +
String expectedData2 = "event,node,start,end,latitude,longitude,accuracy\n" +
"form start,,1548106927319,\n" +
"question,/data/q1,1548106927323,1548106930112\n" +
"add repeat,/data/g1[1],1548106930118,1548106931611\n" +
Expand All @@ -115,7 +115,7 @@ public void updateHeaderTest() throws IOException, ExecutionException, Interrupt
auditEventSaveTask = new AuditEventSaveTask(testFile, true, true);
auditEventSaveTask.execute(getMoreSampleAuditEventsWithLocationsAndTrackingChanges().toArray(new AuditEvent[0])).get();
expectedAuditContent = FileUtils.readFileToString(testFile);
String expectedData3 = "event, node, start, end, latitude, longitude, accuracy, old-value, new-value\n" +
String expectedData3 = "event,node,start,end,latitude,longitude,accuracy,old-value,new-value\n" +
"form start,,1548106927319,\n" +
"question,/data/q1,1548106927323,1548106930112\n" +
"add repeat,/data/g1[1],1548106930118,1548106931611\n" +
Expand Down Expand Up @@ -151,7 +151,7 @@ public void saveAuditWithLocation() throws ExecutionException, InterruptedExcept
AuditEventSaveTask auditEventSaveTask = new AuditEventSaveTask(testFile, true, false);
auditEventSaveTask.execute(getSampleAuditEventsWithLocations().toArray(new AuditEvent[0])).get();
String expectedAuditContent = FileUtils.readFileToString(testFile);
String expectedData = "event, node, start, end, latitude, longitude, accuracy\n" +
String expectedData = "event,node,start,end,latitude,longitude,accuracy\n" +
"form start,,1548106927319,,,,\n" +
"location tracking enabled,,548108908250,,,,\n" +
"location permissions granted,,548108908255,,,,\n" +
Expand All @@ -174,7 +174,7 @@ public void saveAuditWithLocationAndTrackingChanges() throws ExecutionException,
AuditEventSaveTask auditEventSaveTask = new AuditEventSaveTask(testFile, true, true);
auditEventSaveTask.execute(getSampleAuditEventsWithLocationsAndTrackingChanges().toArray(new AuditEvent[0])).get();
String expectedAuditContent = FileUtils.readFileToString(testFile);
String expectedData = "event, node, start, end, latitude, longitude, accuracy, old-value, new-value\n" +
String expectedData = "event,node,start,end,latitude,longitude,accuracy,old-value,new-value\n" +
"form start,,1548106927319,,,,,,\n" +
"location tracking enabled,,548108908250,,,,,,\n" +
"location permissions granted,,548108908255,,,,,,\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public class AuditEventSaveTask extends AsyncTask<AuditEvent, Void, Void> {
private final boolean isLocationEnabled;
private final boolean isTrackingChangesEnabled;

private static final String DEFAULT_COLUMNS = "event, node, start, end";
private static final String LOCATION_COORDINATES_COLUMNS = ", latitude, longitude, accuracy";
private static final String ANSWER_VALUES_COLUMNS = ", old-value, new-value";
private static final String DEFAULT_COLUMNS = "event,node,start,end";
private static final String LOCATION_COORDINATES_COLUMNS = ",latitude,longitude,accuracy";
private static final String ANSWER_VALUES_COLUMNS = ",old-value,new-value";

public AuditEventSaveTask(@NonNull File file, boolean isLocationEnabled, boolean isTrackingChangesEnabled) {
this.file = file;
Expand Down