Skip to content

Commit

Permalink
Remove spaces between commas in CSVs
Browse files Browse the repository at this point in the history
  • Loading branch information
lognaturel authored and grzesiek2010 committed May 29, 2019
1 parent df4910e commit ad88868
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
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

0 comments on commit ad88868

Please sign in to comment.