This repository has been archived by the owner on Apr 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Match case when finding xml element (#792)
- Loading branch information
Showing
5 changed files
with
79 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
test/java/org/opendatakit/briefcase/export/ExportToCsvCaseSensitivityTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright (C) 2018 Nafundi | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
|
||
package org.opendatakit.briefcase.export; | ||
|
||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
public class ExportToCsvCaseSensitivityTest { | ||
private ExportToCsvScenario scenario; | ||
|
||
@Before | ||
public void setUp() { | ||
scenario = ExportToCsvScenario.setUp("simple-form-case-sensitivity"); | ||
} | ||
|
||
@After | ||
public void tearDown() { | ||
scenario.tearDown(); | ||
} | ||
|
||
@Test | ||
public void exports_forms_with_all_data_types() { | ||
scenario.runExport(); | ||
scenario.assertSameContent(); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
test/resources/org/opendatakit/briefcase/export/simple-form-case-sensitivity-submission.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<data id="simple-form-case-sensitivity" instanceID="uuid:0a1b861f-a5fd-4f49-846a-78dcf06cfc1b" version="2018012404" submissionDate="2018-02-01T11:35:19.178Z" isComplete="true" markedAsCompleteDate="2018-02-01T11:35:19.178Z" xmlns="http://opendatakit.org/submissions"> | ||
<field>Some value</field> | ||
<Field>2019-01-01T00:00:00.000Z</Field> | ||
<n0:meta xmlns:n0="http://openrosa.org/xforms"> | ||
<n0:instanceID>uuid:0a1b861f-a5fd-4f49-846a-78dcf06cfc1b</n0:instanceID> | ||
</n0:meta> | ||
</data> |
2 changes: 2 additions & 0 deletions
2
test/resources/org/opendatakit/briefcase/export/simple-form-case-sensitivity.csv.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SubmissionDate,field,Field,meta-instanceID,KEY | ||
"Feb 1, 2018 11:35:19 AM",Some value,"Jan 1, 2019 12:00:00 AM",uuid:0a1b861f-a5fd-4f49-846a-78dcf06cfc1b,uuid:0a1b861f-a5fd-4f49-846a-78dcf06cfc1b |
27 changes: 27 additions & 0 deletions
27
test/resources/org/opendatakit/briefcase/export/simple-form-case-sensitivity.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<h:html xmlns="http://www.w3.org/2002/xforms" xmlns:h="http://www.w3.org/1999/xhtml"> | ||
<h:head> | ||
<h:title>Simple form</h:title> | ||
<model> | ||
<instance> | ||
<data id="simple-form-case-sensitivity"> | ||
<field/> | ||
<Field/> | ||
<meta> | ||
<instanceID/> | ||
</meta> | ||
</data> | ||
</instance> | ||
<itext> | ||
<translation lang="English"> | ||
</translation> | ||
</itext> | ||
<bind nodeset="/data/meta/instanceID" type="string" readonly="true()" calculate="concat('uuid:', uuid())"/> | ||
<bind nodeset="/data/field" type="string"/> | ||
<bind nodeset="/data/Field" type="dateTime"/> | ||
</model> | ||
</h:head> | ||
<h:body> | ||
<input ref="/data/field"/> | ||
<input ref="/data/Field"/> | ||
</h:body> | ||
</h:html> |