-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add categories to Design-time benchmarks
- Loading branch information
1 parent
d8707c0
commit 5dce109
Showing
3 changed files
with
139 additions
and
55 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
81 changes: 81 additions & 0 deletions
81
src/test/java/nl/esciencecenter/PubmetricBenchmarksTest.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,81 @@ | ||
package nl.esciencecenter; | ||
|
||
import org.json.JSONObject; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
|
||
import java.io.IOException; | ||
|
||
import nl.esciencecenter.restape.ToolBenchmarkingAPIs; | ||
|
||
public class PubmetricBenchmarksTest { | ||
|
||
// @Test | ||
// public void testSendPostToPubmetricWithFile() throws IOException { | ||
// // Read CWL file content from the file system | ||
// File cwlFile = new File("/Users/vedran/Downloads/candidate_workflow_4.cwl"); // Replace with the actual path | ||
// byte[] fileContent = Files.readAllBytes(cwlFile.toPath()); | ||
|
||
// // Call the method to test | ||
// JSONObject response = ToolBenchmarkingAPIs.sendPostToPubmetric(fileContent); | ||
|
||
// // Verify that the response is not null | ||
// assertFalse(response.isEmpty()); | ||
// } | ||
|
||
@Test | ||
public void testSendPostToPubmetricWithString() throws IOException { | ||
// Hardcoded CWL content string | ||
String cwlFileContent = """ | ||
# WorkflowNo_3 | ||
# This workflow is generated by APE (https://github.com/sanctuuary/APE). | ||
cwlVersion: v1.2 | ||
class: Workflow | ||
label: WorkflowNo_3 | ||
doc: A workflow including the tool(s) Comet, idconvert, ProteinProphet. | ||
inputs: | ||
input_1: | ||
type: File | ||
format: "http://edamontology.org/format_3244" # mzML | ||
input_2: | ||
type: File | ||
format: "http://edamontology.org/format_1929" # FASTA | ||
steps: | ||
Comet_01: | ||
run: https://raw.githubusercontent.com/Workflomics/containers/main/cwl/tools/Comet/Comet.cwl | ||
in: | ||
Comet_in_1: input_1 | ||
Comet_in_2: input_2 | ||
out: [Comet_out_1, Comet_out_2, Comet_out_3] | ||
idconvert_02: | ||
run: https://raw.githubusercontent.com/Workflomics/containers/main/cwl/tools/idconvert/idconvert_to_pepXML.cwl | ||
in: | ||
idconvert_in_1: Comet_01/Comet_out_2 | ||
out: [idconvert_out_1] | ||
ProteinProphet_03: | ||
run: https://raw.githubusercontent.com/Workflomics/containers/main/cwl/tools/ProteinProphet/ProteinProphet.cwl | ||
in: | ||
ProteinProphet_in_1: idconvert_02/idconvert_out_1 | ||
ProteinProphet_in_2: input_2 | ||
out: [ProteinProphet_out_1, ProteinProphet_out_2] | ||
outputs: | ||
output_1: | ||
type: File | ||
format: "http://edamontology.org/format_3747" # protXML | ||
outputSource: ProteinProphet_03/ProteinProphet_out_1 | ||
"""; | ||
|
||
// Convert the string to a byte array | ||
byte[] cwlFileBytes = cwlFileContent.getBytes(); | ||
|
||
// Call the method to test | ||
JSONObject response = ToolBenchmarkingAPIs.sendPostToPubmetric(cwlFileBytes); | ||
|
||
// Verify that the response is not null | ||
assertFalse(response.isEmpty()); | ||
} | ||
} |