-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EVA-3425 make sure reference and alternate are always uppercase (#107)
* make sure reference and alternate are always uppercase
- Loading branch information
Showing
17 changed files
with
156 additions
and
24 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
19 changes: 19 additions & 0 deletions
19
variation-commons-core/src/test/java/uk/ac/ebi/eva/commons/core/models/GenotypeTest.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,19 @@ | ||
package uk.ac.ebi.eva.commons.core.models; | ||
|
||
import org.junit.Test; | ||
import uk.ac.ebi.eva.commons.core.models.genotype.Genotype; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class GenotypeTest { | ||
|
||
@Test | ||
public void testChangeRefAltToUpperCase() { | ||
Genotype genotype = new Genotype("", "a", "t"); | ||
|
||
assertEquals("A", genotype.getReference()); | ||
assertEquals("T", genotype.getAlternate()); | ||
} | ||
|
||
|
||
} |
18 changes: 18 additions & 0 deletions
18
...n-commons-core/src/test/java/uk/ac/ebi/eva/commons/core/models/VariantStatisticsTest.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,18 @@ | ||
package uk.ac.ebi.eva.commons.core.models; | ||
|
||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class VariantStatisticsTest { | ||
|
||
@Test | ||
public void testChangeRefAltToUpperCase() { | ||
VariantStatistics variantStatistics = new VariantStatistics("a", "t", null, | ||
-1, -1, "", "", -1, -1, -1, | ||
-1, -1, -1, -1); | ||
assertEquals("A", variantStatistics.getRefAllele()); | ||
assertEquals("T", variantStatistics.getAltAllele()); | ||
} | ||
|
||
} |
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
28 changes: 28 additions & 0 deletions
28
...on-commons-mongodb/src/test/java/uk/ac/ebi/eva/commons/mongodb/SimplifiedVariantTest.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,28 @@ | ||
package uk.ac.ebi.eva.commons.mongodb; | ||
|
||
import org.junit.Test; | ||
import uk.ac.ebi.eva.commons.mongodb.entities.projections.SimplifiedVariant; | ||
|
||
import java.lang.reflect.Field; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class SimplifiedVariantTest { | ||
|
||
@Test | ||
public void testChangeRefAltToUpperCase() throws NoSuchFieldException, IllegalAccessException { | ||
SimplifiedVariant simplifiedVariant = new SimplifiedVariant(null, "", -1, -1, | ||
-1, "a", "t", null); | ||
|
||
Field refField = SimplifiedVariant.class.getDeclaredField("reference"); | ||
Field altField = SimplifiedVariant.class.getDeclaredField("alternate"); | ||
refField.setAccessible(true); | ||
altField.setAccessible(true); | ||
String refValue = (String) refField.get(simplifiedVariant); | ||
String altValue = (String) altField.get(simplifiedVariant); | ||
|
||
assertEquals("A", refValue); | ||
assertEquals("T", altValue); | ||
|
||
} | ||
} |
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
Oops, something went wrong.