Skip to content

Commit

Permalink
Touch Up Endpoint
Browse files Browse the repository at this point in the history
Rename test file, and make the resulting zip file more consumable.
  • Loading branch information
AvocadoMoon committed Jan 29, 2025
1 parent 50446a7 commit c428f73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ public File retrieveFiniteVolumeInputFromSpatialModel(@RestForm File sbmlFile) {
sbmlToFiniteVolumeInput(sbmlFile, workingDir);
ZipFile zip = new ZipFile(zipFile);

zip.addFolder(workingDir);
for (File file : workingDir.listFiles()) {
zip.addFile(file);
}
zip.close();

return zipFile;
Expand All @@ -55,13 +57,6 @@ public File retrieveFiniteVolumeInputFromSpatialModel(@RestForm File sbmlFile) {
}
}

public record FiniteVolumeInput(
@RestForm @PartType(MediaType.APPLICATION_OCTET_STREAM)
File zipFile
) { }



public static void sbmlToFiniteVolumeInput(File sbmlFile, File outputDir) throws IOException, MappingException, VCLoggerException, PropertyVetoException, SolverException, ExpressionException {
SBMLExporter.MemoryVCLogger vcl = new SBMLExporter.MemoryVCLogger();
boolean bValidateSBML = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@

import java.beans.PropertyVetoException;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Vector;

@QuarkusTest
public class SpacialResourceTest {
public class SpatialResourceTest {
@ConfigProperty(name = "quarkus.http.test-port")
Integer testPort;

Expand Down Expand Up @@ -100,7 +99,6 @@ public void testSpacialSBMLResults() throws ApiException, IOException, VCLoggerE
zipFile.extractAll(unzipDir.getAbsolutePath());
zipFile.close();

unzipDir = unzipDir.listFiles()[0];

for (int i = 0; i < outputDir.listFiles().length; i++) {
File output = outputDir.listFiles()[i];
Expand Down

0 comments on commit c428f73

Please sign in to comment.