This repository has been archived by the owner on Jan 24, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
continuous data compliance finished (#248)
* continuous data compliance finsihed * Move parent pom to master
- Loading branch information
Showing
10 changed files
with
323 additions
and
0 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
65 changes: 65 additions & 0 deletions
65
cts-java/src/test/java/org/ga4gh/cts/api/sequenceAnnotations/ContinuousSearchIT.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,65 @@ | ||
package org.ga4gh.cts.api.sequenceAnnotations; | ||
|
||
import com.google.protobuf.InvalidProtocolBufferException; | ||
|
||
import com.mashape.unirest.http.exceptions.UnirestException; | ||
|
||
import org.ga4gh.ctk.CtkLogs; | ||
import org.ga4gh.ctk.transport.GAWrapperException; | ||
import org.ga4gh.ctk.transport.URLMAPPING; | ||
import org.ga4gh.ctk.transport.protocols.Client; | ||
import org.ga4gh.cts.api.TestData; | ||
import org.ga4gh.cts.api.Utils; | ||
import org.junit.Test; | ||
import org.junit.experimental.categories.Category; | ||
|
||
import java.util.List; | ||
import java.util.function.Consumer; | ||
|
||
import ga4gh.SequenceAnnotationServiceOuterClass.SearchContinuousRequest; | ||
import ga4gh.SequenceAnnotationServiceOuterClass.SearchContinuousResponse; | ||
import ga4gh.SequenceAnnotations.Continuous; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
/** | ||
* Test searching continuous data. | ||
*/ | ||
@Category(SequenceAnnotationTests.class) | ||
public class ContinuousSearchIT implements CtkLogs { | ||
|
||
private static Client client = new Client(URLMAPPING.getInstance()); | ||
|
||
|
||
/** | ||
* Fetch continuous data between two positions in the reference. The number of values must | ||
* equal what we're expecting by examination of the continuous data. | ||
* | ||
* @throws GAWrapperException if the server finds the request invalid in some way | ||
* @throws UnirestException if there's a problem speaking HTTP to the server | ||
* @throws InvalidProtocolBufferException if there's a problem processing the JSON response from the server | ||
*/ | ||
|
||
@Test | ||
public void checkExpectedNumberOfValues() throws InvalidProtocolBufferException, UnirestException, GAWrapperException { | ||
final long start = 50083750; | ||
final long end = 50083800; | ||
final String referenceName = "chr19"; | ||
final int expectedNumberOfValues = 25; | ||
|
||
final String id = Utils.getContinuousSetId(client); | ||
|
||
final SearchContinuousRequest fReq = | ||
SearchContinuousRequest.newBuilder() | ||
.setContinuousSetId(id) | ||
.setReferenceName(referenceName) | ||
.setStart(start).setEnd(end) | ||
.build(); | ||
final SearchContinuousResponse fResp = client.sequenceAnnotations.searchContinuous(fReq); | ||
final List<Continuous> searchContinuous = fResp.getContinuousList(); | ||
|
||
assertThat(searchContinuous).isNotEmpty(); | ||
Continuous msg = searchContinuous.get(0); | ||
assertThat(msg.getValuesList()).hasSize(expectedNumberOfValues); | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
cts-java/src/test/java/org/ga4gh/cts/api/sequenceAnnotations/ContinuousSetsGetByIdIT.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,58 @@ | ||
package org.ga4gh.cts.api.sequenceAnnotations; | ||
|
||
import com.google.protobuf.InvalidProtocolBufferException; | ||
|
||
import com.mashape.unirest.http.exceptions.UnirestException; | ||
|
||
import org.ga4gh.ctk.transport.GAWrapperException; | ||
import org.ga4gh.ctk.transport.URLMAPPING; | ||
import org.ga4gh.ctk.transport.protocols.Client; | ||
import org.ga4gh.cts.api.Utils; | ||
import org.junit.Test; | ||
import org.junit.experimental.categories.Category; | ||
import org.junit.runner.RunWith; | ||
|
||
import java.util.List; | ||
|
||
import ga4gh.SequenceAnnotations.ContinuousSet; | ||
import junitparams.JUnitParamsRunner; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
/** | ||
* Tests for <tt>GET /continuousSets/{id}</tt>. | ||
* | ||
* @author Maciek Smuga-Otto | ||
*/ | ||
@Category(SequenceAnnotationTests.class) | ||
@RunWith(JUnitParamsRunner.class) | ||
public class ContinuousSetsGetByIdIT { | ||
|
||
private static Client client = new Client(URLMAPPING.getInstance()); | ||
|
||
/** | ||
* Verify that ContinuousSets that we obtain by way of {@link ga4gh.SequenceAnnotationServiceOuterClass.SearchContinuousSetsRequest } | ||
* match the ones we get via <tt>GET /continuousSets/{id}</tt>. | ||
* @throws GAWrapperException if the server finds the request invalid in some way | ||
* @throws UnirestException if there's a problem speaking HTTP to the server | ||
* @throws InvalidProtocolBufferException if there's a problem processing the JSON response from the server | ||
*/ | ||
@Test | ||
public void checkContinuousSetsGetResults() throws InvalidProtocolBufferException, UnirestException, GAWrapperException { | ||
final int expectedNumberOfContinuousSets = 1; | ||
|
||
final List<ContinuousSet> continuousSets = Utils.getAllContinuousSets(client); | ||
|
||
assertThat(continuousSets).hasSize(expectedNumberOfContinuousSets); | ||
|
||
for (final ContinuousSet continuousSetFromSearch : continuousSets) { | ||
final ContinuousSet continuousSetFromGet = client.sequenceAnnotations.getContinuousSet(continuousSetFromSearch.getId()); | ||
assertThat(continuousSetFromGet).isNotNull(); | ||
|
||
assertThat(continuousSetFromGet).isEqualTo(continuousSetFromSearch); | ||
} | ||
|
||
} | ||
|
||
|
||
} |
55 changes: 55 additions & 0 deletions
55
cts-java/src/test/java/org/ga4gh/cts/api/sequenceAnnotations/ContinuousSetsSearchIT.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,55 @@ | ||
package org.ga4gh.cts.api.sequenceAnnotations; | ||
|
||
import com.google.protobuf.InvalidProtocolBufferException; | ||
|
||
import com.mashape.unirest.http.exceptions.UnirestException; | ||
|
||
import org.assertj.core.api.StrictAssertions; | ||
import org.ga4gh.ctk.transport.GAWrapperException; | ||
import org.ga4gh.ctk.transport.URLMAPPING; | ||
import org.ga4gh.ctk.transport.protocols.Client; | ||
import org.ga4gh.cts.api.Utils; | ||
import org.junit.Test; | ||
import org.junit.experimental.categories.Category; | ||
|
||
import java.util.List; | ||
|
||
import ga4gh.SequenceAnnotations.ContinuousSet; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
/** | ||
* Tests for <tt>POST /continuousSets/search</tt>. | ||
* | ||
* @author Maciek Smuga-Otto | ||
*/ | ||
@Category(SequenceAnnotationTests.class) | ||
public class ContinuousSetsSearchIT { | ||
|
||
|
||
private static Client client = new Client(URLMAPPING.getInstance()); | ||
|
||
/** | ||
* Check SequenceAnnotationSets contain some analysis data. | ||
* @throws GAWrapperException if the server finds the request invalid in some way | ||
* @throws UnirestException if there's a problem speaking HTTP to the server | ||
* @throws InvalidProtocolBufferException if there's a problem processing the JSON response from the server | ||
*/ | ||
@Test | ||
public void checkSearchingContinuousSets() throws InvalidProtocolBufferException, UnirestException, GAWrapperException { | ||
|
||
// Seek a list of SequenceAnnotationSets for the compliance dataset. | ||
final List<ContinuousSet> continuousSets = Utils.getAllContinuousSets(client); | ||
|
||
// check some are available | ||
assertThat(continuousSets).isNotEmpty(); | ||
|
||
// Check the continuousSetId is as expected. | ||
continuousSets.stream() | ||
.forEach(sas -> StrictAssertions.assertThat(sas.getName()).isNotNull()); | ||
} | ||
|
||
|
||
} | ||
|
||
|
Binary file added
BIN
+8.56 MB
test-data/wgEncodeCaltechRnaSeqNhekR1x75dTh1014IlnaMinusSignalRep1.bigWig
Binary file not shown.