forked from OHDSI/WhiteRabbit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'OHDSI:master' into master
- Loading branch information
Showing
23 changed files
with
5,460 additions
and
66 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
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
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
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
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
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
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
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
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
30 changes: 30 additions & 0 deletions
30
rabbit-core/src/test/java/org/ohdsi/rabbitInAHat/dataModel/TestDatabase.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,30 @@ | ||
package org.ohdsi.rabbitInAHat.dataModel; | ||
|
||
import org.apache.commons.io.input.BOMInputStream; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class TestDatabase { | ||
|
||
@Test | ||
void testGenerateModelFromCSV() throws IOException { | ||
// confirm that issue #411 is fixed, can read custom models from (UTF-8) CSV files with and without BOM | ||
|
||
// generate a model from a CSV file without BOM | ||
String testFileWithoutBom = "tiny_riah_without_bom.csv"; | ||
InputStream inWithoutBom = TestDatabase.class.getResourceAsStream(testFileWithoutBom); | ||
assertNotNull(inWithoutBom); | ||
Database ignoredWithoutBom = Database.generateModelFromCSV(inWithoutBom, testFileWithoutBom); | ||
|
||
// generate a model from a CSV file with BOM | ||
String testFileWithBom = "tiny_riah_with_bom.csv"; | ||
InputStream inWithBom = TestDatabase.class.getResourceAsStream(testFileWithBom); | ||
assertNotNull(inWithBom); | ||
Database ignoredWithBom = Database.generateModelFromCSV(inWithBom, testFileWithBom); | ||
|
||
} | ||
} |
Oops, something went wrong.